255 references to EditKind
Microsoft.CodeAnalysis.CSharp.Features (42)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (42)
1036
EditKind
editKind,
1079
ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result,
1080
EditKind
editKind,
1088
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
1159
result.Add((oldSymbol, newSymbol, isTypeConstraint ?
EditKind
.Update : editKind));
1166
case
EditKind
.Reorder:
1173
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1179
result.Add((oldSymbol, newSymbol,
EditKind
.Reorder));
1183
case
EditKind
.Update:
1279
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1295
result.Add((oldPrimaryConstructor, newPrimaryConstructor,
EditKind
.Update));
1305
result.Add((oldCopyConstructor, newCopyConstructor,
EditKind
.Update));
1313
case
EditKind
.Delete:
1314
case
EditKind
.Insert:
1345
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1352
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1360
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
1366
case
EditKind
.Move:
1384
if ((editKind ==
EditKind
.Delete ? oldSymbol : newSymbol) is null)
1604
protected override TextSpan? TryGetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
1607
internal static new TextSpan GetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
1610
private static TextSpan? TryGetDiagnosticSpanImpl(SyntaxNode node,
EditKind
editKind)
1614
internal static TextSpan? TryGetDiagnosticSpanImpl(SyntaxKind kind, SyntaxNode node,
EditKind
editKind)
1624
(editKind ==
EditKind
.Delete ? globalStatements.LastOrDefault() : globalStatements.FirstOrDefault()) ??
1737
if (editKind ==
EditKind
.Delete)
1995
protected override string? TryGetDisplayName(SyntaxNode node,
EditKind
editKind)
1998
internal static new string? GetDisplayName(SyntaxNode node,
EditKind
editKind)
2001
internal static string? TryGetDisplayNameImpl(SyntaxNode node,
EditKind
editKind)
2265
protected override string GetSuspensionPointDisplayName(SyntaxNode node,
EditKind
editKind)
2293
private readonly
EditKind
_kind;
2301
EditKind
kind,
2347
case
EditKind
.Delete:
2351
case
EditKind
.Update:
2355
case
EditKind
.Move:
2359
case
EditKind
.Insert:
2363
case
EditKind
.Reorder:
2481
Dictionary<SyntaxNode,
EditKind
> editMap)
2565
GetDiagnosticSpan(newNode,
EditKind
.Insert),
2567
arguments: [GetDisplayName(newNode,
EditKind
.Insert)]));
2638
Debug.Assert(edit.Kind !=
EditKind
.Update || edit.OldNode.RawKind == edit.NewNode.RawKind);
2640
if (edit.Kind !=
EditKind
.Update || !AreExceptionClausesEquivalent(edit.OldNode, edit.NewNode))
2895
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)
191
ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result,
192
EditKind
editKind,
200
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
208
EditKind
editKind,
215
private OneOrMany<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)> GetSymbolEdits(
216
EditKind
editKind,
222
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
226
var result = new TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)>();
242
if (editKind ==
EditKind
.Update && GetSemanticallyMatchingNewSymbol(oldSymbol, newSymbol, newModel, symbolCache, cancellationToken) != null)
244
AddSymbolEdits(ref result,
EditKind
.Delete, oldNode, oldSymbol, newNode: null, newSymbol: null, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken);
245
AddSymbolEdits(ref result,
EditKind
.Insert, oldNode: null, oldSymbol: null, newNode, newSymbol, oldModel, newModel, topMatch, editMap, symbolCache, cancellationToken);
255
0 => OneOrMany<(ISymbol?, ISymbol?,
EditKind
)>.Empty,
269
protected abstract TextSpan? TryGetDiagnosticSpan(SyntaxNode node,
EditKind
editKind);
271
internal TextSpan GetDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
274
protected virtual TextSpan GetBodyDiagnosticSpan(SyntaxNode node,
EditKind
editKind)
316
internal string GetDisplayName(SyntaxNode node,
EditKind
editKind =
EditKind
.Update)
367
protected virtual string GetBodyDisplayName(SyntaxNode node,
EditKind
editKind =
EditKind
.Update)
397
protected abstract string? TryGetDisplayName(SyntaxNode node,
EditKind
editKind);
399
protected virtual string GetSuspensionPointDisplayName(SyntaxNode node,
EditKind
editKind)
408
internal abstract void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, Match<SyntaxNode> match, Edit<SyntaxNode> edit, Dictionary<SyntaxNode,
EditKind
> editMap);
736
private void ReportTopLevelSyntacticRudeEdits(ArrayBuilder<RudeEditDiagnostic> diagnostics, EditScript<SyntaxNode> syntacticEdits, Dictionary<SyntaxNode,
EditKind
> editMap)
744
internal Dictionary<SyntaxNode,
EditKind
> BuildEditMap(EditScript<SyntaxNode> editScript)
746
var map = new Dictionary<SyntaxNode,
EditKind
>(editScript.Edits.Length);
752
if (edit.Kind is
EditKind
.Delete or
EditKind
.Update)
757
if (edit.Kind is
EditKind
.Insert or
EditKind
.Update)
770
map.Add(editScript.Match.OldRoot,
EditKind
.Update);
771
map.Add(editScript.Match.NewRoot,
EditKind
.Update);
1704
return GetDiagnosticSpan(newAncestor,
EditKind
.Delete);
1711
return GetDiagnosticSpan(newAncestor,
EditKind
.Delete);
1735
protected static bool HasParentEdit(IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap, Edit<SyntaxNode> edit)
1740
case
EditKind
.Insert:
1744
case
EditKind
.Delete:
1755
protected static bool HasEdit(IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap, SyntaxNode? node,
EditKind
editKind)
1759
editMap.TryGetValue(node, out
var
parentEdit) &&
1789
GetDiagnosticSpan(newNode,
EditKind
.Update),
1791
[GetDisplayName(newNode,
EditKind
.Update), oldType.ToDisplayString(), newType.ToDisplayString()]));
1798
GetDiagnosticSpan(newNode,
EditKind
.Update),
1800
[GetDisplayName(newNode,
EditKind
.Update)]));
1807
GetDiagnosticSpan(newNode,
EditKind
.Insert),
1809
[GetDisplayName(newNode,
EditKind
.Insert)]));
1818
[GetDisplayName(oldNode,
EditKind
.Delete)]));
2040
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
2065
Debug.Assert(editMap[newNode] is
EditKind
.Update or
EditKind
.Insert);
2498
IReadOnlyDictionary<SyntaxNode,
EditKind
> editMap,
2555
if (syntacticEditKind ==
EditKind
.Move)
2579
GetDiagnosticSpan(newTypeDeclaration,
EditKind
.Update),
2609
if (syntacticEditKind ==
EditKind
.Update)
2613
syntacticEditKind =
EditKind
.Insert;
2617
syntacticEditKind =
EditKind
.Delete;
2631
if (containingType != null && (syntacticEditKind !=
EditKind
.Delete || newSymbol == null))
2661
if (syntacticEditKind !=
EditKind
.Delete && oldSymbol is INamedTypeSymbol oldType && newSymbol is INamedTypeSymbol newType && IsReloadable(oldType))
2695
case
EditKind
.Delete:
2742
diagnostics.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)]));
2844
case
EditKind
.Insert:
2891
HasEdit(editMap, GetSymbolDeclarationSyntax(newAssociatedMember, cancellationToken),
EditKind
.Insert);
2919
GetDiagnosticSpan(newDeclaration,
EditKind
.Insert),
2921
arguments: [GetDisplayName(newDeclaration,
EditKind
.Insert)]));
2961
GetDiagnosticSpan(newDeclaration,
EditKind
.Insert),
2963
arguments: [GetDisplayName(newDeclaration,
EditKind
.Insert)]));
2995
case
EditKind
.Update:
3004
case
EditKind
.Reorder:
3275
var triviaSymbolEdits = GetSymbolEdits(
EditKind
.Update, oldEditNode, newEditNode, oldModel, newModel, editScript.Match, editMap, symbolCache, cancellationToken);
3505
protected static void AddMemberUpdate(ref TemporaryArray<(ISymbol?, ISymbol?,
EditKind
)> result, ISymbol? oldSymbol, ISymbol? newSymbol, ISymbol? newSemanticallyMatchingSymbol)
3512
result.Add((oldSymbol, null,
EditKind
.Delete));
3513
result.Add((null, newSymbol,
EditKind
.Insert));
3517
result.Add((oldSymbol, newSymbol,
EditKind
.Update));
3816
private ImmutableArray<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)> GetNamespaceSymbolEdits(
3821
using var _1 = ArrayBuilder<(ISymbol? oldSymbol, ISymbol? newSymbol,
EditKind
editKind)>.GetInstance(out var builder);
3852
builder.Add((oldSymbol: oldType, newSymbol: null,
EditKind
.Delete));
3883
builder[deletedTypeIndex] = (builder[deletedTypeIndex].oldSymbol, newType,
EditKind
.Move);
3887
builder.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)"/>
4945
locationNode.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)
5718
diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertNotSupportedByRuntime, GetDiagnosticSpan(newLambda,
EditKind
.Insert), newLambda, [GetDisplayName(newLambda,
EditKind
.Insert)]));
5726
diagnostics.Add(new RudeEditDiagnostic(RudeEditKind.InsertLocalFunctionIntoInterfaceMethod, GetDiagnosticSpan(newLambda,
EditKind
.Insert), newLambda, [GetDisplayName(newLambda,
EditKind
.Insert)]));
6057
return IsGlobalMain(symbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol, cancellationToken),
EditKind
.Update) :
6058
symbol is IParameterSymbol && IsGlobalMain(symbol.ContainingSymbol) ? GetDiagnosticSpan(GetSymbolDeclarationSyntax(symbol.ContainingSymbol, cancellationToken),
EditKind
.Update) :
6786
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)
706
editKind As
EditKind
,
746
ByRef result As TemporaryArray(Of (ISymbol, ISymbol,
EditKind
)),
747
editKind As
EditKind
,
755
editMap As IReadOnlyDictionary(Of SyntaxNode,
EditKind
),
801
result.Add((oldSymbol, newSymbol, If(isTypeConstraint,
EditKind
.Update, editKind)))
807
Case
EditKind
.Reorder
814
result.Add((oldSymbol, newSymbol,
EditKind
.Reorder))
816
Case
EditKind
.Delete
819
Case
EditKind
.Insert
822
Case
EditKind
.Update
830
result.Add((oldPropertySymbol, newPropertySymbol,
EditKind
.Update))
850
result.Add((oldEventSymbol, newEventSymbol,
EditKind
.Update))
876
Case
EditKind
.Move
894
editKind As
EditKind
,
918
If editKind =
EditKind
.Update OrElse editKind =
EditKind
.Reorder Then
1069
Protected Overrides Function TryGetDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1073
Protected Overloads Shared Function GetDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan
1077
Private Shared Function TryGetDiagnosticSpanImpl(node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1081
Protected Overrides Function GetBodyDiagnosticSpan(node As SyntaxNode, editKind As
EditKind
) As TextSpan
1086
Friend Shared Function TryGetDiagnosticSpanImpl(kind As SyntaxKind, node As SyntaxNode, editKind As
EditKind
) As TextSpan?
1185
If editKind =
EditKind
.Delete Then
1458
Protected Overrides Function TryGetDisplayName(node As SyntaxNode, editKind As
EditKind
) As String
1462
Protected Overloads Shared Function GetDisplayName(node As SyntaxNode, editKind As
EditKind
) As String
1472
Protected Overrides Function GetBodyDisplayName(node As SyntaxNode, Optional editKind As
EditKind
=
EditKind
.Update) As String
1476
Private Shared Function TryGetDisplayNameImpl(node As SyntaxNode, editKind As
EditKind
) As String
1613
Return If(editKind =
EditKind
.Update, VBFeaturesResources.Using_statement, VBFeaturesResources.Using_block)
1616
Return If(editKind =
EditKind
.Update, VBFeaturesResources.With_statement, VBFeaturesResources.With_block)
1619
Return If(editKind =
EditKind
.Update, VBFeaturesResources.SyncLock_statement, VBFeaturesResources.SyncLock_block)
1622
Return If(editKind =
EditKind
.Update, VBFeaturesResources.For_Each_statement, VBFeaturesResources.For_Each_block)
1708
Private ReadOnly _kind As
EditKind
1715
kind As
EditKind
,
1733
arguments:={GetDisplayName(If(_newNode, _oldNode),
EditKind
.Update)}))
1750
Case
EditKind
.Delete
1754
Case
EditKind
.Update
1758
Case
EditKind
.Move
1762
Case
EditKind
.Insert
1766
Case
EditKind
.Reorder
1907
editMap As Dictionary(Of SyntaxNode,
EditKind
))
1914
If edit.Kind =
EditKind
.Delete AndAlso
1918
If HasEdit(editMap, edit.OldNode.Parent.Parent,
EditKind
.Delete) Then
1922
ElseIf edit.Kind =
EditKind
.Insert AndAlso
1926
If HasEdit(editMap, edit.NewNode.Parent.Parent,
EditKind
.Insert) Then
1987
GetDiagnosticSpan(newNode,
EditKind
.Insert),
1989
arguments:={GetDisplayName(newNode,
EditKind
.Insert)}))
2097
Debug.Assert(edit.Kind <>
EditKind
.Update OrElse edit.OldNode.RawKind = edit.NewNode.RawKind)
2099
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: