Skip to content

Commit 2531dd2

Browse files
authored
Incremental Generators documentation fixes (#67593)
* Simplify example (use local variable). * Remove incorrect indentation. * Use correct SymbolKind field name.
1 parent 28f2063 commit 2531dd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/features/incremental-generators.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ inputs and combine them into a single source of data. For example:
658658
IncrementalValuesProvider<AdditionalText> additionalTexts = initContext.AdditionalTextsProvider;
659659

660660
// combine each additional text with the parse options
661-
IncrementalValuesProvider<(AdditionalText, ParseOptions)> combined = initContext.AdditionalTextsProvider.Combine(initContext.ParseOptionsProvider);
661+
IncrementalValuesProvider<(AdditionalText, ParseOptions)> combined = additionalTexts.Combine(initContext.ParseOptionsProvider);
662662

663663
// perform a transform on each text, with access to the options
664664
var transformed = combined.Select(static (pair, _) =>
@@ -731,7 +731,7 @@ As an author I can make an input node that extracts the return type information
731731

732732
```csharp
733733
// create a syntax provider that extracts the return type kind of method symbols
734-
var returnKinds = initContext.SyntaxProvider.CreateSyntaxProvider(static (n, _) => n is MethodDeclarationSyntax,
734+
var returnKinds = initContext.SyntaxProvider.CreateSyntaxProvider(static (n, _) => n is MethodDeclarationSyntax,
735735
static (n, _) => ((IMethodSymbol)n.SemanticModel.GetDeclaredSymbol(n.Node)).ReturnType.Kind);
736736
```
737737

@@ -768,7 +768,7 @@ public class Class4
768768
The `predicate` will be re-run for `file1.cs` as it has changed, and will pick
769769
out the method symbol `Method1()` again. Next, because the `transform` is
770770
re-run for _all_ the methods, the return type kind for `Method2()` is correctly
771-
changed to `Error` as `Class1` no longer exists.
771+
changed to `ErrorType` as `Class1` no longer exists.
772772

773773
Note that we didn't need to run the `predicate` over for nodes in `file2.cs`
774774
even though they referenced something in `file1.cs`. Because the first check is

0 commit comments

Comments
 (0)