Commit bb9fc37
authored
Remove syntax annotations from the Razor compiler (#12345)
> [!TIP]
> I recommend reviewing this PR commit-by-commit. Each commit represents
a distinct change.
Syntax annotations were originally added to Roslyn's syntax model to
support the IDE. When writing IDE code, it can be very useful to mark a
node, perform a tree transformation, and then use the annotation to get
back to that node. However, the Razor tooling layer doesn't perform tree
transformations in that way. In fact, the only uses of syntax
annotations are in the compiler itself where annotations are used to
tuck compiler data onto nodes. This results in a lot of overhead for a
handful of data properties that can just be part of the syntax model.
This change does exactly that. It takes compiler data stored as
annotations -- `SpanEditHandler`, `IsMarkupTransition`,
`DirectiveDescriptor`, `TagHelperInfo`, and `TagHelperAttributeInfo` --
and moves that data onto the syntax model. With that complete, syntax
annotations are pure overhead and can be deleted completely.
----
CI Build:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2818010&view=results
Test Insertion:
https://dev.azure.com/devdiv/DevDiv/_git/VS/pullrequest/680258
Toolset Run:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2818016&view=resultsFile tree
82 files changed
+1303
-1779
lines changed- src
- Compiler
- Microsoft.AspNetCore.Razor.Language
- legacyTest/Legacy
- test
- Legacy
- Syntax
- Microsoft.CodeAnalysis.Razor.Compiler/src/Language
- Legacy
- Syntax
- Syntax
- Generated
- InternalSyntax
- tools/RazorSyntaxGenerator
- Razor
- src
- Microsoft.CodeAnalysis.Razor.Workspaces
- CodeActions
- CSharp
- Razor
- DocumentMapping
- Extensions
- FoldingRanges
- Formatting
- Passes
- Microsoft.CodeAnalysis.Remote.Razor/InlayHints
- test/Microsoft.VisualStudio.LegacyEditor.Razor.Test/Indentation
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
82 files changed
+1303
-1779
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
| 455 | + | |
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
293 | 292 | | |
294 | | - | |
| 293 | + | |
295 | 294 | | |
296 | 295 | | |
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
Lines changed: 24 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
595 | 595 | | |
596 | 596 | | |
597 | 597 | | |
598 | | - | |
| 598 | + | |
| 599 | + | |
599 | 600 | | |
600 | 601 | | |
601 | | - | |
| 602 | + | |
602 | 603 | | |
603 | | - | |
| 604 | + | |
604 | 605 | | |
605 | 606 | | |
606 | 607 | | |
| |||
633 | 634 | | |
634 | 635 | | |
635 | 636 | | |
636 | | - | |
| 637 | + | |
| 638 | + | |
637 | 639 | | |
638 | 640 | | |
639 | 641 | | |
| |||
658 | 660 | | |
659 | 661 | | |
660 | 662 | | |
661 | | - | |
| 663 | + | |
662 | 664 | | |
663 | 665 | | |
664 | 666 | | |
665 | 667 | | |
666 | 668 | | |
667 | 669 | | |
668 | | - | |
| 670 | + | |
669 | 671 | | |
670 | 672 | | |
671 | 673 | | |
| |||
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
707 | | - | |
| 709 | + | |
708 | 710 | | |
709 | 711 | | |
710 | 712 | | |
| |||
889 | 891 | | |
890 | 892 | | |
891 | 893 | | |
892 | | - | |
| 894 | + | |
893 | 895 | | |
894 | 896 | | |
895 | 897 | | |
| |||
1184 | 1186 | | |
1185 | 1187 | | |
1186 | 1188 | | |
1187 | | - | |
| 1189 | + | |
1188 | 1190 | | |
1189 | 1191 | | |
1190 | 1192 | | |
| |||
1196 | 1198 | | |
1197 | 1199 | | |
1198 | 1200 | | |
1199 | | - | |
| 1201 | + | |
1200 | 1202 | | |
1201 | 1203 | | |
1202 | 1204 | | |
| |||
1208 | 1210 | | |
1209 | 1211 | | |
1210 | 1212 | | |
1211 | | - | |
| 1213 | + | |
1212 | 1214 | | |
1213 | 1215 | | |
1214 | 1216 | | |
1215 | | - | |
1216 | | - | |
| 1217 | + | |
1217 | 1218 | | |
1218 | 1219 | | |
1219 | 1220 | | |
| |||
1380 | 1381 | | |
1381 | 1382 | | |
1382 | 1383 | | |
1383 | | - | |
| 1384 | + | |
| 1385 | + | |
1384 | 1386 | | |
1385 | 1387 | | |
1386 | 1388 | | |
| |||
1402 | 1404 | | |
1403 | 1405 | | |
1404 | 1406 | | |
1405 | | - | |
| 1407 | + | |
| 1408 | + | |
1406 | 1409 | | |
1407 | 1410 | | |
1408 | 1411 | | |
| |||
1492 | 1495 | | |
1493 | 1496 | | |
1494 | 1497 | | |
1495 | | - | |
| 1498 | + | |
1496 | 1499 | | |
1497 | 1500 | | |
1498 | 1501 | | |
| |||
1699 | 1702 | | |
1700 | 1703 | | |
1701 | 1704 | | |
1702 | | - | |
| 1705 | + | |
1703 | 1706 | | |
1704 | 1707 | | |
1705 | 1708 | | |
| |||
2047 | 2050 | | |
2048 | 2051 | | |
2049 | 2052 | | |
2050 | | - | |
| 2053 | + | |
2051 | 2054 | | |
2052 | 2055 | | |
2053 | 2056 | | |
| |||
2059 | 2062 | | |
2060 | 2063 | | |
2061 | 2064 | | |
2062 | | - | |
| 2065 | + | |
2063 | 2066 | | |
2064 | 2067 | | |
2065 | 2068 | | |
| |||
2071 | 2074 | | |
2072 | 2075 | | |
2073 | 2076 | | |
2074 | | - | |
| 2077 | + | |
2075 | 2078 | | |
2076 | 2079 | | |
2077 | 2080 | | |
2078 | | - | |
2079 | | - | |
2080 | | - | |
2081 | | - | |
2082 | | - | |
2083 | | - | |
| 2081 | + | |
2084 | 2082 | | |
2085 | 2083 | | |
2086 | 2084 | | |
| |||
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
| |||
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
1896 | | - | |
| 1896 | + | |
1897 | 1897 | | |
| 1898 | + | |
1898 | 1899 | | |
1899 | 1900 | | |
1900 | 1901 | | |
1901 | 1902 | | |
1902 | | - | |
| 1903 | + | |
1903 | 1904 | | |
1904 | 1905 | | |
1905 | 1906 | | |
1906 | | - | |
1907 | 1907 | | |
1908 | 1908 | | |
1909 | 1909 | | |
| |||
2709 | 2709 | | |
2710 | 2710 | | |
2711 | 2711 | | |
2712 | | - | |
| 2712 | + | |
2713 | 2713 | | |
2714 | 2714 | | |
2715 | 2715 | | |
| |||
2811 | 2811 | | |
2812 | 2812 | | |
2813 | 2813 | | |
2814 | | - | |
| 2814 | + | |
2815 | 2815 | | |
2816 | 2816 | | |
2817 | 2817 | | |
| |||
2822 | 2822 | | |
2823 | 2823 | | |
2824 | 2824 | | |
2825 | | - | |
| 2825 | + | |
2826 | 2826 | | |
2827 | 2827 | | |
2828 | 2828 | | |
| |||
2833 | 2833 | | |
2834 | 2834 | | |
2835 | 2835 | | |
2836 | | - | |
| 2836 | + | |
2837 | 2837 | | |
2838 | 2838 | | |
2839 | 2839 | | |
| |||
2844 | 2844 | | |
2845 | 2845 | | |
2846 | 2846 | | |
2847 | | - | |
| 2847 | + | |
2848 | 2848 | | |
2849 | 2849 | | |
2850 | 2850 | | |
| |||
0 commit comments