Browse Source

Resolve generator marker types via GetTypeByMetadataName

pull/3807/head
Siegfried Pammer 3 weeks ago committed by Siegfried Pammer
parent
commit
8f64cc38cf
  1. 5
      ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs

5
ICSharpCode.Decompiler.Generators/DecompilerSyntaxTreeGenerator.cs

@ -64,8 +64,9 @@ internal class DecompilerSyntaxTreeGenerator : IIncrementalGenerator
{ {
membersToMatch = new(); membersToMatch = new();
var astNodeType = (INamedTypeSymbol)context.SemanticModel.GetSpeculativeSymbolInfo(context.TargetNode.Span.Start, SyntaxFactory.ParseTypeName("AstNode"), SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol!; var compilation = context.SemanticModel.Compilation;
var entityDeclarationType = context.SemanticModel.GetSpeculativeSymbolInfo(context.TargetNode.Span.Start, SyntaxFactory.ParseTypeName("EntityDeclaration"), SpeculativeBindingOption.BindAsTypeOrNamespace).Symbol as INamedTypeSymbol; var astNodeType = compilation.GetTypeByMetadataName("ICSharpCode.Decompiler.CSharp.Syntax.AstNode")!;
var entityDeclarationType = compilation.GetTypeByMetadataName("ICSharpCode.Decompiler.CSharp.Syntax.EntityDeclaration");
// EntityDeclaration declares Name (a NameSlot over its Identifier token), ReturnType, and the attributes/modifiers // EntityDeclaration declares Name (a NameSlot over its Identifier token), ReturnType, and the attributes/modifiers
// helper as virtual members on the base; a subclass overrides them, so the property scan (which // helper as virtual members on the base; a subclass overrides them, so the property scan (which

Loading…
Cancel
Save