IntelliJ Code Completion not working for new Java classes

前端 未结 16 1895
挽巷
挽巷 2020-12-10 02:10

IntelliJ IDEA 13 has started exhibiting a very weird behavior in my local setup.

Namely, in any new Java class added to an existing project

相关标签:
16条回答
  • 2020-12-10 02:35

    I had this same problem and it was caused by me not having a folder marked as sources root.

    Right click on your src directory and Mark Directory As > Sources Root.

    0 讨论(0)
  • 2020-12-10 02:35

    It helped me to mark the src directory as the "Source Root".

    0 讨论(0)
  • 2020-12-10 02:36

    Remove your package from the Settings>Editor>General>Auto Import>Java>Exclude from Import and Completion

    I had run into this problem. None of the solutions from this post worked, but I was able to fix it because I accidentally put my project's package in the "Exclude from Import and Completion" settings.

    0 讨论(0)
  • 2020-12-10 02:41

    There could be 2 reasons for your problem

    1. Either the the source folder is not properly configured in the your build java build path. If the source folder is not properly configured the autocomplete wont get the required class definitions and autocomplete would fail for your project.
    2. Restoring the default options in 'Windows > Preferences > Java > Editor > Content Assist > Advanced'
    0 讨论(0)
  • 2020-12-10 02:42

    Make sure you mark all your Source directories as such in File -> Project Structure -> Modules.

    0 讨论(0)
  • 2020-12-10 02:47

    It was happening for me in a module that was not added in the parent project pom (they did it on purpose), that was the reason, I right clicked the pom.xml of the module that has the issue and clicked the

    now the autocomplete came and in addition to that I can see the module as a separate project in the maven tab on the top right.

    0 讨论(0)
提交回复
热议问题