-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new FAWMN variant with global options
- Loading branch information
1 parent
2c2a1c3
commit 603e81c
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ityToolkit.Mvvm.SourceGenerators/Extensions/GeneratorAttributeSyntaxContextWithOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Collections.Immutable; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
|
||
namespace CommunityToolkit.Mvvm.SourceGenerators.Extensions; | ||
|
||
/// <summary> | ||
/// <inheritdoc cref="GeneratorAttributeSyntaxContext" path="/summary/node()"/> | ||
/// </summary> | ||
/// <param name="syntaxContext">The original <see cref="GeneratorAttributeSyntaxContext"/> value.</param> | ||
/// <param name="globalOptions">The original <see cref="AnalyzerConfigOptions"/> value.</param> | ||
internal readonly struct GeneratorAttributeSyntaxContextWithOptions( | ||
GeneratorAttributeSyntaxContext syntaxContext, | ||
AnalyzerConfigOptions globalOptions) | ||
{ | ||
/// <inheritdoc cref="GeneratorAttributeSyntaxContext.TargetNode"/> | ||
public SyntaxNode TargetNode { get; } = syntaxContext.TargetNode; | ||
|
||
/// <inheritdoc cref="GeneratorAttributeSyntaxContext.TargetSymbol"/> | ||
public ISymbol TargetSymbol { get; } = syntaxContext.TargetSymbol; | ||
|
||
/// <inheritdoc cref="GeneratorAttributeSyntaxContext.SemanticModel"/> | ||
public SemanticModel SemanticModel { get; } = syntaxContext.SemanticModel; | ||
|
||
/// <inheritdoc cref="GeneratorAttributeSyntaxContext.Attributes"/> | ||
public ImmutableArray<AttributeData> Attributes { get; } = syntaxContext.Attributes; | ||
|
||
/// <inheritdoc cref="AnalyzerConfigOptionsProvider.GlobalOptions"/> | ||
public AnalyzerConfigOptions GlobalOptions { get; } = globalOptions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters