255 references to EditKind
Microsoft.CodeAnalysis.CSharp.Features (42)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (42)
1028EditKind editKind, 1071ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 1072EditKind editKind, 1080IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 1151result.Add((oldSymbol, newSymbol, isTypeConstraint ? EditKind.Update : editKind)); 1158case EditKind.Reorder: 1165result.Add((oldSymbol, newSymbol, EditKind.Update)); 1171result.Add((oldSymbol, newSymbol, EditKind.Reorder)); 1175case EditKind.Update: 1271result.Add((oldSymbol, newSymbol, EditKind.Update)); 1287result.Add((oldPrimaryConstructor, newPrimaryConstructor, EditKind.Update)); 1297result.Add((oldCopyConstructor, newCopyConstructor, EditKind.Update)); 1305case EditKind.Delete: 1306case EditKind.Insert: 1337result.Add((oldSymbol, newSymbol, EditKind.Update)); 1344result.Add((oldSymbol, newSymbol, EditKind.Update)); 1352result.Add((oldSymbol, newSymbol, EditKind.Update)); 1358case EditKind.Move: 1376if ((editKind == EditKind.Delete ? oldSymbol : newSymbol) is null) 1596protected override TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1599internal static new TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 1602private static TextSpan? TryGetDiagnosticSpanImpl(SyntaxNode node, EditKind editKind) 1606internal static TextSpan? TryGetDiagnosticSpanImpl(SyntaxKind kind, SyntaxNode node, EditKind editKind) 1616(editKind == EditKind.Delete ? globalStatements.LastOrDefault() : globalStatements.FirstOrDefault()) ?? 1729if (editKind == EditKind.Delete) 1987protected override string? TryGetDisplayName(SyntaxNode node, EditKind editKind) 1990internal static new string? GetDisplayName(SyntaxNode node, EditKind editKind) 1993internal static string? TryGetDisplayNameImpl(SyntaxNode node, EditKind editKind) 2257protected override string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 2285private readonly EditKind _kind; 2293EditKind kind, 2339case EditKind.Delete: 2343case EditKind.Update: 2347case EditKind.Move: 2351case EditKind.Insert: 2355case EditKind.Reorder: 2473Dictionary<SyntaxNode, EditKind> editMap) 2557GetDiagnosticSpan(newNode, EditKind.Insert), 2559arguments: [GetDisplayName(newNode, EditKind.Insert)])); 2630Debug.Assert(edit.Kind != EditKind.Update || edit.OldNode.RawKind == edit.NewNode.RawKind); 2632if (edit.Kind != EditKind.Update || !AreExceptionClausesEquivalent(edit.OldNode, edit.NewNode)) 2887GetDiagnosticSpan(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)
183ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, 184EditKind editKind, 192IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 200EditKind editKind, 207private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetSymbolEdits( 208EditKind editKind, 214IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 218var result = new TemporaryArray<(ISymbol?, ISymbol?, EditKind)>(); 234if (editKind == EditKind.Update && GetSemanticallyMatchingNewSymbol(oldSymbol, newSymbol, newModel, symbolCache, cancellationToken) != null) 236AddSymbolEdits(ref result, EditKind.Delete, oldNode, oldSymbol, newNode: null, newSymbol: null, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken); 237AddSymbolEdits(ref result, EditKind.Insert, oldNode: null, oldSymbol: null, newNode, newSymbol, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken); 2470 => OneOrMany<(ISymbol?, ISymbol?, EditKind)>.Empty, 261protected abstract TextSpan? TryGetDiagnosticSpan(SyntaxNode node, EditKind editKind); 263internal TextSpan GetDiagnosticSpan(SyntaxNode node, EditKind editKind) 266protected virtual TextSpan GetBodyDiagnosticSpan(SyntaxNode node, EditKind editKind) 308internal string GetDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 359protected virtual string GetBodyDisplayName(SyntaxNode node, EditKind editKind = EditKind.Update) 389protected abstract string? TryGetDisplayName(SyntaxNode node, EditKind editKind); 391protected virtual string GetSuspensionPointDisplayName(SyntaxNode node, EditKind editKind) 400internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, Match<SyntaxNode> match, Edit<SyntaxNode> edit, Dictionary<SyntaxNode, EditKind> editMap); 728private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode, EditKind> editMap) 736internal Dictionary<SyntaxNode, EditKind> BuildEditMap(EditScript<SyntaxNode> editScript) 738var map = new Dictionary<SyntaxNode, EditKind>(editScript.Edits.Length); 744if (edit.Kind is EditKind.Delete or EditKind.Update) 749if (edit.Kind is EditKind.Insert or EditKind.Update) 762map.Add(editScript.Match.OldRoot, EditKind.Update); 763map.Add(editScript.Match.NewRoot, EditKind.Update); 1697return GetDiagnosticSpan(newAncestor, EditKind.Delete); 1704return GetDiagnosticSpan(newAncestor, EditKind.Delete); 1728protected static bool HasParentEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, Edit<SyntaxNode> edit) 1733case EditKind.Insert: 1737case EditKind.Delete: 1748protected static bool HasEdit(IReadOnlyDictionary<SyntaxNode, EditKind> editMap, SyntaxNode? node, EditKind editKind) 1752editMap.TryGetValue(node, out var parentEdit) && 1782GetDiagnosticSpan(newNode, EditKind.Update), 1784[GetDisplayName(newNode, EditKind.Update), oldType.ToDisplayString(), newType.ToDisplayString()])); 1791GetDiagnosticSpan(newNode, EditKind.Update), 1793[GetDisplayName(newNode, EditKind.Update)])); 1800GetDiagnosticSpan(newNode, EditKind.Insert), 1802[GetDisplayName(newNode, EditKind.Insert)])); 1811[GetDisplayName(oldNode, EditKind.Delete)])); 2033IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 2058Debug.Assert(editMap[newNode] is EditKind.Update or EditKind.Insert); 2491IReadOnlyDictionary<SyntaxNode, EditKind> editMap, 2548if (syntacticEditKind == EditKind.Move) 2572GetDiagnosticSpan(newTypeDeclaration, EditKind.Update), 2602if (syntacticEditKind == EditKind.Update) 2606syntacticEditKind = EditKind.Insert; 2610syntacticEditKind = EditKind.Delete; 2624if (containingType != null && (syntacticEditKind != EditKind.Delete || newSymbol == null)) 2654if (syntacticEditKind != EditKind.Delete && oldSymbol is INamedTypeSymbol oldType && newSymbol is INamedTypeSymbol newType && IsReloadable(oldType)) 2688case EditKind.Delete: 2735diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.Delete, diagnosticSpan, edit.OldNode, [GetDisplayName(edit.OldNode!, EditKind.Delete)])); 2752[GetDisplayKindAndName(oldSymbol, GetDisplayName(oldDeclaration, EditKind.Delete), fullyQualify: diagnosticSpan.IsEmpty)])); 2779[GetDisplayKindAndName(oldSymbol, GetDisplayName(oldDeclaration, EditKind.Delete), fullyQualify: diagnosticSpan.IsEmpty)])); 2837case EditKind.Insert: 2884HasEdit(editMap, GetSymbolDeclarationSyntax(newAssociatedMember, cancellationToken), EditKind.Insert); 2912GetDiagnosticSpan(newDeclaration, EditKind.Insert), 2914arguments: [GetDisplayName(newDeclaration, EditKind.Insert)])); 2954GetDiagnosticSpan(newDeclaration, EditKind.Insert), 2956arguments: [GetDisplayName(newDeclaration, EditKind.Insert)])); 2988case EditKind.Update: 2997case EditKind.Reorder: 3268var triviaSymbolEdits = GetSymbolEdits(EditKind.Update, oldEditNode, newEditNode, oldModel, newModel, editScript.Match, editMap, symbolCache, cancellationToken); 3498protected static void AddMemberUpdate(ref TemporaryArray<(ISymbol?, ISymbol?, EditKind)> result, ISymbol? oldSymbol, ISymbol? newSymbol, ISymbol? newSemanticallyMatchingSymbol) 3505result.Add((oldSymbol, null, EditKind.Delete)); 3506result.Add((null, newSymbol, EditKind.Insert)); 3510result.Add((oldSymbol, newSymbol, EditKind.Update)); 3809private ImmutableArray<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)> GetNamespaceSymbolEdits( 3814using var _1 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol, EditKind editKind)>.GetInstance(out var builder); 3845builder.Add((oldSymbol: oldType, newSymbol: null, EditKind.Delete)); 3876builder[deletedTypeIndex] = (builder[deletedTypeIndex].oldSymbol, newType, EditKind.Move); 3880builder.Add((oldSymbol: null, newSymbol: newType, EditKind.Insert)); 4445/// and therefore not produced by <see cref="GetSymbolEdits(EditKind, SyntaxNode?, SyntaxNode?, SemanticModel?, SemanticModel, Match{SyntaxNode}, IReadOnlyDictionary{SyntaxNode, EditKind}, SymbolInfoCache, CancellationToken)"/> 4938locationNode.Span : analyzer.GetDiagnosticSpan(GetDiagnosticNode(out var distance, cancellationToken), distance > 0 ? EditKind.Delete : EditKind.Update), 4957? analyzer.GetDiagnosticSpan(node, (distance > 0 || kind == RudeEditKind.ChangeImplicitMainReturnType) ? EditKind.Delete : EditKind.Update) 5711diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertNotSupportedByRuntime, GetDiagnosticSpan(newLambda, EditKind.Insert), newLambda, [GetDisplayName(newLambda, EditKind.Insert)])); 5719diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertLocalFunctionIntoInterfaceMethod, GetDiagnosticSpan(newLambda, EditKind.Insert), newLambda, [GetDisplayName(newLambda, EditKind.Insert)])); 6050return IsGlobalMain(symbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol, cancellationToken), EditKind.Update) : 6051symbol is IParameterSymbol && IsGlobalMain(symbol.ContainingSymbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol.ContainingSymbol, cancellationToken), EditKind.Update) : 6783internal 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)
693editKind As EditKind, 733ByRef result As TemporaryArray(Of (ISymbol, ISymbol, EditKind)), 734editKind As EditKind, 742editMap As IReadOnlyDictionary(Of SyntaxNode, EditKind), 788result.Add((oldSymbol, newSymbol, If(isTypeConstraint, EditKind.Update, editKind))) 794Case EditKind.Reorder 801result.Add((oldSymbol, newSymbol, EditKind.Reorder)) 803Case EditKind.Delete 806Case EditKind.Insert 809Case EditKind.Update 817result.Add((oldPropertySymbol, newPropertySymbol, EditKind.Update)) 837result.Add((oldEventSymbol, newEventSymbol, EditKind.Update)) 863Case EditKind.Move 881editKind As EditKind, 905If editKind = EditKind.Update OrElse editKind = EditKind.Reorder Then 1056Protected Overrides Function TryGetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan? 1060Protected Overloads Shared Function GetDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1064Private Shared Function TryGetDiagnosticSpanImpl(node As SyntaxNode, editKind As EditKind) As TextSpan? 1068Protected Overrides Function GetBodyDiagnosticSpan(node As SyntaxNode, editKind As EditKind) As TextSpan 1073Friend Shared Function TryGetDiagnosticSpanImpl(kind As SyntaxKind, node As SyntaxNode, editKind As EditKind) As TextSpan? 1172If editKind = EditKind.Delete Then 1445Protected Overrides Function TryGetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1449Protected Overloads Shared Function GetDisplayName(node As SyntaxNode, editKind As EditKind) As String 1459Protected Overrides Function GetBodyDisplayName(node As SyntaxNode, Optional editKind As EditKind = EditKind.Update) As String 1463Private Shared Function TryGetDisplayNameImpl(node As SyntaxNode, editKind As EditKind) As String 1600Return If(editKind = EditKind.Update, VBFeaturesResources.Using_statement, VBFeaturesResources.Using_block) 1603Return If(editKind = EditKind.Update, VBFeaturesResources.With_statement, VBFeaturesResources.With_block) 1606Return If(editKind = EditKind.Update, VBFeaturesResources.SyncLock_statement, VBFeaturesResources.SyncLock_block) 1609Return If(editKind = EditKind.Update, VBFeaturesResources.For_Each_statement, VBFeaturesResources.For_Each_block) 1695Private ReadOnly _kind As EditKind 1702kind As EditKind, 1720arguments:={GetDisplayName(If(_newNode, _oldNode), EditKind.Update)})) 1737Case EditKind.Delete 1741Case EditKind.Update 1745Case EditKind.Move 1749Case EditKind.Insert 1753Case EditKind.Reorder 1894editMap As Dictionary(Of SyntaxNode, EditKind)) 1901If edit.Kind = EditKind.Delete AndAlso 1905If HasEdit(editMap, edit.OldNode.Parent.Parent, EditKind.Delete) Then 1909ElseIf edit.Kind = EditKind.Insert AndAlso 1913If HasEdit(editMap, edit.NewNode.Parent.Parent, EditKind.Insert) Then 1974GetDiagnosticSpan(newNode, EditKind.Insert), 1976arguments:={GetDisplayName(newNode, EditKind.Insert)})) 2084Debug.Assert(edit.Kind <> EditKind.Update OrElse edit.OldNode.RawKind = edit.NewNode.RawKind) 2086If 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: