Skip to content

Commit 09d659c

Browse files
committed
update
1 parent 2dd2590 commit 09d659c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

docs/dotnet/source_generator.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@ published: true
1212

1313
1. Create a blank solution
1414
2. Create a class libary in .Net Standard 2.0. Ex: `PrivateFieldGenerator.csproj`
15-
3. Update the `csproj` file with below things.
15+
3. Update the `csproj` file with below things.
16+
4.
1617
```xml
1718
<LangVersion>latest</LangVersion>
1819
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
1920
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
2021
<IsRoslynComponent>true</IsRoslynComponent>
2122
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
22-
```
23-
4. Install `Microsoft.CodeAnalysis.CSharp` & `Microsoft.CodeAnalysis.Analyzers`
24-
5. Add a class file and name is `PrivateFieldIncrementalGenerator`. We will be using the `IIncrementalGenerator`
25-
6. Decorate the class with the `[GeneratorAttribute]`
26-
7. Implement the class like below
23+
```
24+
25+
5. Install `Microsoft.CodeAnalysis.CSharp` & `Microsoft.CodeAnalysis.Analyzers`
26+
6. Add a class file and name is `PrivateFieldIncrementalGenerator`. We will be using the `IIncrementalGenerator`
27+
7. Decorate the class with the `[GeneratorAttribute]`
28+
8. Implement the class like below
29+
9.
2730
```c#
2831
public class PrivateFieldGenerator : IIncrementalGenerator
2932
{
@@ -142,7 +145,7 @@ public class PrivateFieldGenerator : IIncrementalGenerator
142145
}
143146
}
144147
```
145-
8. Done you are ready with your generator.
148+
9. Done you are ready with your generator.
146149

147150
#### How to use this generator in your real project.
148151

0 commit comments

Comments
 (0)