Skip to content

Commit 543d8d8

Browse files
authored
Minor meta mode fixes. (#987)
1 parent 183ac75 commit 543d8d8

2 files changed

Lines changed: 32 additions & 27 deletions

File tree

protocol/metaModel.json

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9950,10 +9950,6 @@
99509950
"documentation": "Options for notifications/requests for user operations on files.\n\n@since 3.16.0",
99519951
"since": "3.16.0"
99529952
},
9953-
{
9954-
"name": "T",
9955-
"properties": []
9956-
},
99579953
{
99589954
"name": "CodeDescription",
99599955
"properties": [
@@ -12684,7 +12680,7 @@
1268412680
{
1268512681
"name": "serverErrorStart",
1268612682
"value": -32099,
12687-
"documentation": "@deprecated use jsonrpcReservedErrorRangeStart */"
12683+
"documentation": "@deprecated use jsonrpcReservedErrorRangeStart"
1268812684
},
1268912685
{
1269012686
"name": "ServerNotInitialized",
@@ -12704,7 +12700,7 @@
1270412700
{
1270512701
"name": "serverErrorEnd",
1270612702
"value": -32000,
12707-
"documentation": "@deprecated use jsonrpcReservedErrorRangeEnd */"
12703+
"documentation": "@deprecated use jsonrpcReservedErrorRangeEnd"
1270812704
}
1270912705
],
1271012706
"supportsCustomValues": true,
@@ -14100,7 +14096,7 @@
1410014096
"kind": "base",
1410114097
"name": "string"
1410214098
},
14103-
"documentation": "A language id, like `typescript`. */"
14099+
"documentation": "A language id, like `typescript`."
1410414100
},
1410514101
{
1410614102
"name": "scheme",
@@ -14109,7 +14105,7 @@
1410914105
"name": "string"
1411014106
},
1411114107
"optional": true,
14112-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */"
14108+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1411314109
},
1411414110
{
1411514111
"name": "pattern",
@@ -14118,7 +14114,7 @@
1411814114
"name": "string"
1411914115
},
1412014116
"optional": true,
14121-
"documentation": "A glob pattern, like `*.{ts,js}`. */"
14117+
"documentation": "A glob pattern, like `*.{ts,js}`."
1412214118
}
1412314119
]
1412414120
}
@@ -14134,15 +14130,15 @@
1413414130
"name": "string"
1413514131
},
1413614132
"optional": true,
14137-
"documentation": "A language id, like `typescript`. */"
14133+
"documentation": "A language id, like `typescript`."
1413814134
},
1413914135
{
1414014136
"name": "scheme",
1414114137
"type": {
1414214138
"kind": "base",
1414314139
"name": "string"
1414414140
},
14145-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */"
14141+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1414614142
},
1414714143
{
1414814144
"name": "pattern",
@@ -14151,7 +14147,7 @@
1415114147
"name": "string"
1415214148
},
1415314149
"optional": true,
14154-
"documentation": "A glob pattern, like `*.{ts,js}`. */"
14150+
"documentation": "A glob pattern, like `*.{ts,js}`."
1415514151
}
1415614152
]
1415714153
}
@@ -14167,7 +14163,7 @@
1416714163
"name": "string"
1416814164
},
1416914165
"optional": true,
14170-
"documentation": "A language id, like `typescript`. */"
14166+
"documentation": "A language id, like `typescript`."
1417114167
},
1417214168
{
1417314169
"name": "scheme",
@@ -14176,15 +14172,15 @@
1417614172
"name": "string"
1417714173
},
1417814174
"optional": true,
14179-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */"
14175+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1418014176
},
1418114177
{
1418214178
"name": "pattern",
1418314179
"type": {
1418414180
"kind": "base",
1418514181
"name": "string"
1418614182
},
14187-
"documentation": "A glob pattern, like `*.{ts,js}`. */"
14183+
"documentation": "A glob pattern, like `*.{ts,js}`."
1418814184
}
1418914185
]
1419014186
}
@@ -14209,7 +14205,7 @@
1420914205
"kind": "base",
1421014206
"name": "string"
1421114207
},
14212-
"documentation": "The type of the enclosing notebook. */"
14208+
"documentation": "The type of the enclosing notebook."
1421314209
},
1421414210
{
1421514211
"name": "scheme",
@@ -14218,7 +14214,7 @@
1421814214
"name": "string"
1421914215
},
1422014216
"optional": true,
14221-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */"
14217+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1422214218
},
1422314219
{
1422414220
"name": "pattern",
@@ -14227,7 +14223,7 @@
1422714223
"name": "string"
1422814224
},
1422914225
"optional": true,
14230-
"documentation": "A glob pattern. */"
14226+
"documentation": "A glob pattern."
1423114227
}
1423214228
]
1423314229
}
@@ -14243,15 +14239,15 @@
1424314239
"name": "string"
1424414240
},
1424514241
"optional": true,
14246-
"documentation": "The type of the enclosing notebook. */"
14242+
"documentation": "The type of the enclosing notebook."
1424714243
},
1424814244
{
1424914245
"name": "scheme",
1425014246
"type": {
1425114247
"kind": "base",
1425214248
"name": "string"
1425314249
},
14254-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`.*/"
14250+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1425514251
},
1425614252
{
1425714253
"name": "pattern",
@@ -14260,7 +14256,7 @@
1426014256
"name": "string"
1426114257
},
1426214258
"optional": true,
14263-
"documentation": "A glob pattern. */"
14259+
"documentation": "A glob pattern."
1426414260
}
1426514261
]
1426614262
}
@@ -14276,7 +14272,7 @@
1427614272
"name": "string"
1427714273
},
1427814274
"optional": true,
14279-
"documentation": "The type of the enclosing notebook. */"
14275+
"documentation": "The type of the enclosing notebook."
1428014276
},
1428114277
{
1428214278
"name": "scheme",
@@ -14285,15 +14281,15 @@
1428514281
"name": "string"
1428614282
},
1428714283
"optional": true,
14288-
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`. */"
14284+
"documentation": "A Uri [scheme](#Uri.scheme), like `file` or `untitled`."
1428914285
},
1429014286
{
1429114287
"name": "pattern",
1429214288
"type": {
1429314289
"kind": "base",
1429414290
"name": "string"
1429514291
},
14296-
"documentation": "A glob pattern. */"
14292+
"documentation": "A glob pattern."
1429714293
}
1429814294
]
1429914295
}

tools/src/visitor.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -949,15 +949,18 @@ export default class Visitor {
949949
throw new Error(`Can't parse property ${member.getName()} of structure ${symbol.getName()}`);
950950
}
951951

952-
const property: Property = (result.name === 'ServerCapabilities' && member.getName() === 'experimental' && typeInfo.kind === 'reference' && typeInfo.name === 'T')
952+
const isExperimentalProperty = (result.name === 'ServerCapabilities' && member.getName() === 'experimental' && typeInfo.kind === 'reference' && typeInfo.name === 'T');
953+
const property: Property = isExperimentalProperty
953954
? { name: member.getName(), type: TypeInfo.asJsonType({ kind: 'reference', name: 'LSPAny', symbol: typeInfo.symbol }) }
954955
: { name: member.getName(), type: TypeInfo.asJsonType(typeInfo) };
955956
if (Symbols.isOptional(member)) {
956957
property.optional = true;
957958
}
958959
this.fillDocProperties(declaration, property);
959960
result.properties.push(property);
960-
this.queueTypeInfo(typeInfo);
961+
if (!isExperimentalProperty) {
962+
this.queueTypeInfo(typeInfo);
963+
}
961964
});
962965
}
963966

@@ -1094,7 +1097,13 @@ export default class Visitor {
10941097
const buffer: string[] = [];
10951098
const lines = text.split(/\r?\n/);
10961099
for (let i= 0; i < lines.length; i++) {
1097-
let noComment = lines[i].replace(/^(\s*\/\*\*)|^(\s*\*\/)|^(\s*\*)/, '');
1100+
let noComment = lines[i].replace(/^\s*\/\*\*(.*)\s*\*\/\s*$|^(\s*\/\*\*)|^(\s*\*\/\s*)$|^(\s*\*)/, (_match, m1) => {
1101+
if (m1) {
1102+
return m1;
1103+
} else {
1104+
return '';
1105+
}
1106+
});
10981107
// First line
10991108
if (i === 0 || i === lines.length - 1) {
11001109
noComment = noComment.trim();

0 commit comments

Comments
 (0)