IntelliJ Code Completion not working for new Java classes

前端 未结 16 1930
挽巷
挽巷 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:53

    This is not IntelliJ 13 but a more recent 2017.1.1 Community version. Adding this answer here so that others benefit from a cause that has its roots in the Gradle Configurations.

    Now, in my case too the auto complete, Generate Override methods and other features were not working. What I figured out is that in my project settings, I had multiple configurations for the gradle modules. The moment I cleaned up the rest of the modules and retained the only one (apart from test) I needed for that project, all behaviors were back to normal.

    Also in such cases of Gradle projects, remember to mark all your sourceSet root folders ad the Source folders.

    Edit: If you do not want to create multiple configurations per sourceSet and you are importing a gradle module, on the import screen, you should also disable the Create a module for per sourceSet flag. Without this, I was having to remove the multiple modules after importing the module.

提交回复
热议问题