2 writes to Symbol
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.cs (2)
22Symbol = symbol; 29Symbol = null;
78 references to Symbol
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (9)
SymbolKey\SymbolKeyCompilationsTests.cs (1)
534Assert.Null(syminfo.Symbol);
SymbolKey\SymbolKeyErrorTypeTests.cs (2)
321Assert.NotNull(resolution.Symbol); 325Assert.Equal(symbol.ToDisplayString(), resolution.Symbol!.ToDisplayString());
SymbolKey\SymbolKeyTestBase.cs (1)
91return symInfo.Symbol;
SymbolKey\SymbolKeyTests.cs (5)
50var resolved = symbolKey.Resolve(compilation).Symbol; 89var resolved = symbolKey.Resolve(compilation).Symbol; 95resolved = symbolKey.Resolve(compilation).Symbol; 125var resolved = symbolKey.Resolve(compilation).Symbol; 175var resolved = symbolKey.Resolve(compilation).Symbol;
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
74var newDestinationSymbol = destination.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol;
Microsoft.CodeAnalysis.EditorFeatures (1)
Peek\DefinitionPeekableItem.cs (1)
79var symbol = _peekableItem._symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken: cancellationToken).Symbol;
Microsoft.CodeAnalysis.Features (38)
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (1)
64if (AssemblySymbolKey.Resolve(originCompilation).Symbol is not IAssemblySymbol assemblySymbol)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (15)
2737var oldSymbolInNewCompilation = symbolCache.GetKey(oldSymbol, cancellationToken).Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2738var newSymbolInOldCompilation = symbolCache.GetKey(newSymbol, cancellationToken).Resolve(oldModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2806oldContainingType ??= (INamedTypeSymbol?)containingTypeSymbolKey.Resolve(oldModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2807newContainingType ??= (INamedTypeSymbol?)containingTypeSymbolKey.Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 2939var newContainingType = (INamedTypeSymbol?)containingTypeKey.Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 3064oldContainingType = containingTypeKey.Resolve(oldModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol as INamedTypeSymbol; 3589var result = symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 3669symbolCache.GetKey(oldSymbol, cancellationToken).Resolve(newCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol is { } matchingNewSymbol && 3765if (SymbolKey.Create(deconstructor, cancellationToken).Resolve(otherCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol != null) 4013var newType = SymbolKey.Create(oldType, cancellationToken).Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 4044var oldType = SymbolKey.Create(newType, cancellationToken).Resolve(oldModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 5129if (symbolKey.Resolve(newModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol is { } newSymbol) 5541oldCtor = (IMethodSymbol?)resolution.Symbol; 6986var oldConstructor = SymbolKey.Create(newPrimaryConstructor, cancellationToken).Resolve(oldCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol; 6999var oldParameter = SymbolKey.Create(newPrimaryParameter, cancellationToken).Resolve(oldCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol;
EditAndContinue\EditSession.cs (5)
845Contract.ThrowIfNull(oldResolution.Symbol); 856Contract.ThrowIfNull(newResolution.Symbol); 862Contract.ThrowIfNull(newResolution.Symbol); 869resolvedSymbols.Add((oldResolution.Symbol, newResolution.Symbol));
EncapsulateField\AbstractEncapsulateFieldService.cs (3)
154if (field.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol is not IFieldSymbol currentField) 187field = (IFieldSymbol)field.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol!; 255field = (IFieldSymbol)field.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol!;
FindUsages\DefinitionItem.DefaultDefinitionItem.cs (1)
73var symbol = SymbolKey.ResolveString(symbolKey, compilation, cancellationToken: cancellationToken).Symbol;
InlineHints\InlineHintHelpers.cs (1)
26var symbol = symbolKey.Resolve(semanticModel.Compilation, cancellationToken: cancellationToken).Symbol;
MetadataAsSource\MetadataAsSourceFileService.cs (2)
282if (resolutionResult.Symbol == null) 285return new SymbolMappingResult(project, resolutionResult.Symbol);
PdbSourceDocument\PdbSourceDocumentMetadataAsSourceFileProvider.cs (1)
151var newSymbol = resolution.Symbol;
SignatureHelp\AbstractSignatureHelpProvider.cs (2)
268symbolKey.Resolve(compilation, ignoreAssemblyKey: true, cancellationToken).Symbol is not ISymbol symbol) 287if (symbolKey.Resolve(relatedSemanticModel.Compilation, ignoreAssemblyKey: true, cancellationToken).Symbol == null)
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
91var constructorInCompilation = (IMethodSymbol?)SymbolKey.Create(constructor).Resolve(semanticModel.Compilation).Symbol;
src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
193field = (IFieldSymbol?)field.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol; 194property = (IPropertySymbol?)property.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol;
SymbolMapping\SymbolMappingServiceFactory.cs (1)
27var symbol = symbolId.Resolve(compilation, cancellationToken: cancellationToken).Symbol;
ValueTracking\SerializableValueTrackedItem.cs (2)
48Contract.ThrowIfNull(symbolResolution.Symbol); 56return new ValueTrackedItem(SymbolKey, sourceText, TextSpan, DocumentId, symbolResolution.Symbol.GetGlyph(), parent);
ValueTracking\ValueTracker.cs (1)
330return item.SymbolKey.Resolve(semanticModel.Compilation, cancellationToken: cancellationToken).Symbol;
Microsoft.CodeAnalysis.Features.Test.Utilities (9)
EditAndContinue\EditAndContinueTestVerifier.cs (9)
325actualSemanticEdits.Select(e => $"{e.Kind}: {e.Symbol.Resolve(e.Kind == SemanticEditKind.Delete ? oldCompilation : newCompilation).Symbol}"), 345Assert.Equal(expectedOldSymbol, symbolKey.Resolve(oldCompilation, ignoreAssemblyKey: true).Symbol); 346Assert.Equal(expectedNewSymbol, symbolKey.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol); 355symbolKey.Resolve(oldCompilation, ignoreAssemblyKey: true).Symbol is ISymbol resolvedSymbol) 362Assert.Equal(expectedOldSymbol, symbolKey.Resolve(oldCompilation, ignoreAssemblyKey: true).Symbol); 369Assert.Equal(null, symbolKey.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol); 373var deletedSymbolContainer = actualSemanticEdit.DeletedSymbolContainer?.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol; 383Assert.Equal(expectedNewSymbol, symbolKey.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol); 393actualSemanticEdit.PartialType?.Resolve(newCompilation, ignoreAssemblyKey: true).Symbol,
Microsoft.CodeAnalysis.Workspaces (12)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
148? symbol.GetSymbolKey(cancellationToken).Resolve(compilation, cancellationToken: cancellationToken).Symbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.cs (3)
11/// single <see cref="ISymbol"/> then that will be returned in <see cref="Symbol"/>. Otherwise, if the key resolves 15/// If no symbol can be found <see cref="Symbol"/> will be <c>null</c> and <see cref="CandidateSymbols"/> 34internal int SymbolCount => Symbol != null ? 1 : CandidateSymbols.Length;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.Enumeration.cs (4)
33if (_symbolKeyResolution.Symbol != null) 35return ++_index == 0 && _symbolKeyResolution.Symbol is TSymbol; 53if (_symbolKeyResolution.Symbol != null) 55return (TSymbol)_symbolKeyResolution.Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolutionExtensions.cs (2)
11if (resolution.Symbol != null) 13return resolution.Symbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SymbolFinder\SymbolFinderInternal.cs (2)
85return InSource(result.Symbol) ? result.Symbol : result.CandidateSymbols.FirstOrDefault(InSource);
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
SymbolKeyTests.cs (6)
407var resolved = SymbolKey.ResolveString(key, compilation2).Symbol; 431var resolved = SymbolKey.ResolveString(key, compilation2).Symbol; 1426Assert.NotNull(resolved.Symbol); 1428Assert.Equal(resolved.Symbol.Name, symbol.Name); 1429Assert.Equal(resolved.Symbol.Kind, symbol.Kind); 1432Assert.True(resolved.Symbol.Locations[0].SourceSpan.Start > symbol.Locations[0].SourceSpan.Start);
Microsoft.VisualStudio.LanguageServices (2)
CallHierarchy\Finders\AbstractCallFinder.cs (1)
104var symbol = resolution.Symbol;
Library\ObjectBrowser\Lists\SymbolListItem.cs (1)
64=> _symbolKey.Resolve(compilation, ignoreAssemblyKey: false).Symbol;