public static SymbolKeyResolution Resolve(SymbolKeyReader reader) { var isAnonymousDelegateType = reader.ReadBoolean(); var location = reader.ReadLocation(); var syntaxTree = location.SourceTree; if (syntaxTree == null) { return default(SymbolKeyResolution); } var semanticModel = reader.Compilation.GetSemanticModel(syntaxTree); var root = syntaxTree.GetRoot(reader.CancellationToken); var node = root.FindNode(location.SourceSpan, getInnermostNodeForTie: true); var symbol = semanticModel.GetSymbolInfo(node, reader.CancellationToken) .GetAnySymbol(); // If this was a key for an anonymous delegate type, then go find the // associated delegate for this lambda and return that instead of the // lambda function symbol itself. if (isAnonymousDelegateType) { var anonymousDelegate = (symbol as IMethodSymbol).AssociatedAnonymousDelegate; symbol = anonymousDelegate; } return new SymbolKeyResolution(symbol); }
public static SymbolKeyResolution Resolve(SymbolKeyReader reader) { var isAnonymousDelegateType = reader.ReadBoolean(); var location = reader.ReadLocation(); var syntaxTree = location.SourceTree; if (syntaxTree == null) { return(default);