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

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?

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.

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.

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.

Hey there,

I’m still experiencing this issue. I was wondering if you had some news about this.

Cheers!

Sorry for the delay, we were really busy with preparing new SonarQube LTS. Work on SonarLint will restart in a few weeks.
I was able to reproduce your issue and created a ticket to not forget:
https://jira.sonarsource.com/browse/SLI-331

Hello, for your information SonarLint for IntelliJ 4.1, which includes the fix for SLI-331, is now publicly available from the JetBrains plugin repository.

1 Like