3 instantiations of SyntaxNodeKey
Microsoft.VisualStudio.LanguageServices.Implementation (3)
CodeModel\AbstractCodeModelService.cs (1)
119var key = new SyntaxNodeKey(name, ordinal);
CodeModel\InternalElements\AbstractKeyedCodeElement.cs (1)
42NodeKey = new SyntaxNodeKey(name, -1);
CodeModel\SyntaxNodeKey.cs (1)
21public static readonly SyntaxNodeKey Empty = new();
81 references to SyntaxNodeKey
Microsoft.VisualStudio.LanguageServices.CSharp (1)
CodeModel\CSharpCodeModelService.cs (1)
540var nodeKey = GetNodeKey(node);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
CodeModel\AbstractFileCodeElementTests.cs (1)
13using SyntaxNodeKey = Microsoft.VisualStudio.LanguageServices.Implementation.CodeModel.SyntaxNodeKey;
Microsoft.VisualStudio.LanguageServices.Implementation (79)
CodeModel\AbstractCodeModelService.cs (20)
41private readonly ConditionalWeakTable<SyntaxTree, IBidirectionalMap<SyntaxNodeKey, SyntaxNode>> _treeToNodeKeyMaps = 42new ConditionalWeakTable<SyntaxTree, IBidirectionalMap<SyntaxNodeKey, SyntaxNode>>(); 104private IBidirectionalMap<SyntaxNodeKey, SyntaxNode> BuildNodeKeyMap(SyntaxTree syntaxTree) 107var nodeKeyMap = BidirectionalMap<SyntaxNodeKey, SyntaxNode>.Empty; 119var key = new SyntaxNodeKey(name, ordinal); 126private IBidirectionalMap<SyntaxNodeKey, SyntaxNode> GetNodeKeyMap(SyntaxTree syntaxTree) 129public SyntaxNodeKey GetNodeKey(SyntaxNode node) 131var nodeKey = TryGetNodeKey(node); 141public SyntaxNodeKey TryGetNodeKey(SyntaxNode node) 144if (!nodeKeyMap.TryGetKey(node, out var nodeKey)) 146return SyntaxNodeKey.Empty; 152public SyntaxNode LookupNode(SyntaxNodeKey nodeKey, SyntaxTree syntaxTree) 163public bool TryLookupNode(SyntaxNodeKey nodeKey, SyntaxTree syntaxTree, [NotNullWhen(true)] out SyntaxNode? node) 336.FirstOrDefault(n => TryGetNodeKey(n) != SyntaxNodeKey.Empty); 363var nodeKey = parentNode.AncestorsAndSelf() 365.FirstOrDefault(nk => nk != SyntaxNodeKey.Empty); 367if (nodeKey == SyntaxNodeKey.Empty) 406.FirstOrDefault(n => TryGetNodeKey(n) != SyntaxNodeKey.Empty); 433.FirstOrDefault(n => TryGetNodeKey(n) != SyntaxNodeKey.Empty); 452.FirstOrDefault(n => TryGetNodeKey(n) != SyntaxNodeKey.Empty);
CodeModel\Collections\BasesCollection.cs (3)
29SyntaxNodeKey nodeKey, 37private readonly SyntaxNodeKey _nodeKey; 43SyntaxNodeKey nodeKey,
CodeModel\Collections\InheritsImplementsCollection.cs (3)
26SyntaxNodeKey nodeKey) 33private readonly SyntaxNodeKey _nodeKey; 39SyntaxNodeKey nodeKey)
CodeModel\Collections\NamespaceCollection.cs (4)
26SyntaxNodeKey nodeKey) 33private readonly SyntaxNodeKey _nodeKey; 39SyntaxNodeKey nodeKey) 55get { return _nodeKey == SyntaxNodeKey.Empty; }
CodeModel\Collections\TypeCollection.cs (3)
26SyntaxNodeKey nodeKey) 33private readonly SyntaxNodeKey _nodeKey; 39SyntaxNodeKey nodeKey)
CodeModel\FileCodeModel.cs (10)
59private readonly CleanableWeakComHandleTable<SyntaxNodeKey, EnvDTE.CodeElement> _codeElementTable; 88_codeElementTable = new CleanableWeakComHandleTable<SyntaxNodeKey, EnvDTE.CodeElement>(state.ThreadingContext); 196internal void UpdateCodeElementNodeKey(AbstractKeyedCodeElement keyedElement, SyntaxNodeKey oldNodeKey, SyntaxNodeKey newNodeKey) 222internal void OnCodeElementCreated(SyntaxNodeKey nodeKey, EnvDTE.CodeElement element) 235internal void OnCodeElementDeleted(SyntaxNodeKey nodeKey) 240var nodeKey = CodeModelService.TryGetNodeKey(node); 459internal SyntaxNode LookupNode(SyntaxNodeKey nodeKey) 633get { return NamespaceCollection.Create(this.State, this, this, SyntaxNodeKey.Empty); } 803var nodeKey = keyedElement.NodeKey;
CodeModel\GlobalNodeKey.cs (2)
13public readonly SyntaxNodeKey NodeKey; 16public GlobalNodeKey(SyntaxNodeKey nodeKey, SyntaxPath path)
CodeModel\ICodeModelService.cs (4)
70SyntaxNodeKey GetNodeKey(SyntaxNode node); 71SyntaxNodeKey TryGetNodeKey(SyntaxNode node); 72SyntaxNode LookupNode(SyntaxNodeKey nodeKey, SyntaxTree syntaxTree); 73bool TryLookupNode(SyntaxNodeKey nodeKey, SyntaxTree syntaxTree, [NotNullWhen(true)] out SyntaxNode? node);
CodeModel\InternalElements\AbstractCodeMember.cs (1)
24SyntaxNodeKey nodeKey,
CodeModel\InternalElements\AbstractCodeType.cs (1)
22SyntaxNodeKey nodeKey,
CodeModel\InternalElements\AbstractKeyedCodeElement.cs (3)
26SyntaxNodeKey nodeKey, 46internal SyntaxNodeKey NodeKey { get; private set; } 70var newNodeKey = CodeModelService.GetNodeKey(node);
CodeModel\InternalElements\CodeClass.cs (2)
29SyntaxNodeKey nodeKey, 54SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeDelegate.cs (2)
21SyntaxNodeKey nodeKey, 45SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeEnum.cs (2)
19SyntaxNodeKey nodeKey, 43SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeEvent.cs (2)
22SyntaxNodeKey nodeKey, 46SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeFunction.cs (2)
25SyntaxNodeKey nodeKey, 49SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeFunctionDeclareDecl.cs (2)
17SyntaxNodeKey nodeKey, 41SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeFunctionWithEventHandler.cs (2)
19SyntaxNodeKey nodeKey, 43SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeInterface.cs (2)
20SyntaxNodeKey nodeKey, 44SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeNamespace.cs (2)
23SyntaxNodeKey nodeKey, 47SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeProperty.cs (2)
23SyntaxNodeKey nodeKey, 47SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeStruct.cs (2)
21SyntaxNodeKey nodeKey, 45SyntaxNodeKey nodeKey,
CodeModel\InternalElements\CodeVariable.cs (2)
21SyntaxNodeKey nodeKey, 45SyntaxNodeKey nodeKey,
CodeModel\SyntaxNodeKey.cs (1)
21public static readonly SyntaxNodeKey Empty = new();