SonarLint for BlueJ IDE

Hi,

Does anyone know if there has been any attempts of developing a SonarLint plugin for the BlueJ IDE?

Arne

Hello, welcome to the community! And thanks for asking.

SonarLint is currently officially available for IntelliJ (and other JetBrains IDEs), Visual Studio, VS Code and Eclipse. There are a few unsupported community efforts, e.g for Emacs.

As far as I can tell, there is no project to bring SonarLint to BlueJ, though this looks like a nice opportunity to reach students around the world.

(I moved your topic to the “New features” category, this way people can vote for it at the top.)

Hi Jean-Baptiste,

Thanks for your quick response to my post, and thanks for welcoming me to the community:-)
Yes, having SonarLint in BlueJ would be great for my students. Best way to get them to focus on code quality as early as possible;-)

By the way, I’ve tried to find a short tutorial or example-code of using the SonarLint API, but have not been successful yet. Maybe you could give me a few pointers to where to start? It seams like the API is not very well documented?

1 Like

Hey Arne,

I reckon that SonarLint’s API is not well documented, and documenting it is not a high priority for us.

Currently, we (SonarSource) view it as an open-source project in the sense that people can clone it and build stuff on top of it; and at the same time, we don’t encourage “external” contributions, since they seldom fit in our product roadmap.

Now, if you are familiar with extension development in other IDEs and feel like giving it a shot with BlueJ’s extension API, you can take inspiration on how SonarLint is integrated in IntelliJ, VSCode (with its Language Server) and Eclipse.

The way I see it, a very basic integration would consist in:

  • initializing a standalone engine, with just the Java analyzer enabled (I believe BlueJ is Java-only right?)
  • hooking up to file open/change/close events to trigger analysis
  • implementing the “input file” API to provide editor contents to the analyzer
  • feeding project configuration (source path, binaries/class path, library path) to the Java analyzer
  • finding a way to highlight issues in the source code and show the issue’s message
  • bonus points for finding a way to show the rule description from an issue
1 Like