How to find type of the field with specific name in Roslyn
问题 Need to find TypeSyntax or essentially Type of a specific filed in class by using Roslyn. Something like this: rootSyntaxNode .DescendantNodes() .OfType<FieldDeclarationSyntax>() .First(x => x.Identifier="fieldName") .GivemeTypeSyntax() But could not get any hint about how to reach Identifier and SyntaxType in FieldDeclarationSyntax node. Any idea please? 回答1: Part of the issue is that fields can contain multiple variables. You'll look at Declaration for type and Variables for identifiers. I