255 references to EditKind
Microsoft.CodeAnalysis.CSharp.Features (42)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (42)
1028
EditKind
editKind,
1071
ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result,
1072
EditKind
editKind,
1080
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
1151
result.Add((oldSymbol, newSymbol, isTypeConstraint ?
EditKind
.Update : editKind));
1158
case
EditKind
.Reorder:
1165
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1171
result.Add((oldSymbol, newSymbol,
EditKind
.Reorder));
1175
case
EditKind
.Update:
1271
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1287
result.Add((oldPrimaryConstructor, newPrimaryConstructor,
EditKind
.Update));
1297
result.Add((oldCopyConstructor, newCopyConstructor,
EditKind
.Update));
1305
case
EditKind
.Delete:
1306
case
EditKind
.Insert:
1337
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1344
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1352
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1358
case
EditKind
.Move:
1376
if ((editKind ==
EditKind
.Delete ? oldSymbol : newSymbol) is null)
1596
protected override TextSpan? TryGetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
1599
internal static new TextSpan GetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
1602
private static TextSpan? TryGetDiagnosticSpanImpl(SyntaxNode node,
EditKind
editKind)
1606
internal static TextSpan? TryGetDiagnosticSpanImpl(SyntaxKind kind, SyntaxNode node,
EditKind
editKind)
1616
(editKind ==
EditKind
.Delete ? globalStatements.LastOrDefault() : globalStatements.FirstOrDefault()) ??
1729
if (editKind ==
EditKind
.Delete)
1987
protected override string? TryGetDisplayName(SyntaxNode node,
EditKind
editKind)
1990
internal static new string? GetDisplayName(SyntaxNode node,
EditKind
editKind)
1993
internal static string? TryGetDisplayNameImpl(SyntaxNode node,
EditKind
editKind)
2257
protected override string GetSuspensionPointDisplayName(SyntaxNode node,
EditKind
editKind)
2285
private readonly
EditKind
_kind;
2293
EditKind
kind,
2339
case
EditKind
.Delete:
2343
case
EditKind
.Update:
2347
case
EditKind
.Move:
2351
case
EditKind
.Insert:
2355
case
EditKind
.Reorder:
2473
Dictionary<SyntaxNode,
EditKind
> editMap)
2557
GetDiagnosticSpan(newNode,
EditKind
.Insert),
2559
arguments: [GetDisplayName(newNode,
EditKind
.Insert)]));
2630
Debug.Assert(edit.Kind !=
EditKind
.Update || edit.OldNode.RawKind == edit.NewNode.RawKind);
2632
if (edit.Kind !=
EditKind
.Update || !AreExceptionClausesEquivalent(edit.OldNode, edit.NewNode))
2887
GetDiagnosticSpan(newSwitch,
EditKind
.Update),
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (24)
EditAndContinue\CSharpEditAndContinueAnalyzerTests.cs (2)
62
var actual = CSharpEditAndContinueAnalyzer.GetDiagnosticSpan(node,
EditKind
.Update);
100
span = CSharpEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(kind, null,
EditKind
.Update);
EditAndContinue\TopLevelEditingTests.cs (22)
8439
edits.VerifyEdits(
EditKind
.Reorder);
8470
edits.VerifyEdits(
EditKind
.Reorder);
8506
edits.VerifyEdits(
EditKind
.Reorder);
16692
edits.VerifyEdits(
EditKind
.Reorder);
16722
edits.VerifyEdits(
EditKind
.Reorder);
16753
edits.VerifyEdits(
EditKind
.Reorder,
EditKind
.Update);
16783
edits.VerifyEdits(
EditKind
.Reorder,
EditKind
.Update);
16818
edits.VerifyEdits(
EditKind
.Reorder,
EditKind
.Update);
16837
edits.VerifyEdits(
EditKind
.Reorder);
16870
edits.VerifyEdits(
EditKind
.Reorder);
18059
edits.VerifyEdits(
EditKind
.Reorder);
18089
edits.VerifyEdits(
EditKind
.Reorder);
18123
edits.VerifyEdits(
EditKind
.Reorder);
18140
edits.VerifyEdits(
EditKind
.Reorder);
18173
edits.VerifyEdits(
EditKind
.Reorder);
21352
edits.VerifyEdits(
EditKind
.Reorder);
21384
edits.VerifyEdits(
EditKind
.Reorder);
21420
edits.VerifyEdits(
EditKind
.Reorder);
21453
edits.VerifyEdits(
EditKind
.Reorder);
Microsoft.CodeAnalysis.Features (92)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (92)
183
ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result,
184
EditKind
editKind,
192
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
200
EditKind
editKind,
207
private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)> GetSymbolEdits(
208
EditKind
editKind,
214
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
218
var result = new TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)>();
234
if (editKind ==
EditKind
.Update && GetSemanticallyMatchingNewSymbol(oldSymbol, newSymbol, newModel, symbolCache, cancellationToken) != null)
236
AddSymbolEdits(ref result,
EditKind
.Delete, oldNode, oldSymbol, newNode: null, newSymbol: null, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken);
237
AddSymbolEdits(ref result,
EditKind
.Insert, oldNode: null, oldSymbol: null, newNode, newSymbol, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken);
247
0 => OneOrMany<(ISymbol?, ISymbol?,
EditKind
)>.Empty,
261
protected abstract TextSpan? TryGetDiagnosticSpan(SyntaxNode node,
EditKind
editKind);
263
internal TextSpan GetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
266
protected virtual TextSpan GetBodyDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
308
internal string GetDisplayName(SyntaxNode node,
EditKind
editKind =
EditKind
.Update)
359
protected virtual string GetBodyDisplayName(SyntaxNode node,
EditKind
editKind =
EditKind
.Update)
389
protected abstract string? TryGetDisplayName(SyntaxNode node,
EditKind
editKind);
391
protected virtual string GetSuspensionPointDisplayName(SyntaxNode node,
EditKind
editKind)
400
internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, Match<SyntaxNode> match, Edit<SyntaxNode> edit, Dictionary<SyntaxNode,
EditKind
> editMap);
728
private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode,
EditKind
> editMap)
736
internal Dictionary<SyntaxNode,
EditKind
> BuildEditMap(EditScript<SyntaxNode> editScript)
738
var map = new Dictionary<SyntaxNode,
EditKind
>(editScript.Edits.Length);
744
if (edit.Kind is
EditKind
.Delete or
EditKind
.Update)
749
if (edit.Kind is
EditKind
.Insert or
EditKind
.Update)
762
map.Add(editScript.Match.OldRoot,
EditKind
.Update);
763
map.Add(editScript.Match.NewRoot,
EditKind
.Update);
1697
return GetDiagnosticSpan(newAncestor,
EditKind
.Delete);
1704
return GetDiagnosticSpan(newAncestor,
EditKind
.Delete);
1728
protected static bool HasParentEdit(IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap, Edit<SyntaxNode> edit)
1733
case
EditKind
.Insert:
1737
case
EditKind
.Delete:
1748
protected static bool HasEdit(IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap, SyntaxNode? node,
EditKind
editKind)
1752
editMap.TryGetValue(node, out
var
parentEdit) &&
1782
GetDiagnosticSpan(newNode,
EditKind
.Update),
1784
[GetDisplayName(newNode,
EditKind
.Update), oldType.ToDisplayString(), newType.ToDisplayString()]));
1791
GetDiagnosticSpan(newNode,
EditKind
.Update),
1793
[GetDisplayName(newNode,
EditKind
.Update)]));
1800
GetDiagnosticSpan(newNode,
EditKind
.Insert),
1802
[GetDisplayName(newNode,
EditKind
.Insert)]));
1811
[GetDisplayName(oldNode,
EditKind
.Delete)]));
2033
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
2058
Debug.Assert(editMap[newNode] is
EditKind
.Update or
EditKind
.Insert);
2491
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
2548
if (syntacticEditKind ==
EditKind
.Move)
2572
GetDiagnosticSpan(newTypeDeclaration,
EditKind
.Update),
2602
if (syntacticEditKind ==
EditKind
.Update)
2606
syntacticEditKind =
EditKind
.Insert;
2610
syntacticEditKind =
EditKind
.Delete;
2624
if (containingType != null && (syntacticEditKind !=
EditKind
.Delete || newSymbol == null))
2654
if (syntacticEditKind !=
EditKind
.Delete && oldSymbol is INamedTypeSymbol oldType && newSymbol is INamedTypeSymbol newType && IsReloadable(oldType))
2688
case
EditKind
.Delete:
2735
diagnostics.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)]));
2837
case
EditKind
.Insert:
2884
HasEdit(editMap, GetSymbolDeclarationSyntax(newAssociatedMember, cancellationToken),
EditKind
.Insert);
2912
GetDiagnosticSpan(newDeclaration,
EditKind
.Insert),
2914
arguments: [GetDisplayName(newDeclaration,
EditKind
.Insert)]));
2954
GetDiagnosticSpan(newDeclaration,
EditKind
.Insert),
2956
arguments: [GetDisplayName(newDeclaration,
EditKind
.Insert)]));
2988
case
EditKind
.Update:
2997
case
EditKind
.Reorder:
3268
var triviaSymbolEdits = GetSymbolEdits(
EditKind
.Update, oldEditNode, newEditNode, oldModel, newModel, editScript.Match, editMap, symbolCache, cancellationToken);
3498
protected static void AddMemberUpdate(ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result, ISymbol? oldSymbol, ISymbol? newSymbol, ISymbol? newSemanticallyMatchingSymbol)
3505
result.Add((oldSymbol, null,
EditKind
.Delete));
3506
result.Add((null, newSymbol,
EditKind
.Insert));
3510
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
3809
private ImmutableArray<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)> GetNamespaceSymbolEdits(
3814
using var _1 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)>.GetInstance(out var builder);
3845
builder.Add((oldSymbol: oldType, newSymbol: null,
EditKind
.Delete));
3876
builder[deletedTypeIndex] = (builder[deletedTypeIndex].oldSymbol, newType,
EditKind
.Move);
3880
builder.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)"/>
4938
locationNode.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)
5711
diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertNotSupportedByRuntime, GetDiagnosticSpan(newLambda,
EditKind
.Insert), newLambda, [GetDisplayName(newLambda,
EditKind
.Insert)]));
5719
diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertLocalFunctionIntoInterfaceMethod, GetDiagnosticSpan(newLambda,
EditKind
.Insert), newLambda, [GetDisplayName(newLambda,
EditKind
.Insert)]));
6050
return IsGlobalMain(symbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol, cancellationToken),
EditKind
.Update) :
6051
symbol is IParameterSymbol && IsGlobalMain(symbol.ContainingSymbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol.ContainingSymbol, cancellationToken),
EditKind
.Update) :
6783
internal void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode,
EditKind
> editMap)
Microsoft.CodeAnalysis.Features.Test.Utilities (1)
EditAndContinue\EditScriptDescription.cs (1)
34
public void VerifyEdits(params
EditKind
[] expected)
Microsoft.CodeAnalysis.VisualBasic.Features (48)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (48)
693
editKind As
EditKind
,
733
ByRef result As TemporaryArray(Of (ISymbol, ISymbol,
EditKind
)),
734
editKind As
EditKind
,
742
editMap As IReadOnlyDictionary(Of SyntaxNode,
EditKind
),
788
result.Add((oldSymbol, newSymbol, If(isTypeConstraint,
EditKind
.Update, editKind)))
794
Case
EditKind
.Reorder
801
result.Add((oldSymbol, newSymbol,
EditKind
.Reorder))
803
Case
EditKind
.Delete
806
Case
EditKind
.Insert
809
Case
EditKind
.Update
817
result.Add((oldPropertySymbol, newPropertySymbol,
EditKind
.Update))
837
result.Add((oldEventSymbol, newEventSymbol,
EditKind
.Update))
863
Case
EditKind
.Move
881
editKind As
EditKind
,
905
If editKind =
EditKind
.Update OrElse editKind =
EditKind
.Reorder Then
1056
Protected Overrides Function TryGetDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1060
Protected Overloads Shared Function GetDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan
1064
Private Shared Function TryGetDiagnosticSpanImpl(node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1068
Protected Overrides Function GetBodyDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan
1073
Friend Shared Function TryGetDiagnosticSpanImpl(kind As SyntaxKind, node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1172
If editKind =
EditKind
.Delete Then
1445
Protected Overrides Function TryGetDisplayName(node As SyntaxNode, editKind As
EditKind
) As String
1449
Protected Overloads Shared Function GetDisplayName(node As SyntaxNode, editKind As
EditKind
) As String
1459
Protected Overrides Function GetBodyDisplayName(node As SyntaxNode, Optional editKind As
EditKind
=
EditKind
.Update) As String
1463
Private Shared Function TryGetDisplayNameImpl(node As SyntaxNode, editKind As
EditKind
) As String
1600
Return If(editKind =
EditKind
.Update, VBFeaturesResources.Using_statement, VBFeaturesResources.Using_block)
1603
Return If(editKind =
EditKind
.Update, VBFeaturesResources.With_statement, VBFeaturesResources.With_block)
1606
Return If(editKind =
EditKind
.Update, VBFeaturesResources.SyncLock_statement, VBFeaturesResources.SyncLock_block)
1609
Return If(editKind =
EditKind
.Update, VBFeaturesResources.For_Each_statement, VBFeaturesResources.For_Each_block)
1695
Private ReadOnly _kind As
EditKind
1702
kind As
EditKind
,
1720
arguments:={GetDisplayName(If(_newNode, _oldNode),
EditKind
.Update)}))
1737
Case
EditKind
.Delete
1741
Case
EditKind
.Update
1745
Case
EditKind
.Move
1749
Case
EditKind
.Insert
1753
Case
EditKind
.Reorder
1894
editMap As Dictionary(Of SyntaxNode,
EditKind
))
1901
If edit.Kind =
EditKind
.Delete AndAlso
1905
If HasEdit(editMap, edit.OldNode.Parent.Parent,
EditKind
.Delete) Then
1909
ElseIf edit.Kind =
EditKind
.Insert AndAlso
1913
If HasEdit(editMap, edit.NewNode.Parent.Parent,
EditKind
.Insert) Then
1974
GetDiagnosticSpan(newNode,
EditKind
.Insert),
1976
arguments:={GetDisplayName(newNode,
EditKind
.Insert)}))
2084
Debug.Assert(edit.Kind <>
EditKind
.Update OrElse edit.OldNode.RawKind = edit.NewNode.RawKind)
2086
If edit.Kind <>
EditKind
.Update OrElse Not AreExceptionHandlingPartsEquivalent(edit.OldNode, edit.NewNode) Then
Microsoft.CodeAnalysis.VisualBasic.Features.UnitTests (18)
EditAndContinue\TopLevelEditingTests.vb (16)
5114
edits.VerifyEdits(
EditKind
.Reorder)
5136
edits.VerifyEdits(
EditKind
.Reorder)
5165
edits.VerifyEdits(
EditKind
.Reorder)
7705
edits.VerifyEdits(
EditKind
.Reorder)
7752
edits.VerifyEdits(
EditKind
.Reorder)
7776
edits.VerifyEdits(
EditKind
.Reorder)
7800
edits.VerifyEdits(
EditKind
.Reorder)
7822
edits.VerifyEdits(
EditKind
.Reorder)
7847
edits.VerifyEdits(
EditKind
.Reorder)
7872
edits.VerifyEdits(
EditKind
.Reorder)
8601
edits.VerifyEdits(
EditKind
.Reorder)
8623
edits.VerifyEdits(
EditKind
.Reorder)
8645
edits.VerifyEdits(
EditKind
.Reorder)
8681
edits.VerifyEdits(
EditKind
.Reorder)
8704
edits.VerifyEdits(
EditKind
.Reorder)
8730
edits.VerifyEdits(
EditKind
.Reorder)
EditAndContinue\VisualBasicEditAndContinueAnalyzerTests.vb (2)
45
Dim actualSpan = VisualBasicEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(node.Kind, node,
EditKind
.Update).Value
105
span = VisualBasicEditAndContinueAnalyzer.TryGetDiagnosticSpanImpl(k, Nothing,
EditKind
.Update)
Microsoft.CodeAnalysis.Workspaces (24)
Differencing\Edit.cs (9)
22
internal Edit(
EditKind
kind, TreeComparer<TNode> comparer, TNode oldNode, TNode newNode)
24
Debug.Assert((oldNode == null || oldNode.Equals(null)) == (kind ==
EditKind
.Insert));
25
Debug.Assert((newNode == null || newNode.Equals(null)) == (kind ==
EditKind
.Delete));
38
public
EditKind
Kind { get; }
96
case
EditKind
.Delete:
99
case
EditKind
.Insert:
102
case
EditKind
.Update:
105
case
EditKind
.Move:
106
case
EditKind
.Reorder:
Differencing\EditScript.cs (5)
95
edits.Add(new Edit<TNode>(
EditKind
.Insert, Comparer, oldNode: default, newNode: x));
114
edits.Add(new Edit<TNode>(
EditKind
.Update, Comparer, oldNode: w, newNode: x));
126
edits.Add(new Edit<TNode>(
EditKind
.Move, Comparer, oldNode: w, newNode: x));
156
edits.Add(new Edit<TNode>(
EditKind
.Delete, Comparer, oldNode: w, newNode: default));
236
edits.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"/>.
32
public
EditKind
Kind
38
return
EditKind
.Insert;
43
return
EditKind
.Delete;
46
return
EditKind
.Update;
77
case
EditKind
.Delete:
80
case
EditKind
.Insert:
83
case
EditKind
.Update:
Microsoft.CodeAnalysis.Workspaces.UnitTests (6)
Differencing\LongestCommonSubsequenceTests.cs (6)
52
Assert.True(edit.Kind is
EditKind
.Delete or
EditKind
.Insert or
EditKind
.Update);
55
case
EditKind
.Delete:
60
case
EditKind
.Insert:
65
case
EditKind
.Update: