Code Completion disappears if caret is on empty line with one or more spaces

intellij
(Claudio Mezzasalma) #1

Hello,

I’d like to report an issue for the SonarLint IntelliJ plugin, but it looks like in the Issue Tracker I don’t have enough permissions. If I’m doing something wrong please notify and I’ll act accordingly.

I’m using the SonarLint IntelliJ plugin and I love it… but one thing is really driving me crazy. As per IntelliJ configuration, all trailing spaces are stripped away from modified lines automatically on save:

I also have SonarLint automatic analysis on.

So, if I move the caret a few columns on the right to have the correct indentation for next line and then I use the CTRL+Space hotkey for the Simple Completion IntelliJ command, the Completion Popup shows correctly but then disappears in a second or so, since SonarLint is triggering an automatic file save and since the spaces are stripped away, and the caret moves to the beginning of the line; this moving, as said, causes the popup to disappear immediately.

From my perspective, I think that SonarLint should trigger the analysis (and the automatica save) only if such popup is closed, since it’s clear that I need a few seconds to write my line, and the analysis would make little sense anyway.

That do you think?

(Julien Henry) #2

Hi @Lorthirk

Old analyzers needed to have file saved on disk prior to run the analysis. This should have been fixed for a while, and SonarLint should no more force IntelliJ to save files.

Are you using connected mode? If yes, what are the versions of all plugins? Maybe you still have an old analyzer around.

(Claudio Mezzasalma) #3

Yes, I’m using connected mode (to SonarCloud, if that matters). I’m not sure why you’re asking me about “all plugins” though, since I only have installed SonarLint plugin at version 4.0.2.3009.

(Julien Henry) #4

I was talking about code analyzer plugins installed on the SonarQube server. But since you are connected to SonarCloud, that’s enough to know, we can get the information by ourself.

We’ll have a look and come back to you.