You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A set of three sample projects that includes Roslyn analyzers with code fix providers. Enjoy this template to learn from and modify analyzers for your own needs.
4
+
5
+
## Content
6
+
### RoslynAnalyzer
7
+
A .NET Standard project with implementations of sample analyzers and code fix providers.
8
+
**You must build this project to see the results (warnings) in the IDE.**
9
+
10
+
-[SampleSemanticAnalyzer.cs](SampleSemanticAnalyzer.cs): An analyzer that reports invalid values used for the `speed` parameter of the `SetSpeed` function.
11
+
-[SampleSyntaxAnalyzer.cs](SampleSyntaxAnalyzer.cs): An analyzer that reports the company name used in class definitions.
12
+
-[SampleCodeFixProvider.cs](SampleCodeFixProvider.cs): A code fix that renames classes with company name in their definition. The fix is linked to [SampleSyntaxAnalyzer.cs](SampleSyntaxAnalyzer.cs).
13
+
14
+
### RoslynAnalyzer.Sample
15
+
A project that references the sample analyzers. Note the parameters of `ProjectReference` in [RoslynAnalyzer.Sample.csproj](../RoslynAnalyzer.Sample/RoslynAnalyzer.Sample.csproj), they make sure that the project is referenced as a set of analyzers.
16
+
17
+
### RoslynAnalyzer.Tests
18
+
Unit tests for the sample analyzers and code fix provider. The easiest way to develop language-related features is to start with unit tests.
19
+
20
+
## How To?
21
+
### How to debug?
22
+
- Use the [launchSettings.json](Properties/launchSettings.json) profile.
23
+
- Debug tests.
24
+
25
+
### How can I determine which syntax nodes I should expect?
26
+
Consider installing the Roslyn syntax tree viewer plugin [Rossynt](https://plugins.jetbrains.com/plugin/16902-rossynt/).
27
+
28
+
### Learn more about wiring analyzers
29
+
The complete set of information is available at [roslyn github repo wiki](https://github.com/dotnet/roslyn/blob/main/docs/wiki/README.md).
0 commit comments