Skip to content

Commit 985acc2

Browse files
authored
Spelling error (#29802)
Fixes #29801
1 parent 8ae8882 commit 985acc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/roslyn-sdk/source-generators-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ In this guide, you'll explore the creation of a source generator using the <xref
102102

103103
:::code source="snippets/source-generators/SourceGenerator/HelloSourceGenerator.cs":::
104104

105-
From the `context` object we can access the compilations' entry point, or `Main` method. The `mainMethod` instance is an <xref:Microsoft.CodeAnalysis.IMethodSymbol>, and it represents a method or method-like symbol (including constructor, destructor, operator, or property/event accessor). The <xref:Microsoft.CodeAnalysis.Compilation.GetEntryPoint%2A?displayProperty=fullName> method returns the <xref:Microsoft.CodeAnalysis.IMethodSymbol> for the program's entry point. Other methods enable you to find any method symbol in a project. From this object, we can reason about the containing namespace (if one is present) and the type. The `source` in this example is an interpolated string that templates the source code to be generated, where the interpolated wholes are filled with the containing namespace and type information. The `source` is added to the `context` with a hint name. For this example, the generator creates a new generated source file that contains an implementation of the `partial` method in the console application. You can write source generators to add any source you'd like.
105+
From the `context` object we can access the compilations' entry point, or `Main` method. The `mainMethod` instance is an <xref:Microsoft.CodeAnalysis.IMethodSymbol>, and it represents a method or method-like symbol (including constructor, destructor, operator, or property/event accessor). The <xref:Microsoft.CodeAnalysis.Compilation.GetEntryPoint%2A?displayProperty=fullName> method returns the <xref:Microsoft.CodeAnalysis.IMethodSymbol> for the program's entry point. Other methods enable you to find any method symbol in a project. From this object, we can reason about the containing namespace (if one is present) and the type. The `source` in this example is an interpolated string that templates the source code to be generated, where the interpolated holes are filled with the containing namespace and type information. The `source` is added to the `context` with a hint name. For this example, the generator creates a new generated source file that contains an implementation of the `partial` method in the console application. You can write source generators to add any source you'd like.
106106

107107
> [!TIP]
108108
> The `hintName` parameter from the <xref:Microsoft.CodeAnalysis.GeneratorExecutionContext.AddSource%2A?displayProperty=nameWithType> method can be any unique name. It's common to provide an explicit C# file extension such as `".g.cs"` or `".generated.cs"` for the name. The file name helps identify the file as being source generated.

0 commit comments

Comments
 (0)