/
WorkspaceChangeKind.cs
135 lines (111 loc) · 4.29 KB
/
WorkspaceChangeKind.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable disable
namespace Microsoft.CodeAnalysis
{
public enum WorkspaceChangeKind
{
/// <summary>
/// The current solution changed for an unspecified reason.
/// </summary>
SolutionChanged = 0,
/// <summary>
/// A solution was added to the workspace.
/// </summary>
SolutionAdded = 1,
/// <summary>
/// The current solution was removed from the workspace.
/// </summary>
SolutionRemoved = 2,
/// <summary>
/// The current solution was cleared of all projects and documents.
/// </summary>
SolutionCleared = 3,
/// <summary>
/// The current solution was reloaded.
/// </summary>
SolutionReloaded = 4,
/// <summary>
/// A project was added to the current solution.
/// </summary>
ProjectAdded = 5,
/// <summary>
/// A project was removed from the current solution.
/// </summary>
ProjectRemoved = 6,
/// <summary>
/// A project in the current solution was changed.
/// </summary>
ProjectChanged = 7,
/// <summary>
/// A project in the current solution was reloaded.
/// </summary>
ProjectReloaded = 8,
/// <summary>
/// A document was added to the current solution.
/// </summary>
DocumentAdded = 9,
/// <summary>
/// A document was removed from the current solution.
/// </summary>
DocumentRemoved = 10,
/// <summary>
/// A document in the current solution was reloaded.
/// </summary>
DocumentReloaded = 11,
/// <summary>
/// A document in the current solution was changed.
/// <para>
/// When linked files are edited, one <see cref="DocumentChanged"/> event is fired per
/// linked file. All of these events contain the same OldSolution, and they all contain
/// the same NewSolution. This is so that we can trigger document change events on all
/// affected documents without reporting intermediate states in which the linked file
/// contents do not match. Each <see cref="DocumentChanged"/> event does not represent
/// an incremental update from the previous event in this special case.
/// </para>
/// </summary>
DocumentChanged = 12,
/// <summary>
/// An additional document was added to the current solution.
/// </summary>
AdditionalDocumentAdded = 13,
/// <summary>
/// An additional document was removed from the current solution.
/// </summary>
AdditionalDocumentRemoved = 14,
/// <summary>
/// An additional document in the current solution was reloaded.
/// </summary>
AdditionalDocumentReloaded = 15,
/// <summary>
/// An additional document in the current solution was changed.
/// </summary>
AdditionalDocumentChanged = 16,
/// <summary>
/// The document in the current solution had is info changed; name, folders, filepath
/// </summary>
DocumentInfoChanged = 17,
/// <summary>
/// An analyzer config document was added to the current solution.
/// </summary>
AnalyzerConfigDocumentAdded = 18,
/// <summary>
/// An analyzer config document was removed from the current solution.
/// </summary>
AnalyzerConfigDocumentRemoved = 19,
/// <summary>
/// An analyzer config document in the current solution was reloaded.
/// </summary>
AnalyzerConfigDocumentReloaded = 20,
/// <summary>
/// An analyzer config document in the current solution was changed.
/// </summary>
AnalyzerConfigDocumentChanged = 21,
}
internal static class WorkspaceChangeKindExtensions
{
public static bool IsValid(this WorkspaceChangeKind kind)
=> kind is >= WorkspaceChangeKind.SolutionChanged and <= WorkspaceChangeKind.AnalyzerConfigDocumentChanged;
}
}