Commit 9abf75c
authored
Replace "file kind" strings with an enum (#11722)
Throughout the compiler and tooling Razor files have a "kind" that is
represented as a string. Prior to the Razor API being taken internal,
using a string made it theoretically possible for the compiler to be
extended to file types other than those that the Razor compiler already
knows about. With extensibility no longer a priority, file kinds can be
represented as an enum (`RazorFileKind`) that provides the values that
the compiler supports, e.g.. `Component`, `ComponentImport`, `Legacy`.
This makes checks for the file kind much cheaper, since they were all
string comparisons before.
There are a lot of files changed, but much of the work is mechanical.
> [!IMPORTANT]
> This is a breaking change for the RazorSDK. When the Razor compiler
flows to the .NET SDK, it will introduce build errors that can be fixed
by applying this commit:
dotnet/sdk@f33a5e7.
VS Test Insertion:
https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/626687File tree
191 files changed
+2942
-3033
lines changed- src
- Compiler
- Microsoft.AspNetCore.Mvc.Razor.Extensions/test
- IntegrationTests
- Microsoft.AspNetCore.Razor.Language
- legacyTest/Legacy
- test
- Components
- Extensions
- IntegrationTests
- Legacy
- Microsoft.CodeAnalysis.Razor.Compiler/src
- Language
- Components
- Extensions
- Legacy
- Mvc.Version1_X
- Mvc.Version2_X
- Mvc
- SourceGenerators
- perf/Microbenchmarks
- test/Microsoft.NET.Sdk.Razor.SourceGenerators.Tests
- Razor
- benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks
- LanguageServer
- ProjectSystem
- src
- Microsoft.AspNetCore.Razor.LanguageServer
- MapCode
- Microsoft.CodeAnalysis.Razor.Workspaces
- CodeActions/Razor
- Completion
- Diagnostics
- GoToDefinition
- Hover
- ProjectSystem
- Legacy
- Rename
- Serialization
- MessagePack
- Formatters
- Utilities
- Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem
- Microsoft.VisualStudio.LanguageServices.Razor/ProjectSystem
- Microsoft.VisualStudio.LegacyEditor.Razor/Parsing
- test
- Microsoft.AspNetCore.Razor.ExternalAccess.LegacyEditor.Test
- Microsoft.AspNetCore.Razor.LanguageServer.Test
- AutoInsert
- CodeActions
- CSharp
- Html
- Razor
- Debugging
- Formatting_NetFx
- Hover
- Microsoft.AspNetCore.Razor.Test.Common.Tooling
- LanguageServer
- Language
- IntegrationTests
- Legacy
- ProjectSystem
- Microsoft.CodeAnalysis.Razor.Workspaces.Test
- Completion
- Extensions
- Serialization
- Tooltip
- Utilities
- Microsoft.VisualStudio.LanguageServices.Razor.Test
- Cohost
- CodeActions
- LanguageClient
- ProjectSystem
- Microsoft.VisualStudio.LegacyEditor.Razor.Test/Parsing
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
191 files changed
+2942
-3033
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
| 226 | + | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
| 1140 | + | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
| |||
Lines changed: 2 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
| |||
305 | 302 | | |
306 | 303 | | |
307 | 304 | | |
308 | | - | |
| 305 | + | |
309 | 306 | | |
310 | 307 | | |
311 | 308 | | |
312 | 309 | | |
313 | 310 | | |
314 | | - | |
| 311 | + | |
315 | 312 | | |
316 | 313 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2207 | 2207 | | |
2208 | 2208 | | |
2209 | 2209 | | |
2210 | | - | |
| 2210 | + | |
2211 | 2211 | | |
2212 | 2212 | | |
2213 | 2213 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | | - | |
| 763 | + | |
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
| 455 | + | |
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
194 | | - | |
| 194 | + | |
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| |||
0 commit comments