Skip to content

Commit ecf6c11

Browse files
committed
docs: added README.md
2 parents 49e6c03 + acc493f commit ecf6c11

File tree

3 files changed

+58
-29
lines changed

3 files changed

+58
-29
lines changed

CodeJoyRide.Fx.Analyzer/CodeJoyRide.Fx.Analyzer/Readme.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

CodeJoyRide.sln

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeJoyRide.Fx.Analyzer", "
1212
EndProject
1313
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CodeJoyRide.Fx.Analyzer.Tests", "CodeJoyRide.Fx.Analyzer\CodeJoyRide.Fx.Analyzer.Tests\CodeJoyRide.Fx.Analyzer.Tests.csproj", "{5508C6E9-856E-4B08-8BFD-D05803BAE144}"
1414
EndProject
15+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{D3C4A25F-0370-4F78-9DE0-614F562512B0}"
16+
ProjectSection(SolutionItems) = preProject
17+
README.md = README.md
18+
EndProjectSection
19+
EndProject
1520
Global
1621
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1722
Debug|Any CPU = Debug|Any CPU

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Roslyn Analyzers - Code JoyRide
2+
3+
An example projects that includes Roslyn analyzers with code fix providers. Enjoy this template to learn from and modify analyzers for your own needs.
4+
5+
## Agenda
6+
7+
We will try to cover at least two of the following bullet points:
8+
9+
- Quick Introduction to Compilers and Roslyn
10+
- Developing a Semantic Code Analyzer
11+
- Providing a Code Fix Provider for the Analyzer
12+
13+
The workshop would be interactive and we do live coding.
14+
15+
## Prerequisites
16+
17+
- Some knowledge of programming 😁😜
18+
- Laptop 💻
19+
- [.NET Core](https://dotnet.microsoft.com/en-us/download) installed on your machine; see [all versions](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) for more information
20+
- Have your preferred IDE installed;
21+
- [JetBrains Rider](https://www.jetbrains.com/rider/download/)
22+
- [VS Code](https://code.visualstudio.com/download) with [C# extension](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp), [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) [Optional]
23+
- Clone the [CodeJoyRide repository from GitHub](https://github.com/shahab-the-guy/code-joy-ride) if you want to implement with us step by step
24+
- Last but not least, You 👩🏻‍💻👨🏻‍💻
25+
26+
## Content
27+
### CodeJoyRide.Fx.Analyzer
28+
A .NET Standard project with implementations of sample analyzers and code fix providers.
29+
**You must build this project to see the results (warnings) in the IDE.**
30+
31+
- [MaybeSemanticAnalyzer.cs](SampleSemanticAnalyzer.cs): An analyzer that reports invalid usage of the `Maybe` type.
32+
- [MaybeCodeFixProvider.cs](SampleCodeFixProvider.cs): A code fix that replaces a `throw` statement with `Maybe.None`. The fix is linked to [MaybeSemanticAnalyzer.cs](./CodeJoyRide.Fx.Analyzer/CodeJoyRide.Fx.Analyzer/MaybeSemanticAnalyzer.cs).
33+
34+
### CodeJoyRide.Api
35+
A project that references the CodeJoyRide.Fx analyzers. Note the parameters of `ProjectReference` in [CodeJoyRide.Api.csproj](CodeJoyRide.Api/CodeJoyRide.Api.csproj), they make sure that the project is referenced as a set of analyzers.
36+
37+
### CodeJoyRide.Fx.Analyzer.Tests
38+
Unit tests for the CodeJoyRide analyzers and code fix provider. The easiest way to develop language-related features is to start with unit tests.
39+
40+
## How To?
41+
### How to debug?
42+
- Use the [launchSettings.json](CodeJoyRide.Fx.Analyzer/CodeJoyRide.Fx.Analyzer/Properties/launchSettings.json) profile.
43+
- Debug tests.
44+
45+
### How can I determine which syntax nodes I should expect?
46+
47+
* Consider using https://sharplab.io/ and set the Result to `Szntax Tree`
48+
* On Visual Studio Code, consider installing the extension [CSharp Syntax Visualizer](https://marketplace.visualstudio.com/items?itemName=ypyl.syntax-visualizer-csharp)
49+
* Consider installing the Roslyn syntax tree viewer plugin [Rossynt](https://plugins.jetbrains.com/plugin/16902-rossynt/).
50+
* Unfortunately, based on my experience this one is not working on Rider's latest versions.
51+
52+
### Learn more about wiring analyzers
53+
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

Comments
 (0)