Turn off irrelevant code completion suggestions

Answered

Recently I've noticed code completion suggest irrelevant completions that are prioritized higher than common sense things like variables that are already defined in scope of the file I'm working in. For instance, working in this Groovy file when writing a Spock test with MockMVC the completion is suggesting a whole slew of new variables, when the one I want is `mockMvc`. It has already been declared in the scope of this file, but is buried under useless suggestions.

Additionally those suggestions are of the types are not even imported into this file yet and variables that not have been declared yet. If I would select one of the suggestions, my cursor jumps to the top of the file to the new line where the variable has newly been declared.

How can I turn off these suggestions? 

0
6 comments

Hello, Joshmart88. Could you please specify if you encounter the problem only with Groovy, or with other languages, too?

0

Olga Mulina Did a quick test and this happens in Java files as well.

0

Joshmart88, thank you for the clarification. Is it possible to provide a sample for Java as well? 
Also, please specify which IDE version you use - it could be helpful for us to understand which version is affected. 

From your initial message, I created a corresponding bug report in YouTrack - please feel free to upvote it to receive updates.

0

Olga Mulina oh, sorry forgot to include that initially:
 

IntelliJ IDEA 2024.1 (Ultimate Edition)
Build #IU-241.14494.240, built on March 28, 2024
 

I figured out the feature is called `Smart beans completion` under `Languages & Frameworks > Spring`. Even if I select to sort code completion alphabetically, local scope matches still get pushed further down the list that contains matches to bring in a new bean variable. Maybe a recent upgrade turned this feature on when it was previously off, but I don't remember auto complete results behaving like this. Either way, turning off smart beans completion fixes the problem for me and I don't have IntelliJ suggesting random beans to bring in anymore.

0

Thank you for the update!
 

Either way, turning off smart beans completion fixes the problem for me and I don't have IntelliJ suggesting random beans to bring in anymore.

 

Does it mean I can close the issue, or do you still need it for Groovy?

0

Olga Mulina This fixes the Groovy behavior as well and can be closed. Thank you :)

0

Please sign in to leave a comment.