Does Roslyn code fix work with resharper
Completed
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
Please sign in to leave a 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.
That woks :) Thank you
Is there a reason why this is disabled by default?
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.
Elena Kurakina Hi, the merge is not working for me like this. the only way it works is if i don't hide the VS lightbulb.
But if i don't hide the lightbulb it only gives me the VS command when i do CTRL. Is this a known issue with VS 2022 preview? Its mildly maddening and is making me lean towards turning resharper of since i really need the Roslyn fixes.
Hello Andri Sigurdsson,
Please accept my apologies for the delay in the reply. Could you please download the latest ReSharper 2022.3.2 here and check how it works for you? Is this issue still happens in a new version? Thank you in advance.
When in VS is enabled "Compute Quick Actions asynchronously", the actions does not appears at all. Once unchecked they appears, but they are unusable (it doesn't make difference if VS lightbulb is hidden or not):
I also noticed the same 2-3 seconds delay before the context menu opens as reported here whatever combination of settings I use (included "Force getting VS quick actions"). Is this something expected? Because in this case I think I'm better off to keep both the indicators separately although it would have been really nice to have all actions integrated into one only indicator.
Hello Andri Sigurdsson and dshaggtun luzzi,
Please try this workaround.
Go to ReSharper | Options | Environment | Editor | Visual Studio Features and turn off all options in the section "Visual Studio code analysis".
Then use Ctrl+. for the Visual Studio lightbulb and Alt+Enter for the ReSharper lightbulb. Please, let me know if it helped or not.
Also, here is a related issue. You can follow it to get the latest updates. Thanks in advance.
Yes, this is how I ended up doing once I discovered such issue. It seems to be very problematic integration and very subject to break each time there is some change in VS. Thanks
Hello dshaggtun luzzi,
Glad to hear! Thanks for letting me know.
We will try to fix it in future releases. Thank you for understanding.