EditAndContinue\AbstractEditAndContinueAnalyzer.cs (40)
2667PooledDictionary<ISymbol, SymbolKey> symbolKeyCache)
2669public SymbolKey GetKey(ISymbol symbol, CancellationToken cancellationToken)
2670=> symbolKeyCache.GetOrAdd(symbol, static (symbol, cancellationToken) => SymbolKey.Create(symbol, cancellationToken), cancellationToken);
2704using var _3 = PooledDictionary<ISymbol, SymbolKey>.GetInstance(out var symbolKeyCache);
2805var containingTypeSymbolKey = symbolCache.GetKey(containingType, cancellationToken);
2853var typeKey = symbolCache.GetKey(newType, cancellationToken);
2938var containingTypeKey = symbolCache.GetKey(oldContainingType, cancellationToken);
3063var containingTypeKey = symbolCache.GetKey(newContainingType, cancellationToken);
3399var containingSymbolKey = symbolCache.GetKey(oldSymbol.ContainingType, cancellationToken);
3422var symbolKey = symbolCache.GetKey(symbol, cancellationToken);
3432: (SymbolKey?)null;
3473var oldContainingTypeKey = SymbolKey.Create(oldContainingType, cancellationToken);
3544var symbolKey = symbolCache.GetKey(newSymbol, cancellationToken);
3586static ISymbol? Resolve(ISymbol symbol, SymbolKey symbolKey, Compilation compilation, CancellationToken cancellationToken)
3698SymbolKey containingTypeKey,
3750SymbolKey containingTypeKey,
3765if (SymbolKey.Create(deconstructor, cancellationToken).Resolve(otherCompilation, ignoreAssemblyKey: true, cancellationToken).Symbol != null)
3870private static void AddDeleteEditsForMemberAndAccessors(ArrayBuilder<SemanticEditInfo> semanticEdits, ISymbol oldSymbol, SymbolKey deletedSymbolContainer, CancellationToken cancellationToken)
3923SymbolKey containingSymbolKey,
3951semanticEdits.Add(SemanticEditInfo.CreateUpdate(SymbolKey.Create(oldSymbol, cancellationToken), syntaxMaps: default, partialType: 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;
4136private static readonly IEqualityComparer<SymbolKey> s_symbolKeyComparer = SymbolKey.GetComparer();
4686var containingSymbolKey = SymbolKey.Create(oldContainingMember.ContainingSymbol, cancellationToken);
4709semanticEdits.Add(SemanticEditInfo.CreateUpdate(SymbolKey.Create(beginInvokeMethod, cancellationToken), syntaxMaps: default, partialType: null));
4983var symbolKey = SymbolKey.Create(member, cancellationToken);
5128var symbolKey = SymbolKey.Create(oldSymbol, cancellationToken);
5462var typeKey = SymbolKey.Create(newType, cancellationToken);
5463var partialType = isPartialEdit ? typeKey : (SymbolKey?)null;
5497var newCtorKey = SymbolKey.Create(newCtor, cancellationToken);
5638SymbolKey.Create(oldType.InstanceConstructors.Single(c => c.Parameters is []), cancellationToken),
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\SemanticEditInfo.cs (28)
44SymbolKey symbol,
46SymbolKey? partialType,
47SymbolKey? deletedSymbolContainer)
58public static SemanticEditInfo CreateInsert(SymbolKey symbol, SymbolKey? partialType)
64var partialType = symbol.IsPartialImplementation() ? SymbolKey.Create(symbol.ContainingType, cancellationToken) : (SymbolKey?)null;
65return CreateInsert(SymbolKey.Create(symbol, cancellationToken), partialType);
68public static SemanticEditInfo CreateUpdate(SymbolKey symbol, SyntaxMaps syntaxMaps, SymbolKey? partialType)
74var partialType = symbol.IsPartialImplementation() ? SymbolKey.Create(symbol.ContainingType, cancellationToken) : (SymbolKey?)null;
75return CreateUpdate(SymbolKey.Create(symbol, cancellationToken), syntaxMaps, partialType);
78public static SemanticEditInfo CreateReplace(SymbolKey symbol, SymbolKey? partialType)
81public static SemanticEditInfo CreateDelete(SymbolKey symbol, SymbolKey deletedSymbolContainer, SymbolKey? partialType)
84public static SemanticEditInfo CreateDelete(ISymbol symbol, SymbolKey containingSymbolKey, CancellationToken cancellationToken)
87var partialType = symbol.IsPartialImplementation() ? containingSymbolKey : (SymbolKey?)null;
88return CreateDelete(SymbolKey.Create(symbol, cancellationToken), containingSymbolKey, partialType);
101/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>,
103/// When the edits are processed we map the <see cref="SymbolKey"/> to the current compilation.
105public SymbolKey Symbol { get; }
110/// We use <see cref="SymbolKey"/> to represent the symbol rather then <see cref="ISymbol"/>,
112/// When the edits are processed we map the <see cref="SymbolKey"/> to the current compilation.
114public SymbolKey? DeletedSymbolContainer { get; }
126public SymbolKey? PartialType { get; }
MetadataAsSource\DecompilationMetadataAsSourceFileProvider.cs (9)
69var symbolId = SymbolKey.Create(symbol, cancellationToken);
384return new UniqueDocumentKey(peMetadataReference.FilePath, peMetadataReference.GetMetadataId(), project.Language, SymbolKey.Create(topLevelNamedType, cancellationToken), signaturesOnly);
389return new UniqueDocumentKey(containingAssembly.Identity, containingAssembly.GetMetadata()?.Id, project.Language, SymbolKey.Create(topLevelNamedType, cancellationToken), signaturesOnly);
395private static readonly IEqualityComparer<SymbolKey> s_symbolIdComparer = SymbolKey.GetComparer(ignoreCase: false, ignoreAssemblyKeys: true);
409private readonly SymbolKey _symbolId;
412public UniqueDocumentKey(string filePath, MetadataId? metadataId, string language, SymbolKey symbolId, bool signaturesOnly)
423public UniqueDocumentKey(AssemblyIdentity assemblyIdentity, MetadataId? metadataId, string language, SymbolKey symbolId, bool signaturesOnly)
NavigationBar\IRemoteNavigationBarItemService.cs (12)
50public readonly SymbolKey? DestinationTypeSymbolKey;
57public readonly SymbolKey? EventSymbolKey;
62public readonly SymbolKey? MethodToReplicateSymbolKey;
75SymbolKey? destinationTypeSymbolKey,
77SymbolKey? eventSymbolKey,
78SymbolKey? methodToReplicateSymbolKey)
117public static SerializableNavigationBarItem GenerateFinalizer(string text, SymbolKey destinationTypeSymbolKey)
120public static SerializableNavigationBarItem GenerateEventHandler(string eventName, Glyph glyph, string containerName, SymbolKey eventSymbolKey, SymbolKey destinationTypeSymbolKey)
123public static SerializableNavigationBarItem GenerateMethod(string text, Glyph glyph, SymbolKey destinationTypeSymbolId, SymbolKey methodToReplicateSymbolId)
126public static SerializableNavigationBarItem GenerateDefaultConstructor(string text, SymbolKey destinationTypeSymbolKey)