禁用PHP Eclipse Photon中的部分验证(注释) [英] Disable part of validation (annotations) in PHP Eclipse Photon

查看:50
本文介绍了禁用PHP Eclipse Photon中的部分验证(注释)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了最新版本的Eclipse for PHP,即Photon Release(4.8.0).主要问题在于,默认情况下,此IDE会尝试验证每个文件,因此到处都有大量错误,例如无法解析的导入,未知的类型和类以及更多我无法摆脱的错误,它们使代码闪烁为红色和橙色下划线.

I just installed newest version of Eclipse for PHP, its Photon Release (4.8.0). The main problem is that by default this IDE tries to validate each file, so everywhere there is a vast amount of errors as unresolved imports, unknown types and classes and more, which I cant get rid of, and they make code flashing in reds and orange underscores.

事实:

  • Eclipse版本:Photon发行版(4.8.0)
  • 我正在通过远程系统资源管理器连接远程文件
  • 没有Eclipse项目(我希望这并不重要,因为这是一个非常大的系统,因此用Eclipse索引所有文件可能会花费很多时间-我在Eclipse的早期版本中尝试过12小时后放弃了)
  • 在早期版本的Eclipse中(我不记得确切的数字),我具有相同的配置,并且可以禁用一些不需要的验证
  • Version of Eclipse: Photon Release (4.8.0)
  • I'm connecting with remote files via Remote System Explorer
  • I don't have Eclipse project (I hope it's not important fact beacuse this is very large system and indexing all files by Eclipse could take a lot - I tried it in earlier version of Eclipse and gave up after 12 hours)
  • In previous version of Eclipse (I don't remember exact number) I had same configuration and disabling some of unwanted validations was possible

我尝试过的事情:

  • 转到 Project>属性>验证并禁用所有内容
  • 转到 Window>偏好设置>PHP>验证>错误/警告,这正是将要解决的问题,因为其中列出的那些语义检查"确实是我想禁用的.除了此处的任何更改都会被IDE忽略...
  • 转到 Window>偏好设置>一般>编辑>文字编辑器>注释,并禁用错误和警告注释.是的,它有效.但它也会禁用所有通知,例如.语法错误,这是不可接受的解决方案.
  • Go to Project > Properties > Validation and disable everything
  • Go to Window > Preferences > PHP > Validation > Errors/Warnings and this is what would solve the problem as those "Semantics checks" listed there is exacly what I would like to disable. Except that any changes here are ignored by IDE...
  • Go to Window > Preferences > General > Editors > Text editors > Annotations and disable error and warning annotations. Yes it works. But also it disable all notifications eg. syntax errors, which is not acceptable solution.

@howlger提供的解决方案有效,但是在一种情况下.

Solution offered by @howlger works, but under one condition.

如果您在Eclipse中没有PHP项目,并且不想索引所有文件,则可以转到 Project>属性>Project Natures 并添加 PHP属性.在此Eclipse开始将来自Remote System Explorer的所有远程文件夹解释为PHP项目之后,现在PHP项目的设置将应用于这些文件.

If you don't have PHP project in Eclipse and don't want to index all your files, you can go to Project > Properties > Project Natures and add PHP Properties. Looks like after this Eclipse started to interpret all my remote folder from Remote System Explorer as PHP project and now settings for PHP projects apply to those files.

之后,在 Project>中属性 PHP 选项卡显示在我按照@howlger指令修复问题的位置,非常感谢!

After that in Project > Properties the PHP tab showed up where I followed @howlger instructions to fix problem, thanks a lot!

推荐答案

您必须为此配置 Build Path (默认为项目文件夹):

You have to configure the Build Path (which is by default the project folder) for that:

项目>属性:PHP>源路径>构建路径

Project > Properties: PHP > Source Paths > Build Path

这篇关于禁用PHP Eclipse Photon中的部分验证(注释)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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