Does Roslyn code fix work with resharper

Answered

I created a Roslyn Analyzer with a matching CodeFixProvider: https://docs.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/tutorials/how-to-write-csharp-analyzer-code-fix

This works fine as long as i use visual studio 2019 without Resharper. So when I create code that is found by the analyzer, Visual Studio suggests me with the help of the code fix to correct the code.

Once i enable Resharper, the Visual Studio suggestion are gone and the Resharper suggestions are used, e.g. by pressing Alt + Enter. But my code fix is not shown in the list there. Is this not supported by Resharper?

I`m using Resharper 2021.1.2

3 comments
Comment actions Permalink
Official comment

Hello Arne Held,

Thank you for contacting us.
Could you please check the setting Merge Visual Studio Quick Actions into ReSharper action indicator?
For this, go to ReSharper | Options | Environment | Editor | Visual Studio Features | Merge Visual Studio Quick Actions into ReSharper action indicator. This setting should be enabled.
Also, you can enable the setting Show Visual Studio Quick Actions in submenu. In this case, you can see Roslyn actions in a submenu. It might be more convenient for you.
Let me know if you have any questions.


Comment actions Permalink

That woks :) Thank you

Is there a reason why this is disabled by default?

1
Comment actions Permalink

Hello Arne Held,

Thank you for the answer. Glad to hear!
We try to hide VS functionality if ReSharper has a similar feature (which is usually better), in order to avoid duplication and to make it easier and more convenient for the user.
Unfortunately, there are no formal criteria to distinguish custom Roslyn Analyzers not to hide them automatically.

0

Please sign in to leave a comment.