Different binding per module in SonarLint IntelliJ

@Julien_HENRY what’s the current status?

This topic has not been prioritized on our side. Module-level services have recently been deprecated on Jetbrains plugin API side, so it will make the implementation of this feature even more complex. We would have to store at the project level the binding of each modules. I’m not sure it will fit the use case reported above (using IntelliJ project as a “workspace” and adding modules for each Git repositories), since the binding metadata will still be persisted at the project level, preventing to store it in each individual Git repository.

It would still be better than current solution :slight_smile:

FYI, this is also an issue in visual studio. We have the exact same use case and problem. One solution might contain 200 projects, but only one can be configured for sonarlint plugin at a time.

Any update on this Julien ?

From Webstorm 2019.2 - multiple projects can be opened in the same Webstorm instance.
I am not sure if other JetBrains IDEs do the same at this time.

File -> Open -> {browse to project} -> Open -> press “Attach” button.

SonarLint is just reporting 0 issues. For one of my colleagues it logs an error with message tsconfig.json not found.

We would like to adopt SonarLint at my organisation, but the multiple-project setup is widely used…

@Julien_HENRY perhaps this feature could be re-evaluated?
It is now affecting JetBrains IDEs with multiple projects open in one instance.

Hi all, i did some changes to original sonarlint plugin to make it bindable based on vcsroots. The changes are here https://github.com/gayanper/sonarlint-intellij/tree/multi_module. You can build the zip file and install into IJ and give it a try.

The projectkey text field is not used anymore. but you can use the search in list and copy the project keys from there :slight_smile:

Hello @gayanper
First of all - thank you for the update! much appreciated :slight_smile:
I managed to build the plugin & install it (in webstorm) but I get following exceptions:
NoClassDefFoundError: org/sonarsource/sonarlint/core/client/api/common/FileExclusions
NoClassDefFoundError: org/sonarsource/sonarlint/core/client/api/notifications/LastNotificationTime

I have submitted a report from Webstorm: Error in SonarLint for IntelliJ (multi-module Webstorm)
I’m not sure if you need more information?

Hi, Thanks for trying out the plugin.
How do you build the plugin ? Did you took the zip from the build/distribution folder for installation ?

I will try to set my own CI for this branch and update this thread with where to find the zip files.

Hello :slight_smile:

I did download the zip:
Then I built it using

gradlew buildPlugin

And installed the resulting sonarlint-intellij-4.12-SNAPSHOT.jar into Webstorm using “Install Plugin from disk” option.

Upon starting webstorm the SonarLint view is empty and little “IDE Error Occurred” alert is shown.
There are 3 exceptions with stack traces:

failed to init toolwindow org.sonarlint.intellij.ui.SonarLintToolWindowFactory
java.lang.NoClassDefFoundError: org/sonarsource/sonarlint/core/client/api/common/FileExclusions

Would you like any more information like the full stack traces?

You should try to install the zip file. The file is located at /sonarlint-intellij/build/distributions/sonarlint-intellij-4.12-SNAPSHOT.zip.

Install this to your IDE using the install from file option in the plugin manager. This should install the plugin with all required dependencies.

That’s working way better!
Thank you @gayanper

There are some bugs we have discovered - would you like feedback about them?
If so, do you prefer them raised here or in the git repo, or elsewhere?

Hey, nice work!

I think it would make sense for discussions about bugs and feedback on this modification to take place in the fork’s “Issues” section on GitHub.

Please also note that, as mentioned above by Julien, this feature is already in our backlog. It has not been tackled yet due to its priority being lower than that of other upcoming features.

Our belief is that relying on VCS roots for configuration of module bindings constitutes a (valuable) subset of the range of possible setups, and we would like to provide a solution for a wider ranges of use cases.

For an update about when this feature could land in the official build, I don’t see this happen by the end of this year: Q4 is about to start, and in the complex exercise of balancing product strategy with community input and IDE changes from JetBrains, it becomes increasingly difficult to make room for this feature in our short term roadmap.

1 Like

Please report in the github, i have changed the plugin id so that we will not conflict with official builds. All captions are renamed to unofficial to make it clear, i will also setup an unofficial plugin repo for this soon so that updates will be flow automatically. My plan is to maintain this until official authors of this plugin provide this feature. fingers cross.

1 Like

Now the changes are published in the following updatesite https://dl.bintray.com/gayanper/sonarlint_uo-intellij/

FYI, we just released a new version of SonarLint supporting module-level binding in IntelliJ IDEs.


4 posts were split to a new topic: Override binding of attached projects doesn’t work in WebStorm

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.