更改Eclipse设置以忽略特定文件上的错误 [英] Change Eclipse settings to ignore errors on a specific file
问题描述
我可以关闭jQuery文件的错误检查(仅该文件)?我仍然希望它像往常一样检测错误,但忽略jQuery.js中的任何内容。
看起来像eclipse已经改变了位,
,但对我来说,以下方法似乎非常接近旧的。
解决方案由两个步骤组成:
-
首先你必须更新Eclipse的首选项(
Window> Preferences
):
确保您同时检查
手动
&建立
旁边验证器
您需要
(在我的例子中是一个javascript)。 -
最后,您应该更改项目的验证器:
点击
客户端JavaScript设置
(或您需要的任何其他验证器):
解释很清楚,但基本上你应该做如下:
点击
添加排除组...
,选择它,然后点击添加规则...
。
然后选择文件夹或文件名
(请注意,还有其他选项),并指定您的文件/文件夹。
你应该通过删除现有的错误/警告
,然后左键单击您的项目并选择 Validate
选项,以验证其工作。
此设置也可以提交到源代码管理中。
In my dynamic web project in eclipse, I have jQuery in my js source folder. For some reason, Eclipse is not handling it correctly and interpreting many lines as errors in the standard jQuery file (even though I have the javascript development tools installed).
Can I turn off the error checking on the jQuery file (and that file only)? I still want it to detect errors as usual, but ignore anything in jQuery.js.
It looks like eclipse has changed a bit,
but the following method which worked for me seems very close to the old one.
The solution consists of 2 steps:
First you have to update Eclipse's preferences (
Window > Preferences
):Make sure that you check both
Manual
&Build
next to theValidator
you need
(in my case - a javascript one).Last you should change your project's Validators:
Click on
Client-side JavaScript Settings
(or any other validator you need):The explanation is clear but basically what you should do is as follows:
Click on
Add Exclude Group...
, select it and then click onAdd rule...
.
Then pickFolder or file name
(note that there are other options), and specify your file/folder.
You should be able to verify that its working by deleting the existing errors/warnings,
and then left-click your project and select the Validate
option.
This setting can be committed into source control as well.
这篇关于更改Eclipse设置以忽略特定文件上的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!