在 Eclipse 中关闭选定的 HTML 错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1246450/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Turn off selected HTML errors in eclipse
提问by Jay
I recently upgraded my Eclipse to Ganymede, version 3.4.2.
我最近将我的 Eclipse 升级到了 Ganymede,版本 3.4.2。
Now it's giving me a ton of errors on the HTML in my JSPs for things like parameter values with no quotes and missing end tags. These pages work fine because the cases where I leave these things out are cases where they're optional. We can argue about whether I should include them, but right now I'm trying to make simple updates to a page and I don't want to revisit the entire page. But it's hard to pick out the real errors when all these style warnings are flagged as errors.
现在,它给我的 JSP 中的 HTML 带来了大量错误,例如没有引号和缺少结束标记的参数值。这些页面工作正常,因为我忽略这些内容的情况是它们是可选的情况。我们可以争论我是否应该包括它们,但现在我正在尝试对页面进行简单的更新,我不想重新访问整个页面。但是当所有这些样式警告都被标记为错误时,很难找出真正的错误。
Is there a way to turn this off?
有没有办法关闭它?
I found Window > Preferences > Web > HTML > Validation that lists errors like these and changed them from "Error" to "Ignore", but it made no difference. Apparently this isn't what controls it.
我发现 Window > Preferences > Web > HTML > Validation 列出了这些错误并将它们从“错误”更改为“忽略”,但没有任何区别。显然这不是控制它的原因。
(Yes, yes, I know, the style purists will say that I should include all the optional quotes and end tags. I often don't because I see them as clutter. I really don't understand the philosophy that says, "Typing in this text will make absolutely no functional difference, it doesn't do anything at all, but you should do it because, well, because I said so.")
(是的,是的,我知道,风格纯粹主义者会说我应该包括所有可选的引号和结束标签。我经常不这样做,因为我认为它们很混乱。我真的不明白“打字在本文中绝对不会产生任何功能上的差异,它根本不会做任何事情,但是您应该这样做,因为,好吧,因为我是这么说的。”)
采纳答案by Daniel F. Thornton
Have you tried:
你有没有尝试过:
- Click
Window > Preferences
. A Preferences window appears.- In the Preferences window, click
Workbench > Editors
.- Select one of the following options:
- To turn off real-time syntax validation, click
Structured Text Editor
and uncheck theAnalyze annotations while typing
box.- To control other annotation settings, click
Annotations
and select your annotation preferences.- Click OK to save your preferences and close the page.
- 单击
Window > Preferences
。出现首选项窗口。- 在首选项窗口中,单击
Workbench > Editors
。- 选择以下选项之一:
- 要关闭实时语法验证,请单击
Structured Text Editor
并取消选中该Analyze annotations while typing
框。- 要控制其他注释设置,请单击
Annotations
并选择您的注释首选项。- 单击确定保存您的首选项并关闭页面。
From this Ganymede help page.
来自这个Ganymede 帮助页面。
Another method: Window > Preferences > Validation
. Then uncheck the Manual
and Build
boxes next to HTML Syntax Validator
and JSP Syntax Validator
.
另一种方法:Window > Preferences > Validation
。然后取消Manual
和Build
旁边的框HTML Syntax Validator
和JSP Syntax Validator
。
回答by Lobo
- Right click on your project in Eclipse.
- Select 'Properties'.
- Select 'Validation'.
- Check 'Enable project specific settings'.
- Uncheck any validators you want (such as HTML Syntax Validator)
- Rebuild project.
- 在 Eclipse 中右键单击您的项目。
- 选择“属性”。
- 选择“验证”。
- 选中“启用项目特定设置”。
- 取消选中您想要的任何验证器(例如 HTML 语法验证器)
- 重建项目。
You may need to go into Windows->Preferences->Validation and check 'Allow projects to override these preference settings'.
您可能需要进入 Windows->Preferences->Validation 并选中“允许项目覆盖这些首选项设置”。
回答by Sameer Kazi
Check this Go to
检查这个去
Window > Preferences. Under Web > HTML Files > Validation
窗口 > 首选项。在 Web > HTML 文件 > 验证下
you'll find "Missing start tag:" and "Missing end tag:"
您会发现“缺少开始标签:”和“缺少结束标签:”