PhpStorm Initialize Fields context menu not showing

徘徊边缘 提交于 2019-12-25 03:16:37

问题


I have recently uninstalled (also deleted PhpStorm ~/Library/*/PhpStorm2019.1 files) and reinstalled the IDE (2019.1.2) from scratch. I am on a Mac with Mojave 10.14.5. This was due to the fact the Material Theme UI screwed up my themes.

When I started working and noticed that my beloved initialize fields option is no longer showing. I've been using initialize fields for a very long time and I can't explain what is causing it not to show. The whole context menu is not showing at all.

I'm referencing the below Question and Answer link because this is explaining exactly how I've been using the init fields option. How to automatically generate parameter assignations in class constructors in PhpStorm?

Am I doing something wrong?


回答1:


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.

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/

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



来源:https://stackoverflow.com/questions/56401258/phpstorm-initialize-fields-context-menu-not-showing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!