C# support in VSCode

Using VSCODE as well (across 40 developers) and also require Sonar Lint to support C#. Please add to Sonar’s roadmap.

Hi all,

I was in the same case and so I implemented a little extension that may help to synchronize SonarQube rules locally with vscode:
https://marketplace.visualstudio.com/items?itemName=frymak.sonarqube-rules-synchroniser&ssr=false#overview

It has some limitations but it corresponds to my needs, hope it will help some of you too…

Regards.

1 Like

Hi SonarSourcers (@Marco_Comi @Julien_HENRY) are there any news on this feature?
I’ve seen that you even support PLSQL these days and a connected mode for C# would be great!
Haven’t seen the opportunity to add and run the analyser in connected mode: NuGet Gallery | SonarAnalyzer.CSharp 8.33.0.40503.

In case you are still interested, if people prefer VSCode to “legacy” Visual Studio - I guess there are many developers out there these days - which use VSCode instead of Visual Studio. As it supports many more languages (even plsql), is more intuitive, leightweight and it supports devcontainers / github codespaces, where you can share your devenvironment across the whole team just by code and dockerfiles.
So having sonarlint working for VSCode would be great for cloud native developers as well - as they could scan their code in a connected way.

Best regards

2 Likes

Hello @Bjego, welcome to the SonarSource community and Happy 2022!
We are indeed planning to add C# support in VSCode during 2022. You can follow the feature status here, and our plan is to also support the connected mode with SonarQube and SonarCloud.

3 Likes

good to hear this… looking forward to it … can you tell us any statement on the current progress yet ?

1 Like

Hello,
I’d like to share an update. We really appreciated seeing so much interest for SonarLint C# support in VSCode. As mentioned earlier, we made it part of our 2022 priorities and we’ve been taking a look at possible options.
So far, the only solution that reached candidate status is based on OmniSharp (we’ve already relied on OmniSharp to ship C# support in Rider last year). At the same time, we’ve learned that Microsoft is planning to move the C# VSCode extension out of Omnisharp and that a new “LSP Tools Host” component will be the default experience for the C# for VS Code extension.
In this context, we feel it would be wise to wait until we have a clearer picture of the future perspectives and plans for both OmniSharp and the C# for VS Code extension.
In the meanwhile, we’ll continue to look at possible options and we’ll notify you here of any further updates.

1 Like

Thanks for the tools and earlier guidance. To summarise if you don’t want to install the nuget package for every project and enable globally:

  1. Download SonarAnalyzer.CSharp clicking the Download package link under about
  2. Rename extension to .zip
  3. Extract contents to folder
  4. Create omnisharp config file; Win: %USERPROFILE%.omnisharp\omnisharp.json, Mac/Linux: ~/.omnisharp/omnisharp.json
  5. Populate with (assuming nuget package contents are extracted under .omnisharp folder):
{
  "RoslynExtensionsOptions": {
    "enableAnalyzersSupport": true,
    "LocationPaths": [
      "/Users/<user>/.omnisharp/sonaranalyzer.csharp/analyzers",
      "C:\Users\<user>\.omnisharp\sonaranalyzer.csharp\analyzers"
    ]
  }
}

Hi,

Hopefully there is renewed focus for SonarLint C# given this recent update from Microsoft.

I am also disappointed that I was unable to have it in VSCode, and had to switch back n forth with VS Studio for sonarlint.

3 Likes

Hello @yylai and welcome to the Sonar Community forum! We’re definitely going to have a look and re-evaluate our options to support C# in VS Code following the recent announcements from Microsoft :wink:

Any updates on this? Adding support for C# would be a great feature.

Hello all,
I am thrilled to share that we’ve just released a new SonarLint for VS Code version with initial support for C# analysis :tada:

When you have a chance to try it out, we’d be grateful if you could share any feedback in this section of the forum! :pray::wink:

6 Likes

Thank You Marco and Sonar Team! It’s great to know that you all are listening to the Sonar Dev Community.

1 Like

Hi, I found Sonarlint extension can’t found any C# questions. But other language like Python or Java is normal. Can you tell me what’s wrong or how to configure it?

version: v4.4.2
os: Linux

I think I’m not the only one running into this problem.

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