@@ -29,8 +29,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
29
29
. Select ( static ( x , _ ) => x ! ) ;
30
30
31
31
var symbolsInReferencedAssemblies = context . CompilationProvider
32
- . SelectMany ( ( x , _ ) => x . SourceModule . ReferencedAssemblySymbols )
33
- . SelectMany ( ( asm , _ ) => asm . GlobalNamespace . CrawlForAllSymbols ( ) . Where ( x => x . Kind is SymbolKind . NamedType or SymbolKind . Method ) ) ;
32
+ . SelectMany ( ( x , _ ) => x . SourceModule . ReferencedAssemblySymbols )
33
+ . SelectMany ( ( asm , _ ) => asm . GlobalNamespace . CrawlForAllSymbols ( ) ) ;
34
34
35
35
var markdownFiles = context . AdditionalTextsProvider
36
36
. Where ( static file => file . Path . EndsWith ( ".md" ) )
@@ -80,7 +80,7 @@ void Execute(IncrementalValuesProvider<ISymbol> types, bool skipDiagnostics = fa
80
80
// Auto-assign the attached method name as the generated property name.
81
81
buttonActionAttribute . Name = x . Item1 . Name ;
82
82
83
- item = ( x . Item1 , buttonActionAttribute ) ;
83
+ item = ( x . Item1 . ContainingSymbol , buttonActionAttribute ) ;
84
84
}
85
85
86
86
// Add extra property data, like Title, back to Attribute
@@ -138,7 +138,7 @@ void Execute(IncrementalValuesProvider<ISymbol> types, bool skipDiagnostics = fa
138
138
sample . Attribute . Description ,
139
139
sample . AttachedQualifiedTypeName ,
140
140
optionsPaneAttribute . FirstOrDefault ( x => x . Item1 ? . SampleId == sample . Attribute . Id ) . Item2 ? . ToString ( ) ,
141
- generatedOptionPropertyData . Where ( x => ReferenceEquals ( x . Item1 , sample . Symbol ) ) . Select ( x => x . Item2 )
141
+ generatedOptionPropertyData . Where ( x => Equals ( x . Symbol , sample . Symbol ) ) . Select ( x => x . Item2 )
142
142
)
143
143
) ;
144
144
@@ -256,7 +256,9 @@ private static void ReportDiagnosticsGeneratedOptionsPane(SourceProductionContex
256
256
ctx . ReportDiagnostic ( Diagnostic . Create ( DiagnosticDescriptors . SamplePaneOptionWithDuplicateName , item . SelectMany ( x => x . Item1 . Locations ) . FirstOrDefault ( ) , item . Key ) ) ;
257
257
258
258
// Check for generated options that conflict with an existing property name
259
- var generatedOptionsWithConflictingPropertyNames = generatedOptionPropertyData . Where ( x => x . Item1 is INamedTypeSymbol sym && GetAllMembers ( sym ) . Any ( y => x . Item2 . Name == y . Name ) ) ;
259
+ var generatedOptionsWithConflictingPropertyNames = generatedOptionPropertyData
260
+ . Where ( x => x . Item2 is not ToolkitSampleButtonActionAttribute )
261
+ . Where ( x => x . Item1 is INamedTypeSymbol sym && GetAllMembers ( sym ) . Any ( y => x . Item2 . Name == y . Name ) ) ;
260
262
261
263
foreach ( var item in generatedOptionsWithConflictingPropertyNames )
262
264
ctx . ReportDiagnostic ( Diagnostic . Create ( DiagnosticDescriptors . SamplePaneOptionWithConflictingName , item . Item1 . Locations . FirstOrDefault ( ) , item . Item2 . Name ) ) ;
0 commit comments