public override void VisitIdentifierName(IdentifierNameSyntax node) { string name = node.Identifier.ValueText; if (Nodes.TryGetValue(name, out NodeSymbolInfo info)) { if (info.Symbol == null) { ISymbol declaredSymbol = SemanticModel.GetDeclaredSymbol(info.Node, CancellationToken); if (declaredSymbol == null) { RemoveNode(name); return; } info = new NodeSymbolInfo(info.Name, info.Node, declaredSymbol); Nodes[name] = info; } ISymbol symbol = SemanticModel.GetSymbol(node, CancellationToken); if (IsIndexer) { symbol = GetIndexerParameterSymbol(node, symbol); } if (info.Symbol.Equals(symbol)) { RemoveNode(name); } } }
private void AddNode(string name, SyntaxNode node) { Nodes[name] = new NodeSymbolInfo(name, node); }