@volar/monaco 1.4.0-alpha.1 → 1.4.0-alpha.2
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/out/editor.js +7 -12
- package/out/languages.js +2 -0
- package/out/utils/provider.js +56 -56
- package/package.json +3 -3
package/out/editor.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
2
|
exports.editor = void 0;
|
|
3
|
-
const language_service_1 = require("@volar/language-service");
|
|
4
3
|
const monaco_editor_core_1 = require("monaco-editor-core");
|
|
5
4
|
const markers_1 = require("./utils/markers");
|
|
6
5
|
const protocol2monaco = require("./utils/protocol2monaco");
|
|
@@ -67,12 +66,10 @@ var editor;
|
|
|
67
66
|
}
|
|
68
67
|
const version = model.getVersionId();
|
|
69
68
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
70
|
-
const diagnostics = await languageService.doValidation(model.uri.toString(),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onCancellationRequested: language_service_1.Event.None,
|
|
75
|
-
}, 'all');
|
|
69
|
+
const diagnostics = await languageService.doValidation(model.uri.toString(), 'all');
|
|
70
|
+
if (model.getVersionId() !== version) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
76
73
|
const result = diagnostics.map(error => {
|
|
77
74
|
const marker = protocol2monaco.asMarkerData(error);
|
|
78
75
|
markers_1.markers.set(marker, error);
|
|
@@ -145,12 +142,10 @@ var editor;
|
|
|
145
142
|
text: lastChange.text,
|
|
146
143
|
rangeOffset: lastChange.rangeOffset,
|
|
147
144
|
},
|
|
148
|
-
}, {
|
|
149
|
-
get isCancellationRequested() {
|
|
150
|
-
return model.getVersionId() !== version;
|
|
151
|
-
},
|
|
152
|
-
onCancellationRequested: language_service_1.Event.None,
|
|
153
145
|
});
|
|
146
|
+
if (model.getVersionId() !== version) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
154
149
|
const codeEditor = editor.getEditors().find((e) => e.getModel() === model);
|
|
155
150
|
if (codeEditor && edit && model.getVersionId() === version) {
|
|
156
151
|
if (typeof edit === 'string') {
|
package/out/languages.js
CHANGED
|
@@ -28,6 +28,8 @@ var languages;
|
|
|
28
28
|
languages.registerDeclarationProvider(language, provider),
|
|
29
29
|
languages.registerSelectionRangeProvider(language, provider),
|
|
30
30
|
languages.registerInlayHintsProvider(language, provider),
|
|
31
|
+
languages.registerDocumentSemanticTokensProvider(language, provider),
|
|
32
|
+
languages.registerDocumentRangeSemanticTokensProvider(language, provider),
|
|
31
33
|
];
|
|
32
34
|
return { dispose: () => disposables.forEach((d) => d.dispose()) };
|
|
33
35
|
}
|
package/out/utils/provider.js
CHANGED
|
@@ -18,9 +18,9 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
18
18
|
getLegend() {
|
|
19
19
|
return language_service_1.standardSemanticTokensLegend;
|
|
20
20
|
},
|
|
21
|
-
async provideDocumentSemanticTokens(model, _lastResultId
|
|
21
|
+
async provideDocumentSemanticTokens(model, _lastResultId) {
|
|
22
22
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
23
|
-
const codeResult = await languageService.getSemanticTokens(model.uri.toString(), undefined, language_service_1.standardSemanticTokensLegend
|
|
23
|
+
const codeResult = await languageService.getSemanticTokens(model.uri.toString(), undefined, language_service_1.standardSemanticTokensLegend);
|
|
24
24
|
if (codeResult) {
|
|
25
25
|
return {
|
|
26
26
|
resultId: codeResult.resultId,
|
|
@@ -28,9 +28,9 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
async provideDocumentRangeSemanticTokens(model, range
|
|
31
|
+
async provideDocumentRangeSemanticTokens(model, range) {
|
|
32
32
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
33
|
-
const codeResult = await languageService.getSemanticTokens(model.uri.toString(), monaco2protocol.asRange(range), language_service_1.standardSemanticTokensLegend
|
|
33
|
+
const codeResult = await languageService.getSemanticTokens(model.uri.toString(), monaco2protocol.asRange(range), language_service_1.standardSemanticTokensLegend);
|
|
34
34
|
if (codeResult) {
|
|
35
35
|
return {
|
|
36
36
|
resultId: codeResult.resultId,
|
|
@@ -39,23 +39,23 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
releaseDocumentSemanticTokens() { },
|
|
42
|
-
async provideDocumentSymbols(model
|
|
42
|
+
async provideDocumentSymbols(model) {
|
|
43
43
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
44
|
-
const codeResult = await languageService.findDocumentSymbols(model.uri.toString()
|
|
44
|
+
const codeResult = await languageService.findDocumentSymbols(model.uri.toString());
|
|
45
45
|
if (codeResult) {
|
|
46
46
|
return codeResult.map(protocol2monaco.asDocumentSymbol);
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
async provideDocumentHighlights(model, position
|
|
49
|
+
async provideDocumentHighlights(model, position) {
|
|
50
50
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
51
|
-
const codeResult = await languageService.findDocumentHighlights(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
51
|
+
const codeResult = await languageService.findDocumentHighlights(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
52
52
|
if (codeResult) {
|
|
53
53
|
return codeResult.map(protocol2monaco.asDocumentHighlight);
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
async provideLinkedEditingRanges(model, position
|
|
56
|
+
async provideLinkedEditingRanges(model, position) {
|
|
57
57
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
58
|
-
const codeResult = await languageService.findLinkedEditingRanges(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
58
|
+
const codeResult = await languageService.findLinkedEditingRanges(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
59
59
|
if (codeResult) {
|
|
60
60
|
return {
|
|
61
61
|
ranges: codeResult.ranges.map(protocol2monaco.asRange),
|
|
@@ -65,30 +65,30 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
async provideDefinition(model, position
|
|
68
|
+
async provideDefinition(model, position) {
|
|
69
69
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
70
|
-
const codeResult = await languageService.findDefinition(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
70
|
+
const codeResult = await languageService.findDefinition(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
71
71
|
if (codeResult) {
|
|
72
72
|
return codeResult.map(protocol2monaco.asLocation);
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
|
-
async provideImplementation(model, position
|
|
75
|
+
async provideImplementation(model, position) {
|
|
76
76
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
77
|
-
const codeResult = await languageService.findImplementations(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
77
|
+
const codeResult = await languageService.findImplementations(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
78
78
|
if (codeResult) {
|
|
79
79
|
return codeResult.map(protocol2monaco.asLocation);
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
|
-
async provideTypeDefinition(model, position
|
|
82
|
+
async provideTypeDefinition(model, position) {
|
|
83
83
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
84
|
-
const codeResult = await languageService.findTypeDefinition(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
84
|
+
const codeResult = await languageService.findTypeDefinition(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
85
85
|
if (codeResult) {
|
|
86
86
|
return codeResult.map(protocol2monaco.asLocation);
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
|
-
async provideCodeLenses(model
|
|
89
|
+
async provideCodeLenses(model) {
|
|
90
90
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
91
|
-
const codeResult = await languageService.doCodeLens(model.uri.toString()
|
|
91
|
+
const codeResult = await languageService.doCodeLens(model.uri.toString());
|
|
92
92
|
if (codeResult) {
|
|
93
93
|
const monacoResult = codeResult.map(protocol2monaco.asCodeLens);
|
|
94
94
|
for (let i = 0; i < monacoResult.length; i++) {
|
|
@@ -100,11 +100,11 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
|
-
async resolveCodeLens(_, monacoResult
|
|
103
|
+
async resolveCodeLens(_, monacoResult) {
|
|
104
104
|
let codeResult = codeLens.get(monacoResult);
|
|
105
105
|
if (codeResult) {
|
|
106
106
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
107
|
-
codeResult = await languageService.doCodeLensResolve(codeResult
|
|
107
|
+
codeResult = await languageService.doCodeLensResolve(codeResult);
|
|
108
108
|
if (codeResult) {
|
|
109
109
|
monacoResult = protocol2monaco.asCodeLens(codeResult);
|
|
110
110
|
codeLens.set(monacoResult, codeResult);
|
|
@@ -112,7 +112,7 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
112
112
|
}
|
|
113
113
|
return monacoResult;
|
|
114
114
|
},
|
|
115
|
-
async provideCodeActions(model, range, context
|
|
115
|
+
async provideCodeActions(model, range, context) {
|
|
116
116
|
const diagnostics = [];
|
|
117
117
|
for (const marker of context.markers) {
|
|
118
118
|
const diagnostic = markers_1.markers.get(marker);
|
|
@@ -124,7 +124,7 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
124
124
|
const codeResult = await languageService.doCodeActions(model.uri.toString(), monaco2protocol.asRange(range), {
|
|
125
125
|
diagnostics: diagnostics,
|
|
126
126
|
only: context.only ? [context.only] : undefined,
|
|
127
|
-
}
|
|
127
|
+
});
|
|
128
128
|
if (codeResult) {
|
|
129
129
|
const monacoResult = codeResult.map(protocol2monaco.asCodeAction);
|
|
130
130
|
for (let i = 0; i < monacoResult.length; i++) {
|
|
@@ -136,11 +136,11 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
|
-
async resolveCodeAction(monacoResult
|
|
139
|
+
async resolveCodeAction(monacoResult) {
|
|
140
140
|
let codeResult = codeActions.get(monacoResult);
|
|
141
141
|
if (codeResult) {
|
|
142
142
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
143
|
-
codeResult = await languageService.doCodeActionResolve(codeResult
|
|
143
|
+
codeResult = await languageService.doCodeActionResolve(codeResult);
|
|
144
144
|
if (codeResult) {
|
|
145
145
|
monacoResult = protocol2monaco.asCodeAction(codeResult);
|
|
146
146
|
codeActions.set(monacoResult, codeResult);
|
|
@@ -148,42 +148,42 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
148
148
|
}
|
|
149
149
|
return monacoResult;
|
|
150
150
|
},
|
|
151
|
-
async provideDocumentFormattingEdits(model, options
|
|
151
|
+
async provideDocumentFormattingEdits(model, options) {
|
|
152
152
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
153
|
-
const codeResult = await languageService.format(model.uri.toString(), monaco2protocol.asFormattingOptions(options), undefined, undefined
|
|
153
|
+
const codeResult = await languageService.format(model.uri.toString(), monaco2protocol.asFormattingOptions(options), undefined, undefined);
|
|
154
154
|
if (codeResult) {
|
|
155
155
|
return codeResult.map(protocol2monaco.asTextEdit);
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
async provideDocumentRangeFormattingEdits(model, range, options
|
|
158
|
+
async provideDocumentRangeFormattingEdits(model, range, options) {
|
|
159
159
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
160
|
-
const codeResult = await languageService.format(model.uri.toString(), monaco2protocol.asFormattingOptions(options), monaco2protocol.asRange(range), undefined
|
|
160
|
+
const codeResult = await languageService.format(model.uri.toString(), monaco2protocol.asFormattingOptions(options), monaco2protocol.asRange(range), undefined);
|
|
161
161
|
if (codeResult) {
|
|
162
162
|
return codeResult.map(protocol2monaco.asTextEdit);
|
|
163
163
|
}
|
|
164
164
|
},
|
|
165
|
-
async provideOnTypeFormattingEdits(model, position, ch, options
|
|
165
|
+
async provideOnTypeFormattingEdits(model, position, ch, options) {
|
|
166
166
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
167
167
|
const codeResult = await languageService.format(model.uri.toString(), monaco2protocol.asFormattingOptions(options), undefined, {
|
|
168
168
|
ch: ch,
|
|
169
169
|
position: monaco2protocol.asPosition(position),
|
|
170
|
-
}
|
|
170
|
+
});
|
|
171
171
|
if (codeResult) {
|
|
172
172
|
return codeResult.map(protocol2monaco.asTextEdit);
|
|
173
173
|
}
|
|
174
174
|
},
|
|
175
|
-
async provideLinks(model
|
|
175
|
+
async provideLinks(model) {
|
|
176
176
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
177
|
-
const codeResult = await languageService.findDocumentLinks(model.uri.toString()
|
|
177
|
+
const codeResult = await languageService.findDocumentLinks(model.uri.toString());
|
|
178
178
|
if (codeResult) {
|
|
179
179
|
return {
|
|
180
180
|
links: codeResult.map(protocol2monaco.asLink),
|
|
181
181
|
};
|
|
182
182
|
}
|
|
183
183
|
},
|
|
184
|
-
async provideCompletionItems(model, position, context
|
|
184
|
+
async provideCompletionItems(model, position, context) {
|
|
185
185
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
186
|
-
const codeResult = await languageService.doComplete(model.uri.toString(), monaco2protocol.asPosition(position), monaco2protocol.asCompletionContext(context)
|
|
186
|
+
const codeResult = await languageService.doComplete(model.uri.toString(), monaco2protocol.asPosition(position), monaco2protocol.asCompletionContext(context));
|
|
187
187
|
const fallbackRange = {
|
|
188
188
|
start: monaco2protocol.asPosition(position),
|
|
189
189
|
end: monaco2protocol.asPosition(position),
|
|
@@ -194,11 +194,11 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
194
194
|
}
|
|
195
195
|
return monacoResult;
|
|
196
196
|
},
|
|
197
|
-
async resolveCompletionItem(monacoItem
|
|
197
|
+
async resolveCompletionItem(monacoItem) {
|
|
198
198
|
let codeItem = completionItems.get(monacoItem);
|
|
199
199
|
if (codeItem) {
|
|
200
200
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
201
|
-
codeItem = await languageService.doCompletionResolve(codeItem
|
|
201
|
+
codeItem = await languageService.doCompletionResolve(codeItem);
|
|
202
202
|
const fallbackRange = 'replace' in monacoItem.range
|
|
203
203
|
? monaco2protocol.asRange(monacoItem.range.replace)
|
|
204
204
|
: monaco2protocol.asRange(monacoItem.range);
|
|
@@ -207,48 +207,48 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
207
207
|
}
|
|
208
208
|
return monacoItem;
|
|
209
209
|
},
|
|
210
|
-
async provideDocumentColors(model
|
|
210
|
+
async provideDocumentColors(model) {
|
|
211
211
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
212
|
-
const codeResult = await languageService.findDocumentColors(model.uri.toString()
|
|
212
|
+
const codeResult = await languageService.findDocumentColors(model.uri.toString());
|
|
213
213
|
if (codeResult) {
|
|
214
214
|
return codeResult.map(protocol2monaco.asColorInformation);
|
|
215
215
|
}
|
|
216
216
|
},
|
|
217
|
-
async provideColorPresentations(model, monacoResult
|
|
217
|
+
async provideColorPresentations(model, monacoResult) {
|
|
218
218
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
219
219
|
const codeResult = colorInfos.get(monacoResult);
|
|
220
220
|
if (codeResult) {
|
|
221
221
|
const codeColors = await languageService.getColorPresentations(model.uri.toString(), codeResult.color, {
|
|
222
222
|
start: monaco2protocol.asPosition(model.getPositionAt(0)),
|
|
223
223
|
end: monaco2protocol.asPosition(model.getPositionAt(model.getValueLength())),
|
|
224
|
-
}
|
|
224
|
+
});
|
|
225
225
|
if (codeColors) {
|
|
226
226
|
return codeColors.map(protocol2monaco.asColorPresentation);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
|
-
async provideFoldingRanges(model, _context
|
|
230
|
+
async provideFoldingRanges(model, _context) {
|
|
231
231
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
232
|
-
const codeResult = await languageService.getFoldingRanges(model.uri.toString()
|
|
232
|
+
const codeResult = await languageService.getFoldingRanges(model.uri.toString());
|
|
233
233
|
if (codeResult) {
|
|
234
234
|
return codeResult.map(protocol2monaco.asFoldingRange);
|
|
235
235
|
}
|
|
236
236
|
},
|
|
237
|
-
async provideDeclaration(model, position
|
|
237
|
+
async provideDeclaration(model, position) {
|
|
238
238
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
239
|
-
const codeResult = await languageService.findDefinition(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
239
|
+
const codeResult = await languageService.findDefinition(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
240
240
|
if (codeResult) {
|
|
241
241
|
return codeResult.map(protocol2monaco.asLocation);
|
|
242
242
|
}
|
|
243
243
|
},
|
|
244
|
-
async provideSelectionRanges(model, positions
|
|
244
|
+
async provideSelectionRanges(model, positions) {
|
|
245
245
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
246
|
-
const codeResults = await Promise.all(positions.map((position) => languageService.getSelectionRanges(model.uri.toString(), [monaco2protocol.asPosition(position)]
|
|
246
|
+
const codeResults = await Promise.all(positions.map((position) => languageService.getSelectionRanges(model.uri.toString(), [monaco2protocol.asPosition(position)])));
|
|
247
247
|
return codeResults.map((codeResult) => codeResult?.map(protocol2monaco.asSelectionRange) ?? []);
|
|
248
248
|
},
|
|
249
|
-
async provideSignatureHelp(model, position,
|
|
249
|
+
async provideSignatureHelp(model, position, _token, context) {
|
|
250
250
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
251
|
-
const codeResult = await languageService.getSignatureHelp(model.uri.toString(), monaco2protocol.asPosition(position), monaco2protocol.asSignatureHelpContext(context)
|
|
251
|
+
const codeResult = await languageService.getSignatureHelp(model.uri.toString(), monaco2protocol.asPosition(position), monaco2protocol.asSignatureHelpContext(context));
|
|
252
252
|
if (codeResult) {
|
|
253
253
|
return {
|
|
254
254
|
value: protocol2monaco.asSignatureHelp(codeResult),
|
|
@@ -256,23 +256,23 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
|
-
async provideRenameEdits(model, position, newName
|
|
259
|
+
async provideRenameEdits(model, position, newName) {
|
|
260
260
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
261
|
-
const codeResult = await languageService.doRename(model.uri.toString(), monaco2protocol.asPosition(position), newName
|
|
261
|
+
const codeResult = await languageService.doRename(model.uri.toString(), monaco2protocol.asPosition(position), newName);
|
|
262
262
|
if (codeResult) {
|
|
263
263
|
return protocol2monaco.asWorkspaceEdit(codeResult);
|
|
264
264
|
}
|
|
265
265
|
},
|
|
266
|
-
async provideReferences(model, position, _context
|
|
266
|
+
async provideReferences(model, position, _context) {
|
|
267
267
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
268
|
-
const codeResult = await languageService.findReferences(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
268
|
+
const codeResult = await languageService.findReferences(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
269
269
|
if (codeResult) {
|
|
270
270
|
return codeResult.map(protocol2monaco.asLocation);
|
|
271
271
|
}
|
|
272
272
|
},
|
|
273
|
-
async provideInlayHints(model, range
|
|
273
|
+
async provideInlayHints(model, range) {
|
|
274
274
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
275
|
-
const codeResult = await languageService.getInlayHints(model.uri.toString(), monaco2protocol.asRange(range)
|
|
275
|
+
const codeResult = await languageService.getInlayHints(model.uri.toString(), monaco2protocol.asRange(range));
|
|
276
276
|
if (codeResult) {
|
|
277
277
|
return {
|
|
278
278
|
hints: codeResult.map(protocol2monaco.asInlayHint),
|
|
@@ -280,9 +280,9 @@ async function createLanguageFeaturesProvider(worker, getSyncUris) {
|
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
282
|
},
|
|
283
|
-
async provideHover(model, position
|
|
283
|
+
async provideHover(model, position) {
|
|
284
284
|
const languageService = await worker.withSyncedResources(getSyncUris());
|
|
285
|
-
const codeResult = await languageService.doHover(model.uri.toString(), monaco2protocol.asPosition(position)
|
|
285
|
+
const codeResult = await languageService.doHover(model.uri.toString(), monaco2protocol.asPosition(position));
|
|
286
286
|
if (codeResult) {
|
|
287
287
|
return protocol2monaco.asHover(codeResult);
|
|
288
288
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volar/monaco",
|
|
3
|
-
"version": "1.4.0-alpha.
|
|
3
|
+
"version": "1.4.0-alpha.2",
|
|
4
4
|
"main": "out/index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"directory": "packages/monaco"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@volar/language-service": "1.4.0-alpha.
|
|
18
|
+
"@volar/language-service": "1.4.0-alpha.2",
|
|
19
19
|
"monaco-editor-core": "^0.36.0",
|
|
20
20
|
"vscode-languageserver-protocol": "^3.17.3",
|
|
21
21
|
"vscode-uri": "^3.0.7"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "034b230da17794a6fcf5a0b07668710f98ff84e3"
|
|
24
24
|
}
|