@volar/monaco 1.11.0 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.d.ts +2 -3
- package/index.js +2 -18
- package/lib/editor.d.ts +3 -6
- package/lib/editor.js +129 -142
- package/lib/languages.d.ts +2 -9
- package/lib/languages.js +31 -42
- package/lib/markers.d.ts +3 -0
- package/lib/markers.js +2 -0
- package/lib/{utils/provider.d.ts → provider.d.ts} +1 -2
- package/lib/{utils/provider.js → provider.js} +65 -68
- package/package.json +8 -5
- package/worker.d.ts +117 -7
- package/worker.js +97 -63
- package/lib/utils/markers.d.ts +0 -4
- package/lib/utils/markers.js +0 -5
- package/lib/utils/monaco2protocol.d.ts +0 -14
- package/lib/utils/monaco2protocol.js +0 -100
- package/lib/utils/protocol2monaco.d.ts +0 -39
- package/lib/utils/protocol2monaco.js +0 -498
|
@@ -1,498 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.asPosition = exports.asInlayHintLabelPart = exports.asInlayHintLabel = exports.asInlayHintKind = exports.asInlayHint = exports.asSelectionRange = exports.asFoldingRange = exports.asColorPresentation = exports.asColorInformation = exports.asLink = exports.asCodeAction = exports.asCodeLens = exports.asDocumentHighlightKind = exports.asDocumentHighlight = exports.asSymbolKind = exports.asSymbolTag = exports.asDocumentSymbol = exports.asWorkspaceEdit = exports.asMarkerSeverity = exports.asRelatedInformation = exports.asMarkerTag = exports.asMarkerData = exports.asParameterInformation = exports.asSignatureInformation = exports.asSignatureHelp = exports.asUri = exports.asLocation = exports.asMarkdownString = exports.asHover = exports.asRange = exports.asCompletionItemRange = exports.asTextEdit = exports.asCommand = exports.asCompletionItem = exports.asCompletionItemKind = exports.asCompletionList = void 0;
|
|
4
|
-
const vscode_uri_1 = require("vscode-uri");
|
|
5
|
-
function asCompletionList(list, range) {
|
|
6
|
-
return {
|
|
7
|
-
incomplete: list.isIncomplete,
|
|
8
|
-
suggestions: list.items.map(item => asCompletionItem(item, range)),
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
exports.asCompletionList = asCompletionList;
|
|
12
|
-
function asCompletionItemKind(kind) {
|
|
13
|
-
switch (kind) {
|
|
14
|
-
case 2:
|
|
15
|
-
return 0;
|
|
16
|
-
case 3:
|
|
17
|
-
return 1;
|
|
18
|
-
case 4:
|
|
19
|
-
return 2;
|
|
20
|
-
case 5:
|
|
21
|
-
return 3;
|
|
22
|
-
case 6:
|
|
23
|
-
return 4;
|
|
24
|
-
case 7:
|
|
25
|
-
return 5;
|
|
26
|
-
case 8:
|
|
27
|
-
return 7;
|
|
28
|
-
case 9:
|
|
29
|
-
return 8;
|
|
30
|
-
case 10:
|
|
31
|
-
return 9;
|
|
32
|
-
case 11:
|
|
33
|
-
return 12;
|
|
34
|
-
case 12:
|
|
35
|
-
return 13;
|
|
36
|
-
case 13:
|
|
37
|
-
return 15;
|
|
38
|
-
case 14:
|
|
39
|
-
return 17;
|
|
40
|
-
case 15:
|
|
41
|
-
return 27;
|
|
42
|
-
case 1:
|
|
43
|
-
return 18;
|
|
44
|
-
case 16:
|
|
45
|
-
return 19;
|
|
46
|
-
case 17:
|
|
47
|
-
return 20;
|
|
48
|
-
case 18:
|
|
49
|
-
return 21;
|
|
50
|
-
case 19:
|
|
51
|
-
return 23;
|
|
52
|
-
case 20:
|
|
53
|
-
return 16;
|
|
54
|
-
case 21:
|
|
55
|
-
return 14;
|
|
56
|
-
case 22:
|
|
57
|
-
return 6;
|
|
58
|
-
case 23:
|
|
59
|
-
return 10;
|
|
60
|
-
case 24:
|
|
61
|
-
return 11;
|
|
62
|
-
case 25:
|
|
63
|
-
return 24;
|
|
64
|
-
default:
|
|
65
|
-
return 18;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.asCompletionItemKind = asCompletionItemKind;
|
|
69
|
-
function asCompletionItem(item, range) {
|
|
70
|
-
return {
|
|
71
|
-
label: item.label,
|
|
72
|
-
kind: asCompletionItemKind(item.kind),
|
|
73
|
-
tags: item.tags,
|
|
74
|
-
detail: item.detail,
|
|
75
|
-
documentation: item.documentation,
|
|
76
|
-
sortText: item.sortText,
|
|
77
|
-
filterText: item.filterText,
|
|
78
|
-
preselect: item.preselect,
|
|
79
|
-
insertText: item.textEdit?.newText ?? item.insertText ?? item.label,
|
|
80
|
-
insertTextRules: 0,
|
|
81
|
-
range: item.textEdit ? asCompletionItemRange(item.textEdit) : asRange(range),
|
|
82
|
-
commitCharacters: item.commitCharacters,
|
|
83
|
-
additionalTextEdits: item.additionalTextEdits?.map(asTextEdit),
|
|
84
|
-
command: item.command ? asCommand(item.command) : undefined,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
exports.asCompletionItem = asCompletionItem;
|
|
88
|
-
function asCommand(command) {
|
|
89
|
-
return {
|
|
90
|
-
id: command.command,
|
|
91
|
-
title: command.title,
|
|
92
|
-
arguments: command.arguments,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
exports.asCommand = asCommand;
|
|
96
|
-
function asTextEdit(edit) {
|
|
97
|
-
return {
|
|
98
|
-
range: asRange(edit.range),
|
|
99
|
-
text: edit.newText,
|
|
100
|
-
};
|
|
101
|
-
}
|
|
102
|
-
exports.asTextEdit = asTextEdit;
|
|
103
|
-
function asCompletionItemRange(textEdit) {
|
|
104
|
-
if ('insert' in textEdit && 'replace' in textEdit) {
|
|
105
|
-
const result = {
|
|
106
|
-
insert: asRange(textEdit.insert),
|
|
107
|
-
replace: asRange(textEdit.replace),
|
|
108
|
-
};
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
return asRange(textEdit.range);
|
|
112
|
-
}
|
|
113
|
-
exports.asCompletionItemRange = asCompletionItemRange;
|
|
114
|
-
function asRange(range) {
|
|
115
|
-
return {
|
|
116
|
-
startLineNumber: range.start.line + 1,
|
|
117
|
-
startColumn: range.start.character + 1,
|
|
118
|
-
endLineNumber: range.end.line + 1,
|
|
119
|
-
endColumn: range.end.character + 1,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
exports.asRange = asRange;
|
|
123
|
-
function asHover(hover) {
|
|
124
|
-
return {
|
|
125
|
-
contents: asMarkdownString(hover.contents),
|
|
126
|
-
range: hover.range ? asRange(hover.range) : undefined,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
exports.asHover = asHover;
|
|
130
|
-
function asMarkdownString(markdownString) {
|
|
131
|
-
if (typeof markdownString === 'string') {
|
|
132
|
-
return [{ value: markdownString }];
|
|
133
|
-
}
|
|
134
|
-
else if (Array.isArray(markdownString)) {
|
|
135
|
-
return markdownString.map(asMarkdownString).flat();
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
return [markdownString];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
exports.asMarkdownString = asMarkdownString;
|
|
142
|
-
function asLocation(definition) {
|
|
143
|
-
if ('targetUri' in definition && 'targetSelectionRange' in definition) {
|
|
144
|
-
return {
|
|
145
|
-
uri: asUri(definition.targetUri),
|
|
146
|
-
range: asRange(definition.targetSelectionRange),
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
return {
|
|
151
|
-
uri: asUri(definition.uri),
|
|
152
|
-
range: asRange(definition.range),
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
exports.asLocation = asLocation;
|
|
157
|
-
function asUri(uri) {
|
|
158
|
-
return vscode_uri_1.URI.parse(uri);
|
|
159
|
-
}
|
|
160
|
-
exports.asUri = asUri;
|
|
161
|
-
function asSignatureHelp(signatureHelp) {
|
|
162
|
-
return {
|
|
163
|
-
signatures: signatureHelp.signatures.map(asSignatureInformation),
|
|
164
|
-
activeSignature: signatureHelp.activeSignature ?? 0,
|
|
165
|
-
activeParameter: signatureHelp.activeParameter ?? 0,
|
|
166
|
-
};
|
|
167
|
-
}
|
|
168
|
-
exports.asSignatureHelp = asSignatureHelp;
|
|
169
|
-
function asSignatureInformation(signatureInformation) {
|
|
170
|
-
return {
|
|
171
|
-
label: signatureInformation.label,
|
|
172
|
-
documentation: signatureInformation.documentation,
|
|
173
|
-
parameters: signatureInformation.parameters
|
|
174
|
-
? signatureInformation.parameters.map(asParameterInformation)
|
|
175
|
-
: [],
|
|
176
|
-
activeParameter: signatureInformation.activeParameter,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
exports.asSignatureInformation = asSignatureInformation;
|
|
180
|
-
function asParameterInformation(parameterInformation) {
|
|
181
|
-
return {
|
|
182
|
-
label: parameterInformation.label,
|
|
183
|
-
documentation: parameterInformation.documentation,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
exports.asParameterInformation = asParameterInformation;
|
|
187
|
-
function asMarkerData(diagnostic) {
|
|
188
|
-
return {
|
|
189
|
-
code: diagnostic.code?.toString(),
|
|
190
|
-
severity: asMarkerSeverity(diagnostic.severity),
|
|
191
|
-
message: diagnostic.message,
|
|
192
|
-
source: diagnostic.source,
|
|
193
|
-
...asRange(diagnostic.range),
|
|
194
|
-
relatedInformation: diagnostic.relatedInformation?.map(asRelatedInformation),
|
|
195
|
-
tags: diagnostic.tags?.map(asMarkerTag),
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
exports.asMarkerData = asMarkerData;
|
|
199
|
-
function asMarkerTag(tag) {
|
|
200
|
-
switch (tag) {
|
|
201
|
-
case 1:
|
|
202
|
-
return 1;
|
|
203
|
-
case 2:
|
|
204
|
-
return 2;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
exports.asMarkerTag = asMarkerTag;
|
|
208
|
-
function asRelatedInformation(relatedInformation) {
|
|
209
|
-
return {
|
|
210
|
-
resource: asUri(relatedInformation.location.uri),
|
|
211
|
-
message: relatedInformation.message,
|
|
212
|
-
...asRange(relatedInformation.location.range),
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
exports.asRelatedInformation = asRelatedInformation;
|
|
216
|
-
function asMarkerSeverity(severity) {
|
|
217
|
-
switch (severity) {
|
|
218
|
-
case 1:
|
|
219
|
-
return 8;
|
|
220
|
-
case 2:
|
|
221
|
-
return 4;
|
|
222
|
-
case 3:
|
|
223
|
-
return 2;
|
|
224
|
-
case 4:
|
|
225
|
-
return 1;
|
|
226
|
-
default:
|
|
227
|
-
return 2;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
exports.asMarkerSeverity = asMarkerSeverity;
|
|
231
|
-
function asWorkspaceEdit(workspaceEdit) {
|
|
232
|
-
const result = {
|
|
233
|
-
edits: [],
|
|
234
|
-
};
|
|
235
|
-
if (workspaceEdit.changes) {
|
|
236
|
-
for (const uri in workspaceEdit.changes) {
|
|
237
|
-
const edits = workspaceEdit.changes[uri];
|
|
238
|
-
for (const edit of edits) {
|
|
239
|
-
result.edits.push({
|
|
240
|
-
resource: asUri(uri),
|
|
241
|
-
textEdit: asTextEdit(edit),
|
|
242
|
-
versionId: undefined,
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
if (workspaceEdit.documentChanges) {
|
|
248
|
-
for (const documentChange of workspaceEdit.documentChanges) {
|
|
249
|
-
if ('edits' in documentChange) {
|
|
250
|
-
for (const edit of documentChange.edits) {
|
|
251
|
-
result.edits.push({
|
|
252
|
-
resource: asUri(documentChange.textDocument.uri),
|
|
253
|
-
textEdit: asTextEdit(edit),
|
|
254
|
-
versionId: documentChange.textDocument.version ?? undefined,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
else if (documentChange.kind === 'create') {
|
|
259
|
-
result.edits.push({
|
|
260
|
-
newResource: asUri(documentChange.uri),
|
|
261
|
-
options: {
|
|
262
|
-
overwrite: documentChange.options?.overwrite ?? false,
|
|
263
|
-
ignoreIfExists: documentChange.options?.ignoreIfExists ?? false,
|
|
264
|
-
},
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
|
-
else if (documentChange.kind === 'rename') {
|
|
268
|
-
result.edits.push({
|
|
269
|
-
oldResource: asUri(documentChange.oldUri),
|
|
270
|
-
newResource: asUri(documentChange.newUri),
|
|
271
|
-
options: {
|
|
272
|
-
overwrite: documentChange.options?.overwrite ?? false,
|
|
273
|
-
ignoreIfExists: documentChange.options?.ignoreIfExists ?? false,
|
|
274
|
-
},
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
else if (documentChange.kind === 'delete') {
|
|
278
|
-
result.edits.push({
|
|
279
|
-
oldResource: asUri(documentChange.uri),
|
|
280
|
-
options: {
|
|
281
|
-
recursive: documentChange.options?.recursive ?? false,
|
|
282
|
-
ignoreIfNotExists: documentChange.options?.ignoreIfNotExists ?? false,
|
|
283
|
-
},
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return result;
|
|
289
|
-
}
|
|
290
|
-
exports.asWorkspaceEdit = asWorkspaceEdit;
|
|
291
|
-
function asDocumentSymbol(symbol) {
|
|
292
|
-
return {
|
|
293
|
-
name: symbol.name,
|
|
294
|
-
detail: '',
|
|
295
|
-
kind: asSymbolKind(symbol.kind),
|
|
296
|
-
tags: symbol.tags?.map(asSymbolTag) ?? [],
|
|
297
|
-
range: asRange(symbol.range),
|
|
298
|
-
selectionRange: asRange(symbol.selectionRange),
|
|
299
|
-
children: symbol.children
|
|
300
|
-
? symbol.children.map(asDocumentSymbol)
|
|
301
|
-
: undefined,
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
exports.asDocumentSymbol = asDocumentSymbol;
|
|
305
|
-
function asSymbolTag(tag) {
|
|
306
|
-
switch (tag) {
|
|
307
|
-
case 1:
|
|
308
|
-
return 1;
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
exports.asSymbolTag = asSymbolTag;
|
|
312
|
-
function asSymbolKind(kind) {
|
|
313
|
-
switch (kind) {
|
|
314
|
-
case 1:
|
|
315
|
-
return 0;
|
|
316
|
-
case 2:
|
|
317
|
-
return 1;
|
|
318
|
-
case 3:
|
|
319
|
-
return 2;
|
|
320
|
-
case 4:
|
|
321
|
-
return 3;
|
|
322
|
-
case 5:
|
|
323
|
-
return 4;
|
|
324
|
-
case 6:
|
|
325
|
-
return 5;
|
|
326
|
-
case 7:
|
|
327
|
-
return 6;
|
|
328
|
-
case 8:
|
|
329
|
-
return 7;
|
|
330
|
-
case 9:
|
|
331
|
-
return 8;
|
|
332
|
-
case 10:
|
|
333
|
-
return 9;
|
|
334
|
-
case 11:
|
|
335
|
-
return 10;
|
|
336
|
-
case 12:
|
|
337
|
-
return 11;
|
|
338
|
-
case 13:
|
|
339
|
-
return 12;
|
|
340
|
-
case 14:
|
|
341
|
-
return 13;
|
|
342
|
-
case 15:
|
|
343
|
-
return 14;
|
|
344
|
-
case 16:
|
|
345
|
-
return 15;
|
|
346
|
-
case 17:
|
|
347
|
-
return 16;
|
|
348
|
-
case 18:
|
|
349
|
-
return 17;
|
|
350
|
-
case 19:
|
|
351
|
-
return 18;
|
|
352
|
-
case 20:
|
|
353
|
-
return 19;
|
|
354
|
-
case 21:
|
|
355
|
-
return 20;
|
|
356
|
-
case 22:
|
|
357
|
-
return 21;
|
|
358
|
-
case 23:
|
|
359
|
-
return 22;
|
|
360
|
-
case 24:
|
|
361
|
-
return 23;
|
|
362
|
-
case 25:
|
|
363
|
-
return 24;
|
|
364
|
-
case 26:
|
|
365
|
-
return 25;
|
|
366
|
-
default:
|
|
367
|
-
return 0;
|
|
368
|
-
}
|
|
369
|
-
}
|
|
370
|
-
exports.asSymbolKind = asSymbolKind;
|
|
371
|
-
function asDocumentHighlight(highlight) {
|
|
372
|
-
return {
|
|
373
|
-
range: asRange(highlight.range),
|
|
374
|
-
kind: asDocumentHighlightKind(highlight.kind),
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
exports.asDocumentHighlight = asDocumentHighlight;
|
|
378
|
-
function asDocumentHighlightKind(kind) {
|
|
379
|
-
switch (kind) {
|
|
380
|
-
case 1:
|
|
381
|
-
return 0;
|
|
382
|
-
case 2:
|
|
383
|
-
return 1;
|
|
384
|
-
case 3:
|
|
385
|
-
return 2;
|
|
386
|
-
default:
|
|
387
|
-
return 0;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
exports.asDocumentHighlightKind = asDocumentHighlightKind;
|
|
391
|
-
function asCodeLens(item) {
|
|
392
|
-
return {
|
|
393
|
-
range: asRange(item.range),
|
|
394
|
-
command: item.command ? asCommand(item.command) : undefined,
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
exports.asCodeLens = asCodeLens;
|
|
398
|
-
function asCodeAction(item) {
|
|
399
|
-
return {
|
|
400
|
-
title: item.title,
|
|
401
|
-
command: item.command ? asCommand(item.command) : undefined,
|
|
402
|
-
edit: item.edit ? asWorkspaceEdit(item.edit) : undefined,
|
|
403
|
-
diagnostics: item.diagnostics
|
|
404
|
-
? item.diagnostics.map(asMarkerData)
|
|
405
|
-
: undefined,
|
|
406
|
-
kind: item.kind,
|
|
407
|
-
isPreferred: item.isPreferred,
|
|
408
|
-
disabled: item.disabled?.reason,
|
|
409
|
-
};
|
|
410
|
-
}
|
|
411
|
-
exports.asCodeAction = asCodeAction;
|
|
412
|
-
function asLink(item) {
|
|
413
|
-
return {
|
|
414
|
-
range: asRange(item.range),
|
|
415
|
-
url: item.target,
|
|
416
|
-
tooltip: item.tooltip,
|
|
417
|
-
};
|
|
418
|
-
}
|
|
419
|
-
exports.asLink = asLink;
|
|
420
|
-
function asColorInformation(item) {
|
|
421
|
-
return {
|
|
422
|
-
range: asRange(item.range),
|
|
423
|
-
color: item.color,
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
exports.asColorInformation = asColorInformation;
|
|
427
|
-
function asColorPresentation(item) {
|
|
428
|
-
return {
|
|
429
|
-
label: item.label,
|
|
430
|
-
textEdit: item.textEdit ? asTextEdit(item.textEdit) : undefined,
|
|
431
|
-
additionalTextEdits: item.additionalTextEdits
|
|
432
|
-
? item.additionalTextEdits.map(asTextEdit)
|
|
433
|
-
: undefined,
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
exports.asColorPresentation = asColorPresentation;
|
|
437
|
-
function asFoldingRange(item) {
|
|
438
|
-
return {
|
|
439
|
-
start: item.startLine + 1,
|
|
440
|
-
end: item.endLine + 1,
|
|
441
|
-
kind: {
|
|
442
|
-
value: item.kind ?? '',
|
|
443
|
-
},
|
|
444
|
-
};
|
|
445
|
-
}
|
|
446
|
-
exports.asFoldingRange = asFoldingRange;
|
|
447
|
-
function asSelectionRange(item) {
|
|
448
|
-
return {
|
|
449
|
-
range: asRange(item.range),
|
|
450
|
-
};
|
|
451
|
-
}
|
|
452
|
-
exports.asSelectionRange = asSelectionRange;
|
|
453
|
-
function asInlayHint(item) {
|
|
454
|
-
return {
|
|
455
|
-
label: asInlayHintLabel(item.label),
|
|
456
|
-
tooltip: item.tooltip,
|
|
457
|
-
position: asPosition(item.position),
|
|
458
|
-
kind: item.kind ? asInlayHintKind(item.kind) : undefined,
|
|
459
|
-
paddingLeft: item.paddingLeft,
|
|
460
|
-
paddingRight: item.paddingRight,
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
exports.asInlayHint = asInlayHint;
|
|
464
|
-
function asInlayHintKind(kind) {
|
|
465
|
-
switch (kind) {
|
|
466
|
-
case 2:
|
|
467
|
-
return 2;
|
|
468
|
-
case 1:
|
|
469
|
-
return 1;
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
exports.asInlayHintKind = asInlayHintKind;
|
|
473
|
-
function asInlayHintLabel(label) {
|
|
474
|
-
if (typeof label === 'string') {
|
|
475
|
-
return label;
|
|
476
|
-
}
|
|
477
|
-
else {
|
|
478
|
-
return label.map(asInlayHintLabelPart);
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
exports.asInlayHintLabel = asInlayHintLabel;
|
|
482
|
-
function asInlayHintLabelPart(part) {
|
|
483
|
-
return {
|
|
484
|
-
label: part.value,
|
|
485
|
-
tooltip: part.tooltip,
|
|
486
|
-
command: part.command ? asCommand(part.command) : undefined,
|
|
487
|
-
location: part.location ? asLocation(part.location) : undefined,
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
exports.asInlayHintLabelPart = asInlayHintLabelPart;
|
|
491
|
-
function asPosition(position) {
|
|
492
|
-
return {
|
|
493
|
-
lineNumber: position.line + 1,
|
|
494
|
-
column: position.character + 1,
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
exports.asPosition = asPosition;
|
|
498
|
-
//# sourceMappingURL=protocol2monaco.js.map
|