255 references to EditKind
Microsoft.CodeAnalysis.CSharp.Features (42)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (42)
1036EditKind editKind, 1079ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 1080EditKind editKind, 1088IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 1159result.Add((oldSymbol, newSymbol, isTypeConstraint ? EditKind.Update : editKind)); 1166case EditKind.Reorder: 1173result.Add((oldSymbol, newSymbol, EditKind.Update)); 1179result.Add((oldSymbol, newSymbol, EditKind.Reorder)); 1183case EditKind.Update: 1279result.Add((oldSymbol, newSymbol, EditKind.Update)); 1295result.Add((oldPrimaryConstructor, newPrimaryConstructor, EditKind.Update)); 1305result.Add((oldCopyConstructor, newCopyConstructor, EditKind.Update)); 1313case EditKind.Delete: 1314case EditKind.Insert: 1345result.Add((oldSymbol, newSymbol, EditKind.Update)); 1352result.Add((oldSymbol, newSymbol, EditKind.Update)); 1360result.Add((oldSymbol, newSymbol, EditKind.Update)); 1366case EditKind.Move: 1384if ((editKind == EditKind.Delete ? oldSymbol : newSymbol) is null) 1604protected override TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1607internal static new TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1610private static TextSpan? TryGetDiagnosticSpanImpl(SyntaxNode node, EditKind editKind) 1614internal static TextSpan? TryGetDiagnosticSpanImpl(SyntaxKind kind, SyntaxNode node, EditKind editKind) 1624(editKind == EditKind.Delete ? globalStatements.LastOrDefault() : globalStatements.FirstOrDefault()) ?? 1737if (editKind == EditKind.Delete) 1995protected override string? TryGetDisplayName(SyntaxNode node, EditKind editKind) 1998internal static new string? GetDisplayName(SyntaxNode node, EditKind editKind) 2001internal static string? TryGetDisplayNameImpl(SyntaxNode node, EditKind editKind) 2265protected override string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 2293private readonly EditKind _kind; 2301EditKind kind, 2347case EditKind.Delete: 2351case EditKind.Update: 2355case EditKind.Move: 2359case EditKind.Insert: 2363case EditKind.Reorder: 2481Dictionary<SyntaxNode, EditKind> editMap) 2565GetDiagnosticSpan(newNode, EditKind.Insert), 2567arguments: [GetDisplayName(newNode, EditKind.Insert)])); 2638Debug.Assert(edit.Kind != EditKind.Update || edit.OldNode.RawKind == edit.NewNode.RawKind); 2640if (edit.Kind != EditKind.Update || !AreExceptionClausesEquivalent(edit.OldNode, edit.NewNode)) 2895GetDiagnosticSpan(newSwitch, EditKind.Update),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (24)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
62var actual = CSharpEditAndContinueAnalyzer.GetDiagnosticSpan(node, EditKind.Update); 100span = CSharpEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(kind, null, EditKind.Update);
EditAndContinue\TopLevelEditingTests.cs (22)
8439edits.VerifyEdits(EditKind.Reorder); 8470edits.VerifyEdits(EditKind.Reorder); 8506edits.VerifyEdits(EditKind.Reorder); 16692edits.VerifyEdits(EditKind.Reorder); 16722edits.VerifyEdits(EditKind.Reorder); 16753edits.VerifyEdits(EditKind.Reorder, EditKind.Update); 16783edits.VerifyEdits(EditKind.Reorder, EditKind.Update); 16818edits.VerifyEdits(EditKind.Reorder, EditKind.Update); 16837edits.VerifyEdits(EditKind.Reorder); 16870edits.VerifyEdits(EditKind.Reorder); 18059edits.VerifyEdits(EditKind.Reorder); 18089edits.VerifyEdits(EditKind.Reorder); 18123edits.VerifyEdits(EditKind.Reorder); 18140edits.VerifyEdits(EditKind.Reorder); 18173edits.VerifyEdits(EditKind.Reorder); 21352edits.VerifyEdits(EditKind.Reorder); 21384edits.VerifyEdits(EditKind.Reorder); 21420edits.VerifyEdits(EditKind.Reorder); 21453edits.VerifyEdits(EditKind.Reorder);
Microsoft.CodeAnalysis.Features (92)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (92)
191ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 192EditKind editKind, 200IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 208EditKind editKind, 215private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 216EditKind editKind, 222IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 226var result = new TemporaryArray<(ISymbol?, ISymbol?, EditKind)>(); 242if (editKind == EditKind.Update && GetSemanticallyMatchingNewSymbol(oldSymbol, newSymbol, newModel, symbolCache, cancellationToken) != null) 244AddSymbolEdits(ref result, EditKind.Delete, oldNode, oldSymbol, newNode: null, newSymbol: null, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken); 245AddSymbolEdits(ref result, EditKind.Insert, oldNode: null, oldSymbol: null, newNode, newSymbol, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken); 2550 => OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty, 269protected abstract TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind); 271internal TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 274protected virtual TextSpan GetBodyDiagnosticSpan(SyntaxNode node, EditKind editKind) 316internal string GetDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 367protected virtual string GetBodyDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 397protected abstract string? TryGetDisplayName(SyntaxNode node, EditKind editKind); 399protected virtual string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 408internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, Match<SyntaxNode> match, Edit<SyntaxNode> edit, Dictionary<SyntaxNode, EditKind> editMap); 736private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode, EditKind> editMap) 744internal Dictionary<SyntaxNode, EditKind> BuildEditMap(EditScript<SyntaxNode> editScript) 746var map = new Dictionary<SyntaxNode, EditKind>(editScript.Edits.Length); 752if (edit.Kind is EditKind.Delete or EditKind.Update) 757if (edit.Kind is EditKind.Insert or EditKind.Update) 770map.Add(editScript.Match.OldRoot, EditKind.Update); 771map.Add(editScript.Match.NewRoot, EditKind.Update); 1704return GetDiagnosticSpan(newAncestor, EditKind.Delete); 1711return GetDiagnosticSpan(newAncestor, EditKind.Delete); 1735protected static bool HasParentEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, Edit<SyntaxNode> edit) 1740case EditKind.Insert: 1744case EditKind.Delete: 1755protected static bool HasEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, SyntaxNode? node, EditKind editKind) 1759editMap.TryGetValue(node, out var parentEdit) && 1789GetDiagnosticSpan(newNode, EditKind.Update), 1791[GetDisplayName(newNode, EditKind.Update), oldType.ToDisplayString(), newType.ToDisplayString()])); 1798GetDiagnosticSpan(newNode, EditKind.Update), 1800[GetDisplayName(newNode, EditKind.Update)])); 1807GetDiagnosticSpan(newNode, EditKind.Insert), 1809[GetDisplayName(newNode, EditKind.Insert)])); 1818[GetDisplayName(oldNode, EditKind.Delete)])); 2040IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 2065Debug.Assert(editMap[newNode] is EditKind.Update or EditKind.Insert); 2498IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 2555if (syntacticEditKind == EditKind.Move) 2579GetDiagnosticSpan(newTypeDeclaration, EditKind.Update), 2609if (syntacticEditKind == EditKind.Update) 2613syntacticEditKind = EditKind.Insert; 2617syntacticEditKind = EditKind.Delete; 2631if (containingType != null && (syntacticEditKind != EditKind.Delete || newSymbol == null)) 2661if (syntacticEditKind != EditKind.Delete && oldSymbol is INamedTypeSymbol oldType && newSymbol is INamedTypeSymbol newType && IsReloadable(oldType)) 2695case EditKind.Delete: 2742diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.Delete, diagnosticSpan, edit.OldNode, [GetDisplayName(edit.OldNode!, EditKind.Delete)])); 2759[GetDisplayKindAndName(oldSymbol, GetDisplayName(oldDeclaration, EditKind.Delete), fullyQualify: diagnosticSpan.IsEmpty)])); 2786[GetDisplayKindAndName(oldSymbol, GetDisplayName(oldDeclaration, EditKind.Delete), fullyQualify: diagnosticSpan.IsEmpty)])); 2844case EditKind.Insert: 2891HasEdit(editMap, GetSymbolDeclarationSyntax(newAssociatedMember, cancellationToken), EditKind.Insert); 2919GetDiagnosticSpan(newDeclaration, EditKind.Insert), 2921arguments: [GetDisplayName(newDeclaration, EditKind.Insert)])); 2961GetDiagnosticSpan(newDeclaration, EditKind.Insert), 2963arguments: [GetDisplayName(newDeclaration, EditKind.Insert)])); 2995case EditKind.Update: 3004case EditKind.Reorder: 3275var triviaSymbolEdits = GetSymbolEdits(EditKind.Update, oldEditNode, newEditNode, oldModel, newModel, editScript.Match, editMap, symbolCache, cancellationToken); 3505protected static void AddMemberUpdate(ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, ISymbol? oldSymbol, ISymbol? newSymbol, ISymbol? newSemanticallyMatchingSymbol) 3512result.Add((oldSymbol, null, EditKind.Delete)); 3513result.Add((null, newSymbol, EditKind.Insert)); 3517result.Add((oldSymbol, newSymbol, EditKind.Update)); 3816private ImmutableArray<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetNamespaceSymbolEdits( 3821using var _1 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)>.GetInstance(out var builder); 3852builder.Add((oldSymbol: oldType, newSymbol: null, EditKind.Delete)); 3883builder[deletedTypeIndex] = (builder[deletedTypeIndex].oldSymbol, newType, EditKind.Move); 3887builder.Add((oldSymbol: null, newSymbol: newType, EditKind.Insert)); 4452/// and therefore not produced by <see cref="GetSymbolEdits(EditKind, SyntaxNode?, SyntaxNode?, SemanticModel?, SemanticModel, Match{SyntaxNode}, IReadOnlyDictionary{SyntaxNode, EditKind}, SymbolInfoCache, CancellationToken)"/> 4945locationNode.Span : analyzer.GetDiagnosticSpan(GetDiagnosticNode(out var distance, cancellationToken), distance > 0 ? EditKind.Delete : EditKind.Update), 4964? analyzer.GetDiagnosticSpan(node, (distance > 0 || kind == RudeEditKind.ChangeImplicitMainReturnType) ? EditKind.Delete : EditKind.Update) 5718diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertNotSupportedByRuntime, GetDiagnosticSpan(newLambda, EditKind.Insert), newLambda, [GetDisplayName(newLambda, EditKind.Insert)])); 5726diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertLocalFunctionIntoInterfaceMethod, GetDiagnosticSpan(newLambda, EditKind.Insert), newLambda, [GetDisplayName(newLambda, EditKind.Insert)])); 6057return IsGlobalMain(symbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol, cancellationToken), EditKind.Update) : 6058symbol is IParameterSymbol && IsGlobalMain(symbol.ContainingSymbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol.ContainingSymbol, cancellationToken), EditKind.Update) : 6786internal void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode, EditKind> editMap)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditScriptDescription.cs (1)
34public void VerifyEdits(params EditKind[] expected)
Microsoft.CodeAnalysis.VisualBasic.Features (48)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (48)
706editKind As EditKind, 746ByRef result As TemporaryArray(Of (ISymbol, ISymbol, EditKind)), 747editKind As EditKind, 755editMap As IReadOnlyDictionary(Of SyntaxNode, EditKind), 801result.Add((oldSymbol, newSymbol, If(isTypeConstraint, EditKind.Update, editKind))) 807Case EditKind.Reorder 814result.Add((oldSymbol, newSymbol, EditKind.Reorder)) 816Case EditKind.Delete 819Case EditKind.Insert 822Case EditKind.Update 830result.Add((oldPropertySymbol, newPropertySymbol, EditKind.Update)) 850result.Add((oldEventSymbol, newEventSymbol, EditKind.Update)) 876Case EditKind.Move 894editKind As EditKind, 918If editKind = EditKind.Update OrElse editKind = EditKind.Reorder Then 1069Protected Overrides Function TryGetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan? 1073Protected Overloads Shared Function GetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1077Private Shared Function TryGetDiagnosticSpanImpl(node As SyntaxNode, editKind As EditKind) As TextSpan? 1081Protected Overrides Function GetBodyDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1086Friend Shared Function TryGetDiagnosticSpanImpl(kind As SyntaxKind, node As SyntaxNode, editKind As EditKind) As TextSpan? 1185If editKind = EditKind.Delete Then 1458Protected Overrides Function TryGetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1462Protected Overloads Shared Function GetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1472Protected Overrides Function GetBodyDisplayName(node As SyntaxNode, Optional editKind As EditKind = EditKind.Update) As String 1476Private Shared Function TryGetDisplayNameImpl(node As SyntaxNode, editKind As EditKind) As String 1613Return If(editKind = EditKind.Update, VBFeaturesResources.Using_statement, VBFeaturesResources.Using_block) 1616Return If(editKind = EditKind.Update, VBFeaturesResources.With_statement, VBFeaturesResources.With_block) 1619Return If(editKind = EditKind.Update, VBFeaturesResources.SyncLock_statement, VBFeaturesResources.SyncLock_block) 1622Return If(editKind = EditKind.Update, VBFeaturesResources.For_Each_statement, VBFeaturesResources.For_Each_block) 1708Private ReadOnly _kind As EditKind 1715kind As EditKind, 1733arguments:={GetDisplayName(If(_newNode, _oldNode), EditKind.Update)})) 1750Case EditKind.Delete 1754Case EditKind.Update 1758Case EditKind.Move 1762Case EditKind.Insert 1766Case EditKind.Reorder 1907editMap As Dictionary(Of SyntaxNode, EditKind)) 1914If edit.Kind = EditKind.Delete AndAlso 1918If HasEdit(editMap, edit.OldNode.Parent.Parent, EditKind.Delete) Then 1922ElseIf edit.Kind = EditKind.Insert AndAlso 1926If HasEdit(editMap, edit.NewNode.Parent.Parent, EditKind.Insert) Then 1987GetDiagnosticSpan(newNode, EditKind.Insert), 1989arguments:={GetDisplayName(newNode, EditKind.Insert)})) 2097Debug.Assert(edit.Kind <> EditKind.Update OrElse edit.OldNode.RawKind = edit.NewNode.RawKind) 2099If edit.Kind <> EditKind.Update OrElse Not AreExceptionHandlingPartsEquivalent(edit.OldNode, edit.NewNode) Then
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (18)
EditAndContinue\TopLevelEditingTests.vb (16)
5114edits.VerifyEdits(EditKind.Reorder) 5136edits.VerifyEdits(EditKind.Reorder) 5165edits.VerifyEdits(EditKind.Reorder) 7705edits.VerifyEdits(EditKind.Reorder) 7752edits.VerifyEdits(EditKind.Reorder) 7776edits.VerifyEdits(EditKind.Reorder) 7800edits.VerifyEdits(EditKind.Reorder) 7822edits.VerifyEdits(EditKind.Reorder) 7847edits.VerifyEdits(EditKind.Reorder) 7872edits.VerifyEdits(EditKind.Reorder) 8601edits.VerifyEdits(EditKind.Reorder) 8623edits.VerifyEdits(EditKind.Reorder) 8645edits.VerifyEdits(EditKind.Reorder) 8681edits.VerifyEdits(EditKind.Reorder) 8704edits.VerifyEdits(EditKind.Reorder) 8730edits.VerifyEdits(EditKind.Reorder)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (2)
45Dim actualSpan = VisualBasicEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(node.Kind, node, EditKind.Update).Value 105span = VisualBasicEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(k, Nothing, EditKind.Update)
Microsoft.CodeAnalysis.Workspaces (24)
Differencing\Edit.cs (9)
22internal Edit(EditKind kind, TreeComparer<TNode> comparer, TNode oldNode, TNode newNode) 24Debug.Assert((oldNode == null || oldNode.Equals(null)) == (kind == EditKind.Insert)); 25Debug.Assert((newNode == null || newNode.Equals(null)) == (kind == EditKind.Delete)); 38public EditKind Kind { get; } 96case EditKind.Delete: 99case EditKind.Insert: 102case EditKind.Update: 105case EditKind.Move: 106case EditKind.Reorder:
Differencing\EditScript.cs (5)
95edits.Add(new Edit<TNode>(EditKind.Insert, Comparer, oldNode: default, newNode: x)); 114edits.Add(new Edit<TNode>(EditKind.Update, Comparer, oldNode: w, newNode: x)); 126edits.Add(new Edit<TNode>(EditKind.Move, Comparer, oldNode: w, newNode: x)); 156edits.Add(new Edit<TNode>(EditKind.Delete, Comparer, oldNode: w, newNode: default)); 236edits.Add(new Edit<TNode>(EditKind.Reorder, Comparer, oldNode: a, newNode: b));
Differencing\SequenceEdit.cs (10)
30/// The kind of edit: <see cref="EditKind.Delete"/>, <see cref="EditKind.Insert"/>, or <see cref="EditKind.Update"/>. 32public EditKind Kind 38return EditKind.Insert; 43return EditKind.Delete; 46return EditKind.Update; 77case EditKind.Delete: 80case EditKind.Insert: 83case EditKind.Update:
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Differencing\LongestCommonSubsequenceTests.cs (6)
52Assert.True(edit.Kind is EditKind.Delete or EditKind.Insert or EditKind.Update); 55case EditKind.Delete: 60case EditKind.Insert: 65case EditKind.Update: