Questions tagged [codefixprovider]

21 questions
0
votes
1 answer

InsertTokensAfter() How to Add New Token after a. Existing SyntaxToken c# Roslyn

I want to add a after DeserializeObject like JsonConvert.DeserializeObject(json) Below is how I'm trying to achieve it var desiToken = node.DescendantTokens().Where(x => x.Text == "DeserializeObject").FirstOrDefault(); List
S G T
  • 1
  • 1
0
votes
1 answer

Can I add multiple analyzers.cs files and code fixers files in a single solution for writing a Roslyn analyzer in Visual Studio?

I am new to developing analyzers and code fixes using Roslyn Analyzer. I am using Visual Studio 2019 Community Edition. I am creating an Analyzer with code fix in Visual Studio. Or do I need to create a separate solution for each rule (which…
Siddhi Kamat
  • 135
  • 2
  • 11
0
votes
1 answer

Code fix for document different from code fix for line

I have written a Roslyn code Analyzer and related CodeFixProvider, which works. When I use it against individual lightbulbs it works perfectly, when I choose to do the whole document, it seems to be getting corrupted results as if several fixes…
jmoreno
  • 12,752
  • 4
  • 60
  • 91
0
votes
1 answer

C# CodeFixes: Minimum Requirement that codefix is displayed

I recently started with CodeAnalyzers and CodeFixes. Of course the template coming with the sdk () works. But when I move on, the codefix does not show up anymore on debugging. When walking through the diagnostic is created as it is supposed to…
Tobias
  • 2,945
  • 5
  • 41
  • 59
0
votes
0 answers

How do I limit a Roslyn CodeFix before I run out of memory

I am writing a CodeFix to fix a solution wide issue. If I let it run on even a medium sized project I run out of memory. Document is too small a chunk in many cases. What I would like is to let it run until I have used about 80% of process memory or…
Paul Cohen
  • 241
  • 4
  • 14
0
votes
1 answer

Roslyn Fix Provider Check if Fix is From Preview Window

I have written a fix provider which adds members elements resx file. I noticed when visual studio generates the expected changes it calls the method in which add the resource keys to the file. I'm registering my FixProvider I'm looking for a way…
johnny 5
  • 19,893
  • 50
  • 121
  • 195
1
2