|
976 | 976 | {
|
977 | 977 | "include": "#container"
|
978 | 978 | },
|
| 979 | + { |
| 980 | + "include": "#result-base" |
| 981 | + }, |
979 | 982 | {
|
980 | 983 | "include": "#identifier"
|
981 | 984 | }
|
|
1032 | 1035 | }
|
1033 | 1036 | ]
|
1034 | 1037 | },
|
| 1038 | + "result-base": { |
| 1039 | + "name": "entity.name.type.result.wit", |
| 1040 | + "comment": "Syntax for result types where both the `ok` and `err` types are `_`. This pattern must be placed after the #container pattern to correctly capture `result<...>`.", |
| 1041 | + "match": "\\b(result)\\b" |
| 1042 | + }, |
1035 | 1043 | "tuple": {
|
1036 | 1044 | "name": "meta.tuple.ty.wit",
|
1037 | 1045 | "comment": "Syntax for WIT types such as tuple",
|
|
1135 | 1143 | "result": {
|
1136 | 1144 | "name": "meta.result.ty.wit",
|
1137 | 1145 | "comment": "Syntax for WIT types such as result",
|
1138 |
| - "begin": "\\b(result)\\b", |
| 1146 | + "begin": "\\b(result)\\b(\\<)", |
1139 | 1147 | "beginCaptures": {
|
1140 | 1148 | "1": {
|
1141 | 1149 | "name": "entity.name.type.result.wit"
|
|
1149 | 1157 | "include": "#comment"
|
1150 | 1158 | },
|
1151 | 1159 | {
|
1152 |
| - "name": "meta.inner.result.wit", |
1153 |
| - "begin": "(\\<)", |
1154 |
| - "beginCaptures": { |
1155 |
| - "1": { |
1156 |
| - "name": "punctuation.brackets.angle.begin.wit" |
1157 |
| - } |
1158 |
| - }, |
1159 |
| - "patterns": [ |
1160 |
| - { |
1161 |
| - "include": "#comment" |
1162 |
| - }, |
1163 |
| - { |
1164 |
| - "name": "variable.other.inferred-type.result.wit", |
1165 |
| - "match": "(?<!\\w)(\\_)(?!\\w)" |
1166 |
| - }, |
1167 |
| - { |
1168 |
| - "name": "meta.types.result.wit", |
1169 |
| - "include": "#types" |
1170 |
| - }, |
1171 |
| - { |
1172 |
| - "name": "punctuation.comma.wit", |
1173 |
| - "match": "(?<!result)\\s*(\\,)" |
1174 |
| - }, |
1175 |
| - { |
1176 |
| - "include": "#whitespace" |
1177 |
| - } |
1178 |
| - ], |
1179 |
| - "end": "(\\>)", |
1180 |
| - "applyEndPatternLast": 1, |
1181 |
| - "endCaptures": { |
1182 |
| - "1": { |
1183 |
| - "name": "punctuation.brackets.angle.end.wit" |
1184 |
| - } |
1185 |
| - } |
| 1160 | + "name": "variable.other.inferred-type.result.wit", |
| 1161 | + "match": "(?<!\\w)(\\_)(?!\\w)" |
| 1162 | + }, |
| 1163 | + { |
| 1164 | + "name": "meta.types.list.wit", |
| 1165 | + "include": "#types" |
| 1166 | + }, |
| 1167 | + { |
| 1168 | + "name": "punctuation.comma.wit", |
| 1169 | + "match": "(?<!result)\\s*(\\,)" |
1186 | 1170 | },
|
1187 | 1171 | {
|
1188 | 1172 | "include": "#whitespace"
|
1189 | 1173 | }
|
1190 | 1174 | ],
|
1191 |
| - "end": "((?<=\\n)|(?=\\,)|(?=\\}))", |
1192 |
| - "applyEndPatternLast": 1 |
| 1175 | + "end": "(\\>)", |
| 1176 | + "applyEndPatternLast": 1, |
| 1177 | + "endCaptures": { |
| 1178 | + "1": { |
| 1179 | + "name": "punctuation.brackets.angle.end.wit" |
| 1180 | + } |
| 1181 | + } |
1193 | 1182 | },
|
1194 | 1183 | "handle": {
|
1195 | 1184 | "name": "meta.handle.ty.wit",
|
|
0 commit comments