Commit 9e7b49d
committed
fix: Separate rules for
fix #35
This commit separates the syntax highlighting rules for `result` types with angle brackets (`result<...>`) and `result` types without type parameters.
Previously, both types were handled in a single rule, `meta.result.ty.wit`, which ended at a newline (technically "after"), comma, or closing bracket.
However, if a `result` type appeared as a parameter, the scope wouldn't end until one of these conditions was met.
(As observed, the scope didn’t end even when a newline was encountered, likely because it was captured by other rules, though...).
This change simplifies the `meta.result.ty.wit` scope by splitting the handling of `result<...>` and `result`.
Now, `result<...>` is handled similarly to `list<...>` and `tuple<...>`, while `result` without `<...>` is handled by `result-base`, which marks the `result` keyword as `entity.name.type.result.wit`.
As a consequence of this change, line comments on `result<xxx> // comment` will no longer be ignored. However, this is a known issue for other types as well.result keyword with and without <>1 parent e4c1ca6 commit 9e7b49d
File tree
15 files changed
+577
-499
lines changed- syntaxes
- tests/grammar
- integration
- unit
15 files changed
+577
-499
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
976 | 976 | | |
977 | 977 | | |
978 | 978 | | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
979 | 982 | | |
980 | 983 | | |
981 | 984 | | |
| |||
1032 | 1035 | | |
1033 | 1036 | | |
1034 | 1037 | | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
1035 | 1043 | | |
1036 | 1044 | | |
1037 | 1045 | | |
| |||
1135 | 1143 | | |
1136 | 1144 | | |
1137 | 1145 | | |
1138 | | - | |
| 1146 | + | |
1139 | 1147 | | |
1140 | 1148 | | |
1141 | 1149 | | |
| |||
1149 | 1157 | | |
1150 | 1158 | | |
1151 | 1159 | | |
1152 | | - | |
1153 | | - | |
1154 | | - | |
1155 | | - | |
1156 | | - | |
1157 | | - | |
1158 | | - | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
1163 | | - | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1186 | 1170 | | |
1187 | 1171 | | |
1188 | 1172 | | |
1189 | 1173 | | |
1190 | 1174 | | |
1191 | | - | |
1192 | | - | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1193 | 1182 | | |
1194 | 1183 | | |
1195 | 1184 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
0 commit comments