Using Eclipse Juno SR1:
使用Eclipse Juno SR1:
I have Tapestry Tools installed in my eclipse installation, and I've customized my XML Formatter too.
我在我的eclipse安装中安装了Tapestry Tools,并且我也定制了我的XML Formatter。
However, regardless whether I open the tml file in the TML editor or the XML editor, when I let eclipse format the file, different formatting rules are used than for "normal" XML files.
但是,无论我是否在TML编辑器或XML编辑器中打开tml文件,当我让eclipse格式化文件时,使用的格式规则与“普通”XML文件不同。
How can I make sure the same rules apply?
我如何确保适用相同的规则?
Also, why does the formatter sometimes allow longer lines than the specified line width? it seems it only introduces a line break if an attribute is beyond the limit, but not if the attribute value is too long...
另外,为什么格式化程序有时允许比指定行宽更长的行?它似乎只在属性超出限制时引入换行符,但如果属性值太长则不会...
Referenced Questions:
参考问题:
How to configure Eclipse XML formatting?
如何配置Eclipse XML格式?
Export the Eclipse XML Formatting Rules?
导出Eclipse XML格式规则?
1 个解决方案
#1
3
Make a *.tml act like a *.xml by doing this:
通过执行以下操作,使* .tml行为像* .xml:
- In the preferences, go to General > Content Types.
- 在首选项中,转到常规>内容类型。
- Under Content types: scroll down and expand
Text
. - 在内容类型下:向下滚动并展开文本。
- Scroll down to
XML
. - 向下滚动到XML。
- For the File Associations click Add and put in
*.tml
. - 对于文件关联,单击添加并输入* .tml。
#1
3
Make a *.tml act like a *.xml by doing this:
通过执行以下操作,使* .tml行为像* .xml:
- In the preferences, go to General > Content Types.
- 在首选项中,转到常规>内容类型。
- Under Content types: scroll down and expand
Text
. - 在内容类型下:向下滚动并展开文本。
- Scroll down to
XML
. - 向下滚动到XML。
- For the File Associations click Add and put in
*.tml
. - 对于文件关联,单击添加并输入* .tml。