且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PhpStorm初始化字段上下文菜单未显示

更新时间:2023-10-11 22:52:52

将一部分应用程序代码(例如:vendor/ app_modules )添加到排除目录中时,就会发生此问题.列表(首选项" |目录").这会导致检查功能以及其他功能(例如,未使用的use语句不再用灰色突出显示,phpmd,phpcs通知和警告不再显示,sonarlint不再显示对当前文件的分析)按预期停止工作.

The issue occurs when a portion of the application code (ex: vendor/app_modules) is added to the Excluded Directories list (Preferences | Directories). This causes the inspections functionality, amongst others (for example unused use statements are no longer highlighted with grey, phpmd, phpcs notices and warnings are no longer displayed, sonarlint no longer shows analysis on the current file) to stop working as expected.

在我的情况下,由于.gitignore文件中定义的指令(在PhpStorm中创建项目时发生),供应商模块自动添加到排除目录"列表中.

In my case the vendor modules were automatically added to the Excluded Directories list because of the directives defined in the .gitignore file (this happens when the project is created in PhpStorm).

# .gitignore file sample directive
vendor/

从排除列表中删除每个条目后,检查,phpmd和phpcs警告,sonarlint分析以及所有其他内容将重新开始工作.

After removing each entry from the excluded list the inspections, phpmd and phpcs warnings, sonarlint analysis and everything else start working again.