SonarLint for Custom Languages

Greeting,

We am currently working on a SonarQube plugin for a DSL for my company. We have developed our language grammar using SSLR, written more than 50 rules, and our plugin is on its way to first release. My company is now interested in implementing support for the DSL in SonarLint via VSCode. I read 2 posted forms, VSCode - SonarLint - Custom language and SonarLint connected mode - support for new language, which clearly state that SonarLint was not open for third-party custom language development. We want to make sure if that changed since the forms date back to last year. If so, can we extend our implemented SSLR parser and already implemented rules? If not any general ideas, on re-implementing support for the custom language in SonarLint?

Regards

Hello Jad,

We still don’t support custom languages in SonarLint and have no plans for the future.

Since our products are open source, your best bet would be to fork SonarLint to add support for your custom Sonar plugin. You would have to fork the VSCode extension repository, the associated language server, and probably this library that is common to all our IDEs.

You can then distribute the extension privately to your developers (see how to install an ad-hoc version). If you want to distribute it on the VS Marketplace, please remove references to Sonar* as to not confuse our users.

Hope this helps, and thanks for using our products!

3 Likes

Hi Damien,

Thanks for sharing some details about what repos would need to be forked.
I would like to try and fork SonarLint (IntelliJ) to add support for a custom language, but I’m not sure exactly what would need to be updated. I tried updating only Language.java but it did not seem to do the trick. Would it be possible to share what would need to be updated? Are there any existing docs or threads that cover this, or even a repo for another SonarLint-based plugin that I could reference?

Thanks again