更改Eclipse设置以忽略特定文件上的错误 [英] Change Eclipse settings to ignore errors on a specific file

查看:541
本文介绍了更改Eclipse设置以忽略特定文件上的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的eclipse动态Web项目中,我的js源文件夹中有jQuery。由于某些原因,Eclipse没有正确处理它,并将许多行解释为标准jQuery文件中的错误(即使我安装了JavaScript开发工具)。



我可以关闭jQuery文件的错误检查(仅该文件)?我仍然希望它像往常一样检测错误,但忽略jQuery.js中的任何内容。

解决方案

看起来像eclipse已经改变了位,

,但对我来说,以下方法似乎非常接近旧的。



解决方案由两个步骤组成:


  1. 首先你必须更新Eclipse的首选项( Window> Preferences ):





    确保您同时检查手动& 建立旁边验证器您需要

    (在我的例子中是一个javascript)。


  2. 最后,您应该更改项目的验证器:





    点击客户端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:

  1. First you have to update Eclipse's preferences (Window > Preferences):

    Make sure that you check both Manual & Build next to the Validator you need
    (in my case - a javascript one).

  2. 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 on Add rule....
    Then pick Folder 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆