C# support in VSCode

Most of the developers where I work are building on the Mac, and we use VSCode for our .net core stuff. It would be great for SonarLint to support C# in VSCode. In fact, the VSCode version of SonarLint should try and support all languages because it is such a versatile editor.

Hi @James_Shinevar,

Out of curiosity are you using VSCode because you think it’s better than VS for Mac?

Cheers,
Amaury

I like it because not everything I do needs to be a full Visual Studio project. I do like the intellisense better in VSCode, and I write my front ends using Angular and my API’s using .net core, and I like to just have the different windows open for the different projects. Not to mention, VSCode is more visually appealing to me. Crazy as it sounds, over the last year, I’ve seen VSCode move to the most used editor for most people I know.

1 Like

I am a 20 year veteran of VS (in one form or another) and for me, VSCode is more intuitive. If (or when) more functionality is ported, our team will switch.

1 Like

I also find that VSCode is lighter that Visual Studio and would also be interested in C# support in sonarlint

2 Likes

I agree. In fact I’m not quite sure why C# wasn’t one of the first languages to be supported, given that it’s in Visual Studio. It would certainly be excellent to have it, as it’s one of the few remaining barriers to my team adopting VS Code as their editor of choice.

1 Like

I use VSCode exclusively for C# development. My organization wants to use SonarLint, but those of us that use VSCode will have to find some process to participate. My reasoning for VSCode is pretty long-winded, but the concentrated version is I think VS is slow and cumbersome.

Bringing this back from the dead to say that this would be huge for me as well. We’re going full open source, and there’s a strong preference for VS Code in the office. Would be great to have support for C#

2 Likes

Is this on the roadmap? This will be a very welcomed addition as I am gradually switching to VS Code for C# as well

Hi folks,

For your information this is definitely on our roadmap. We were waiting for Omnisharp to support third party Roslyn analyzers, and this is now done. We have already tested using our C# analyzer directly as a nuget package in a VSCode project, and it is working fine. You can do the same if you can’t wait :slight_smile:

We are now discussing how to give a better user experience and providing other usual SonarLint features to this use case.

Stay tuned,

7 Likes

Hi Julien,

I’ve added the nuget package to a csproj file in vscode, how do I now get the analyzer output from the build task in vscode?

Hi Lee,

Have you tried to follow the steps in the blog post I shared in my previous post? Basically my understanding is that enabling Roslyn analyzer support in Omnisharp should be enough.

1 Like

Hi Julien, I had missed that apologies. Works perfectly.

1 Like

Thats great news. i’ve added the SonarLint extension. I guess it will just update when push your change through? any estimate when this might be?

I’m pleased you have installed SonarLint, but if you are coding only in C#, the extension bring no value for the time being. Adding our SonarC# Roslyn based analyzer to VSCode is a manual process you have to do, following the previously mentioned blog post.

We have started some small contributions to Omnisharp, that will help us to hopefully provide a better user experience, but they are not yet merged (and we might need other changes). And this is not the only point preventing us to move forward. All that to say we have no estimate, sorry.

1 Like

Is there any update on adding the SonarC# Roslyn based analyzer to VSCode? I have seen that I should be able to add the sonarc# analyzer to location paths in omnisharp.json but I can’t find there the analyzers are located? I’m on a Mac and have looked at ~/.omnisharp only to find it’s an empty folder

Have you tried to follow the steps in the blog post mentioned earlier in this thread. It has been confirmed to work.

We have plan to do better later this year, but as of today this is the only option.

Is there an issue to track this feature?
Is there an official public roadmap where we can see the priority of this feature against others?
Thanks.

1 Like

@Julien_HENRY, Do you think you can add that feature to your backlog so we could track it properly? Currently I see nothing about supporting C# here https://jira.sonarsource.com/projects/SLVSCODE/issues

Hi @tremblaysimon and welcome to the community!
in SonarSource we are currently reviewing the tooling and the processes we use internally to track and prioritise feature requests. This is way you do not see all feature requests as part of the Jira issues.
Although we cannot share a Jira link today, we are definitely tracking the request for C# support in VSCode, and we are actively monitoring this thread for feedback and votes.
We will communicate in this thread if we have updates for the prioritisation of this feature.

1 Like