Can't see IntelliJ's inspection solution with sonarlint plugin enabled

  • Operating system:
    [05:48:11]matthias@alara:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 20.04.4 LTS
    Release: 20.04
    Codename: focal

  • SonarLint plugin version:

  • Is connected mode used:

    • Connected to SonarCloud or SonarQube (and which version):
      Sonarcube: * Version 9.5 (build 56709)

As soon as the SonerLint plugin is enabled and checked the file once. the original idea inspection solutions become unavailable. Instead there is only the possibility to disable that particular sonar-check.

without sonar plugin.

with sonar plugin

is there a way to get access to the original intellij inspection solution?

Hello @Periphylla,

As you can see, SonarLint highlights the multi-line String literal, while IntelliJ marks only the first \n.

SonarLint does not suppress the inspection from IntelliJ, it is still available: if you move the caret to the first \n in the literal and type Alt+Enter, you will still get the Replace with text block suggestion from IntelliJ. However as our inspection spans the whole text, it makes the one from IntelliJ invisible.

I don’t think it’s a big problem here as in the end both inspections raise the same issue. I guess what is annoying is that the action to convert the multi-line string to a text block is less visible, so one thing we could improve is for SonarLint to provide a quick fix as IntelliJ does. I don’t think changing the highlight range is the way to go.

We will discuss it internally and see if we can come up with an improvement.

Thanks for reporting this :slight_smile:

1 Like