volar-service-typescript 0.0.56 → 0.0.57

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.
@@ -100,7 +100,7 @@ function create(ts, { isValidationEnabled = async (document, context) => {
100
100
  console.warn(`[volar] typescript-semantic requires typescript project.`);
101
101
  return {};
102
102
  }
103
- const { sys, languageServiceHost, asFileName, asUri, getExtraServiceScript } = context.project.typescript;
103
+ const { sys, languageServiceHost, uriConverter, getExtraServiceScript } = context.project.typescript;
104
104
  const created = tsWithImportCache.createLanguageService(ts, sys, languageServiceHost, proxiedHost => ts.createLanguageService(proxiedHost, getDocumentRegistry(ts, sys.useCaseSensitiveFileNames, languageServiceHost.getCurrentDirectory())));
105
105
  const { languageService } = created;
106
106
  const ctx = {
@@ -112,7 +112,7 @@ function create(ts, { isValidationEnabled = async (document, context) => {
112
112
  if (virtualScript) {
113
113
  return virtualScript.fileName;
114
114
  }
115
- return asFileName(uri);
115
+ return uriConverter.asFileName(uri);
116
116
  },
117
117
  fileNameToUri(fileName) {
118
118
  const extraServiceScript = getExtraServiceScript(fileName);
@@ -120,7 +120,7 @@ function create(ts, { isValidationEnabled = async (document, context) => {
120
120
  const sourceScript = context.language.scripts.fromVirtualCode(extraServiceScript.code);
121
121
  return context.encodeEmbeddedDocumentUri(sourceScript.id, extraServiceScript.code.id);
122
122
  }
123
- const uri = asUri(fileName);
123
+ const uri = uriConverter.asUri(fileName);
124
124
  const sourceScript = context.language.scripts.get(uri);
125
125
  const serviceScript = sourceScript?.generated?.languagePlugin.typescript?.getServiceScript(sourceScript.generated.root);
126
126
  if (sourceScript && serviceScript) {
@@ -173,7 +173,7 @@ function create(ts, { isValidationEnabled = async (document, context) => {
173
173
  updateSourceScriptFileNames();
174
174
  }
175
175
  for (const change of params.changes) {
176
- const fileName = asFileName(vscode_uri_1.URI.parse(change.uri));
176
+ const fileName = uriConverter.asFileName(vscode_uri_1.URI.parse(change.uri));
177
177
  if (sourceScriptNames.has(normalizeFileName(fileName))) {
178
178
  created.projectUpdated?.(languageServiceHost.getCurrentDirectory());
179
179
  }
@@ -224,282 +224,294 @@ function create(ts, { isValidationEnabled = async (document, context) => {
224
224
  if (!await isSuggestionsEnabled(document, context)) {
225
225
  return;
226
226
  }
227
- return await worker(token, async () => {
228
- const preferences = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
229
- const fileName = ctx.uriToFileName(uri);
230
- const offset = document.offsetAt(position);
231
- const info = (0, shared_1.safeCall)(() => ctx.languageService.getCompletionsAtPosition(fileName, offset, {
232
- ...preferences,
233
- triggerCharacter: completeContext.triggerCharacter,
234
- triggerKind: completeContext.triggerKind,
227
+ if (await isCancellationRequestedWhileSync(token)) {
228
+ return;
229
+ }
230
+ const preferences = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
231
+ const fileName = ctx.uriToFileName(uri);
232
+ const offset = document.offsetAt(position);
233
+ const info = (0, shared_1.safeCall)(() => ctx.languageService.getCompletionsAtPosition(fileName, offset, {
234
+ ...preferences,
235
+ triggerCharacter: completeContext.triggerCharacter,
236
+ triggerKind: completeContext.triggerKind,
237
+ }));
238
+ if (info) {
239
+ return (0, lspConverters_1.convertCompletionInfo)(ts, info, document, position, tsEntry => ({
240
+ uri: document.uri,
241
+ fileName,
242
+ offset,
243
+ originalItem: {
244
+ name: tsEntry.name,
245
+ source: tsEntry.source,
246
+ data: tsEntry.data,
247
+ labelDetails: tsEntry.labelDetails,
248
+ },
235
249
  }));
236
- if (info) {
237
- return (0, lspConverters_1.convertCompletionInfo)(ts, info, document, position, tsEntry => ({
238
- uri: document.uri,
239
- fileName,
240
- offset,
241
- originalItem: {
242
- name: tsEntry.name,
243
- source: tsEntry.source,
244
- data: tsEntry.data,
245
- labelDetails: tsEntry.labelDetails,
246
- },
247
- }));
248
- }
249
- });
250
+ }
250
251
  },
251
252
  async resolveCompletionItem(item, token) {
252
- return await worker(token, async () => {
253
- const data = item.data;
254
- if (!data) {
255
- return item;
256
- }
257
- const { fileName, offset } = data;
258
- const uri = vscode_uri_1.URI.parse(data.uri);
259
- const document = ctx.getTextDocument(uri);
260
- const [formatOptions, preferences] = await Promise.all([
261
- (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
262
- (0, getUserPreferences_1.getUserPreferences)(ctx, document),
263
- ]);
264
- const details = (0, shared_1.safeCall)(() => ctx.languageService.getCompletionEntryDetails(fileName, offset, data.originalItem.name, formatOptions, data.originalItem.source, preferences, data.originalItem.data));
265
- if (!details) {
266
- return item;
267
- }
268
- if (data.originalItem.labelDetails) {
269
- item.labelDetails ??= {};
270
- Object.assign(item.labelDetails, data.originalItem.labelDetails);
271
- }
272
- (0, lspConverters_1.applyCompletionEntryDetails)(ts, item, details, document, ctx.fileNameToUri, ctx.getTextDocument);
273
- const useCodeSnippetsOnMethodSuggest = await ctx.env.getConfiguration?.((0, shared_1.getConfigTitle)(document) + '.suggest.completeFunctionCalls') ?? false;
274
- const useCodeSnippet = useCodeSnippetsOnMethodSuggest
275
- && (item.kind === 3
276
- || item.kind === 2);
277
- if (useCodeSnippet) {
278
- const shouldCompleteFunction = isValidFunctionCompletionContext(ctx.languageService, fileName, offset, document);
279
- if (shouldCompleteFunction) {
280
- const { snippet, parameterCount } = (0, snippetForFunctionCall_1.snippetForFunctionCall)({
281
- insertText: item.insertText ?? item.textEdit?.newText, // insertText is dropped by LSP in some case: https://github.com/microsoft/vscode-languageserver-node/blob/9b742021fb04ad081aa3676a9eecf4fa612084b4/client/src/common/codeConverter.ts#L659-L664
282
- label: item.label,
283
- }, details.displayParts);
284
- if (item.textEdit) {
285
- item.textEdit.newText = snippet;
286
- }
287
- if (item.insertText) {
288
- item.insertText = snippet;
289
- }
290
- item.insertTextFormat = 2;
291
- if (parameterCount > 0) {
292
- //Fix for https://github.com/microsoft/vscode/issues/104059
293
- //Don't show parameter hints if "editor.parameterHints.enabled": false
294
- // if (await getConfiguration('editor.parameterHints.enabled', document.uri)) {
295
- // item.command = {
296
- // title: 'triggerParameterHints',
297
- // command: 'editor.action.triggerParameterHints',
298
- // };
299
- // }
300
- }
253
+ if (await isCancellationRequestedWhileSync(token)) {
254
+ return item;
255
+ }
256
+ const data = item.data;
257
+ if (!data) {
258
+ return item;
259
+ }
260
+ const { fileName, offset } = data;
261
+ const uri = vscode_uri_1.URI.parse(data.uri);
262
+ const document = ctx.getTextDocument(uri);
263
+ const [formatOptions, preferences] = await Promise.all([
264
+ (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
265
+ (0, getUserPreferences_1.getUserPreferences)(ctx, document),
266
+ ]);
267
+ const details = (0, shared_1.safeCall)(() => ctx.languageService.getCompletionEntryDetails(fileName, offset, data.originalItem.name, formatOptions, data.originalItem.source, preferences, data.originalItem.data));
268
+ if (!details) {
269
+ return item;
270
+ }
271
+ if (data.originalItem.labelDetails) {
272
+ item.labelDetails ??= {};
273
+ Object.assign(item.labelDetails, data.originalItem.labelDetails);
274
+ }
275
+ (0, lspConverters_1.applyCompletionEntryDetails)(ts, item, details, document, ctx.fileNameToUri, ctx.getTextDocument);
276
+ const useCodeSnippetsOnMethodSuggest = await ctx.env.getConfiguration?.((0, shared_1.getConfigTitle)(document) + '.suggest.completeFunctionCalls') ?? false;
277
+ const useCodeSnippet = useCodeSnippetsOnMethodSuggest
278
+ && (item.kind === 3
279
+ || item.kind === 2);
280
+ if (useCodeSnippet) {
281
+ const shouldCompleteFunction = isValidFunctionCompletionContext(ctx.languageService, fileName, offset, document);
282
+ if (shouldCompleteFunction) {
283
+ const { snippet, parameterCount } = (0, snippetForFunctionCall_1.snippetForFunctionCall)({
284
+ insertText: item.insertText ?? item.textEdit?.newText, // insertText is dropped by LSP in some case: https://github.com/microsoft/vscode-languageserver-node/blob/9b742021fb04ad081aa3676a9eecf4fa612084b4/client/src/common/codeConverter.ts#L659-L664
285
+ label: item.label,
286
+ }, details.displayParts);
287
+ if (item.textEdit) {
288
+ item.textEdit.newText = snippet;
289
+ }
290
+ if (item.insertText) {
291
+ item.insertText = snippet;
292
+ }
293
+ item.insertTextFormat = 2;
294
+ if (parameterCount > 0) {
295
+ //Fix for https://github.com/microsoft/vscode/issues/104059
296
+ //Don't show parameter hints if "editor.parameterHints.enabled": false
297
+ // if (await getConfiguration('editor.parameterHints.enabled', document.uri)) {
298
+ // item.command = {
299
+ // title: 'triggerParameterHints',
300
+ // command: 'editor.action.triggerParameterHints',
301
+ // };
302
+ // }
301
303
  }
302
304
  }
303
- return item;
304
- function isValidFunctionCompletionContext(client, filepath, offset, document) {
305
- // Workaround for https://github.com/microsoft/TypeScript/issues/12677
306
- // Don't complete function calls inside of destructive assignments or imports
307
- try {
308
- const response = client.getQuickInfoAtPosition(filepath, offset);
309
- if (response) {
310
- switch (response.kind) {
311
- case 'var':
312
- case 'let':
313
- case 'const':
314
- case 'alias':
315
- return false;
316
- }
305
+ }
306
+ return item;
307
+ function isValidFunctionCompletionContext(client, filepath, offset, document) {
308
+ // Workaround for https://github.com/microsoft/TypeScript/issues/12677
309
+ // Don't complete function calls inside of destructive assignments or imports
310
+ try {
311
+ const response = client.getQuickInfoAtPosition(filepath, offset);
312
+ if (response) {
313
+ switch (response.kind) {
314
+ case 'var':
315
+ case 'let':
316
+ case 'const':
317
+ case 'alias':
318
+ return false;
317
319
  }
318
320
  }
319
- catch {
320
- // Noop
321
- }
322
- // Don't complete function call if there is already something that looks like a function call
323
- // https://github.com/microsoft/vscode/issues/18131
324
- const position = document.positionAt(offset);
325
- const after = (0, lspConverters_1.getLineText)(document, position.line).slice(position.character);
326
- return after.match(/^[a-z_$0-9]*\s*\(/gi) === null;
327
321
  }
328
- }) ?? item;
322
+ catch {
323
+ // Noop
324
+ }
325
+ // Don't complete function call if there is already something that looks like a function call
326
+ // https://github.com/microsoft/vscode/issues/18131
327
+ const position = document.positionAt(offset);
328
+ const after = (0, lspConverters_1.getLineText)(document, position.line).slice(position.character);
329
+ return after.match(/^[a-z_$0-9]*\s*\(/gi) === null;
330
+ }
329
331
  },
330
- provideRenameRange(document, position, token) {
332
+ async provideRenameRange(document, position, token) {
331
333
  const uri = vscode_uri_1.URI.parse(document.uri);
332
334
  if (!isSemanticDocument(uri, document)) {
333
335
  return;
334
336
  }
335
- return worker(token, () => {
336
- const fileName = ctx.uriToFileName(uri);
337
- const offset = document.offsetAt(position);
338
- const renameInfo = (0, shared_1.safeCall)(() => ctx.languageService.getRenameInfo(fileName, offset, renameInfoOptions));
339
- if (!renameInfo) {
340
- return;
341
- }
342
- if (!renameInfo.canRename) {
343
- return { message: renameInfo.localizedErrorMessage };
344
- }
345
- return (0, lspConverters_1.convertTextSpan)(renameInfo.triggerSpan, document);
346
- });
337
+ if (await isCancellationRequestedWhileSync(token)) {
338
+ return;
339
+ }
340
+ const fileName = ctx.uriToFileName(uri);
341
+ const offset = document.offsetAt(position);
342
+ const renameInfo = (0, shared_1.safeCall)(() => ctx.languageService.getRenameInfo(fileName, offset, renameInfoOptions));
343
+ if (!renameInfo) {
344
+ return;
345
+ }
346
+ if (!renameInfo.canRename) {
347
+ return { message: renameInfo.localizedErrorMessage };
348
+ }
349
+ return (0, lspConverters_1.convertTextSpan)(renameInfo.triggerSpan, document);
347
350
  },
348
- provideRenameEdits(document, position, newName, token) {
351
+ async provideRenameEdits(document, position, newName, token) {
349
352
  const uri = vscode_uri_1.URI.parse(document.uri);
350
353
  if (!isSemanticDocument(uri, document, true)) {
351
354
  return;
352
355
  }
353
- return worker(token, async () => {
354
- const fileName = ctx.uriToFileName(uri);
355
- const offset = document.offsetAt(position);
356
- const renameInfo = (0, shared_1.safeCall)(() => ctx.languageService.getRenameInfo(fileName, offset, renameInfoOptions));
357
- if (!renameInfo?.canRename) {
358
- return;
359
- }
360
- if (renameInfo.fileToRename) {
361
- const [formatOptions, preferences] = await Promise.all([
362
- (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
363
- (0, getUserPreferences_1.getUserPreferences)(ctx, document),
364
- ]);
365
- return renameFile(renameInfo.fileToRename, newName, formatOptions, preferences);
356
+ if (await isCancellationRequestedWhileSync(token)) {
357
+ return;
358
+ }
359
+ const fileName = ctx.uriToFileName(uri);
360
+ const offset = document.offsetAt(position);
361
+ const renameInfo = (0, shared_1.safeCall)(() => ctx.languageService.getRenameInfo(fileName, offset, renameInfoOptions));
362
+ if (!renameInfo?.canRename) {
363
+ return;
364
+ }
365
+ if (renameInfo.fileToRename) {
366
+ const [formatOptions, preferences] = await Promise.all([
367
+ (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
368
+ (0, getUserPreferences_1.getUserPreferences)(ctx, document),
369
+ ]);
370
+ return renameFile(renameInfo.fileToRename, newName, formatOptions, preferences);
371
+ }
372
+ const { providePrefixAndSuffixTextForRename } = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
373
+ const entries = ctx.languageService.findRenameLocations(fileName, offset, false, false, providePrefixAndSuffixTextForRename);
374
+ if (!entries) {
375
+ return;
376
+ }
377
+ return (0, lspConverters_1.convertRenameLocations)(newName, entries, ctx.fileNameToUri, ctx.getTextDocument);
378
+ function renameFile(fileToRename, newName, formatOptions, preferences) {
379
+ // Make sure we preserve file extension if none provided
380
+ if (!path.extname(newName)) {
381
+ newName += path.extname(fileToRename);
366
382
  }
367
- const { providePrefixAndSuffixTextForRename } = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
368
- const entries = ctx.languageService.findRenameLocations(fileName, offset, false, false, providePrefixAndSuffixTextForRename);
369
- if (!entries) {
383
+ const dirname = path.dirname(fileToRename);
384
+ const newFilePath = path.join(dirname, newName);
385
+ const response = (0, shared_1.safeCall)(() => ctx.languageService.getEditsForFileRename(fileToRename, newFilePath, formatOptions, preferences));
386
+ if (!response) {
370
387
  return;
371
388
  }
372
- return (0, lspConverters_1.convertRenameLocations)(newName, entries, ctx.fileNameToUri, ctx.getTextDocument);
373
- function renameFile(fileToRename, newName, formatOptions, preferences) {
374
- // Make sure we preserve file extension if none provided
375
- if (!path.extname(newName)) {
376
- newName += path.extname(fileToRename);
377
- }
378
- const dirname = path.dirname(fileToRename);
379
- const newFilePath = path.join(dirname, newName);
380
- const response = (0, shared_1.safeCall)(() => ctx.languageService.getEditsForFileRename(fileToRename, newFilePath, formatOptions, preferences));
381
- if (!response) {
382
- return;
383
- }
384
- const edits = (0, lspConverters_1.convertFileTextChanges)(response, ctx.fileNameToUri, ctx.getTextDocument);
385
- if (!edits.documentChanges) {
386
- edits.documentChanges = [];
387
- }
388
- edits.documentChanges.push({
389
- kind: 'rename',
390
- oldUri: ctx.fileNameToUri(fileToRename).toString(),
391
- newUri: ctx.fileNameToUri(newFilePath).toString(),
392
- });
393
- return edits;
389
+ const edits = (0, lspConverters_1.convertFileTextChanges)(response, ctx.fileNameToUri, ctx.getTextDocument);
390
+ if (!edits.documentChanges) {
391
+ edits.documentChanges = [];
394
392
  }
395
- });
393
+ edits.documentChanges.push({
394
+ kind: 'rename',
395
+ oldUri: ctx.fileNameToUri(fileToRename).toString(),
396
+ newUri: ctx.fileNameToUri(newFilePath).toString(),
397
+ });
398
+ return edits;
399
+ }
396
400
  },
397
- provideCodeActions(document, range, context, token) {
401
+ async provideCodeActions(document, range, context, token) {
398
402
  const uri = vscode_uri_1.URI.parse(document.uri);
399
403
  if (!isSemanticDocument(uri, document)) {
400
404
  return;
401
405
  }
402
- return worker(token, () => {
403
- return getCodeActions(uri, document, range, context, formattingOptions);
404
- });
406
+ if (await isCancellationRequestedWhileSync(token)) {
407
+ return;
408
+ }
409
+ return getCodeActions(uri, document, range, context, formattingOptions);
405
410
  },
406
411
  async resolveCodeAction(codeAction, token) {
407
- return await worker(token, () => {
408
- return doCodeActionResolve(codeAction, formattingOptions);
409
- }) ?? codeAction;
412
+ if (await isCancellationRequestedWhileSync(token)) {
413
+ return codeAction;
414
+ }
415
+ return doCodeActionResolve(codeAction, formattingOptions);
410
416
  },
411
- provideInlayHints(document, range, token) {
417
+ async provideInlayHints(document, range, token) {
412
418
  const uri = vscode_uri_1.URI.parse(document.uri);
413
419
  if (!isSemanticDocument(uri, document)) {
414
420
  return;
415
421
  }
416
- return worker(token, async () => {
417
- const preferences = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
418
- const fileName = ctx.uriToFileName(uri);
419
- const start = document.offsetAt(range.start);
420
- const end = document.offsetAt(range.end);
421
- const inlayHints = (0, shared_1.safeCall)(() => 'provideInlayHints' in ctx.languageService
422
- ? ctx.languageService.provideInlayHints(fileName, { start, length: end - start }, preferences)
423
- : []);
424
- if (!inlayHints) {
425
- return [];
426
- }
427
- return inlayHints.map(hint => (0, lspConverters_1.convertInlayHint)(hint, document));
428
- });
422
+ if (await isCancellationRequestedWhileSync(token)) {
423
+ return;
424
+ }
425
+ const preferences = await (0, getUserPreferences_1.getUserPreferences)(ctx, document);
426
+ const fileName = ctx.uriToFileName(uri);
427
+ const start = document.offsetAt(range.start);
428
+ const end = document.offsetAt(range.end);
429
+ const inlayHints = (0, shared_1.safeCall)(() => 'provideInlayHints' in ctx.languageService
430
+ ? ctx.languageService.provideInlayHints(fileName, { start, length: end - start }, preferences)
431
+ : []);
432
+ if (!inlayHints) {
433
+ return [];
434
+ }
435
+ return inlayHints.map(hint => (0, lspConverters_1.convertInlayHint)(hint, document));
429
436
  },
430
- provideCallHierarchyItems(document, position, token) {
437
+ async provideCallHierarchyItems(document, position, token) {
431
438
  const uri = vscode_uri_1.URI.parse(document.uri);
432
439
  if (!isSemanticDocument(uri, document)) {
433
440
  return;
434
441
  }
435
- return worker(token, () => {
436
- const fileName = ctx.uriToFileName(uri);
437
- const offset = document.offsetAt(position);
438
- const calls = (0, shared_1.safeCall)(() => ctx.languageService.prepareCallHierarchy(fileName, offset));
439
- if (!calls) {
440
- return [];
441
- }
442
- const items = Array.isArray(calls) ? calls : [calls];
443
- return items.map(item => (0, lspConverters_1.convertCallHierarchyItem)(item, ctx));
444
- });
442
+ if (await isCancellationRequestedWhileSync(token)) {
443
+ return;
444
+ }
445
+ const fileName = ctx.uriToFileName(uri);
446
+ const offset = document.offsetAt(position);
447
+ const calls = (0, shared_1.safeCall)(() => ctx.languageService.prepareCallHierarchy(fileName, offset));
448
+ if (!calls) {
449
+ return [];
450
+ }
451
+ const items = Array.isArray(calls) ? calls : [calls];
452
+ return items.map(item => (0, lspConverters_1.convertCallHierarchyItem)(item, ctx));
445
453
  },
446
454
  async provideCallHierarchyIncomingCalls(item, token) {
447
- return await worker(token, () => {
448
- const uri = vscode_uri_1.URI.parse(item.uri);
449
- const document = ctx.getTextDocument(uri);
450
- const fileName = ctx.uriToFileName(uri);
451
- const offset = document.offsetAt(item.selectionRange.start);
452
- const calls = (0, shared_1.safeCall)(() => ctx.languageService.provideCallHierarchyIncomingCalls(fileName, offset));
453
- if (!calls) {
454
- return [];
455
- }
456
- const items = Array.isArray(calls) ? calls : [calls];
457
- return items.map(item => (0, lspConverters_1.convertCallHierarchyIncomingCall)(item, ctx));
458
- }) ?? [];
455
+ if (await isCancellationRequestedWhileSync(token)) {
456
+ return [];
457
+ }
458
+ const uri = vscode_uri_1.URI.parse(item.uri);
459
+ const document = ctx.getTextDocument(uri);
460
+ const fileName = ctx.uriToFileName(uri);
461
+ const offset = document.offsetAt(item.selectionRange.start);
462
+ const calls = (0, shared_1.safeCall)(() => ctx.languageService.provideCallHierarchyIncomingCalls(fileName, offset));
463
+ if (!calls) {
464
+ return [];
465
+ }
466
+ const items = Array.isArray(calls) ? calls : [calls];
467
+ return items.map(item => (0, lspConverters_1.convertCallHierarchyIncomingCall)(item, ctx));
459
468
  },
460
469
  async provideCallHierarchyOutgoingCalls(item, token) {
461
- return await worker(token, () => {
462
- const uri = vscode_uri_1.URI.parse(item.uri);
463
- const document = ctx.getTextDocument(uri);
464
- const fileName = ctx.uriToFileName(uri);
465
- const offset = document.offsetAt(item.selectionRange.start);
466
- const calls = (0, shared_1.safeCall)(() => ctx.languageService.provideCallHierarchyOutgoingCalls(fileName, offset));
467
- if (!calls) {
468
- return [];
469
- }
470
- const items = Array.isArray(calls) ? calls : [calls];
471
- return items.map(item => (0, lspConverters_1.convertCallHierarchyOutgoingCall)(item, document, ctx));
472
- }) ?? [];
470
+ if (await isCancellationRequestedWhileSync(token)) {
471
+ return [];
472
+ }
473
+ const uri = vscode_uri_1.URI.parse(item.uri);
474
+ const document = ctx.getTextDocument(uri);
475
+ const fileName = ctx.uriToFileName(uri);
476
+ const offset = document.offsetAt(item.selectionRange.start);
477
+ const calls = (0, shared_1.safeCall)(() => ctx.languageService.provideCallHierarchyOutgoingCalls(fileName, offset));
478
+ if (!calls) {
479
+ return [];
480
+ }
481
+ const items = Array.isArray(calls) ? calls : [calls];
482
+ return items.map(item => (0, lspConverters_1.convertCallHierarchyOutgoingCall)(item, document, ctx));
473
483
  },
474
- provideDefinition(document, position, token) {
484
+ async provideDefinition(document, position, token) {
475
485
  const uri = vscode_uri_1.URI.parse(document.uri);
476
486
  if (!isSemanticDocument(uri, document)) {
477
487
  return;
478
488
  }
479
- return worker(token, () => {
480
- const fileName = ctx.uriToFileName(uri);
481
- const offset = document.offsetAt(position);
482
- const info = (0, shared_1.safeCall)(() => ctx.languageService.getDefinitionAndBoundSpan(fileName, offset));
483
- if (!info) {
484
- return [];
485
- }
486
- return (0, lspConverters_1.convertDefinitionInfoAndBoundSpan)(info, document, ctx);
487
- });
489
+ if (await isCancellationRequestedWhileSync(token)) {
490
+ return;
491
+ }
492
+ const fileName = ctx.uriToFileName(uri);
493
+ const offset = document.offsetAt(position);
494
+ const info = (0, shared_1.safeCall)(() => ctx.languageService.getDefinitionAndBoundSpan(fileName, offset));
495
+ if (!info) {
496
+ return [];
497
+ }
498
+ return (0, lspConverters_1.convertDefinitionInfoAndBoundSpan)(info, document, ctx);
488
499
  },
489
- provideTypeDefinition(document, position, token) {
500
+ async provideTypeDefinition(document, position, token) {
490
501
  const uri = vscode_uri_1.URI.parse(document.uri);
491
502
  if (!isSemanticDocument(uri, document)) {
492
503
  return;
493
504
  }
494
- return worker(token, () => {
495
- const fileName = ctx.uriToFileName(uri);
496
- const offset = document.offsetAt(position);
497
- const entries = (0, shared_1.safeCall)(() => ctx.languageService.getTypeDefinitionAtPosition(fileName, offset));
498
- if (!entries) {
499
- return [];
500
- }
501
- return entries.map(entry => (0, lspConverters_1.convertDocumentSpantoLocationLink)(entry, ctx));
502
- });
505
+ if (await isCancellationRequestedWhileSync(token)) {
506
+ return;
507
+ }
508
+ const fileName = ctx.uriToFileName(uri);
509
+ const offset = document.offsetAt(position);
510
+ const entries = (0, shared_1.safeCall)(() => ctx.languageService.getTypeDefinitionAtPosition(fileName, offset));
511
+ if (!entries) {
512
+ return [];
513
+ }
514
+ return entries.map(entry => (0, lspConverters_1.convertDocumentSpantoLocationLink)(entry, ctx));
503
515
  },
504
516
  provideDiagnostics(document, token) {
505
517
  return provideDiagnosticsWorker(document, token, 'syntactic');
@@ -507,195 +519,204 @@ function create(ts, { isValidationEnabled = async (document, context) => {
507
519
  provideSemanticDiagnostics(document, token) {
508
520
  return provideDiagnosticsWorker(document, token, 'semantic');
509
521
  },
510
- provideHover(document, position, token) {
522
+ async provideHover(document, position, token) {
511
523
  const uri = vscode_uri_1.URI.parse(document.uri);
512
524
  if (!isSemanticDocument(uri, document)) {
513
525
  return;
514
526
  }
515
- return worker(token, () => {
516
- const fileName = ctx.uriToFileName(uri);
517
- const offset = document.offsetAt(position);
518
- const info = (0, shared_1.safeCall)(() => ctx.languageService.getQuickInfoAtPosition(fileName, offset));
519
- if (!info) {
520
- return;
521
- }
522
- return (0, lspConverters_1.convertQuickInfo)(ts, info, document, ctx.fileNameToUri, ctx.getTextDocument);
523
- });
527
+ if (await isCancellationRequestedWhileSync(token)) {
528
+ return;
529
+ }
530
+ const fileName = ctx.uriToFileName(uri);
531
+ const offset = document.offsetAt(position);
532
+ const info = (0, shared_1.safeCall)(() => ctx.languageService.getQuickInfoAtPosition(fileName, offset));
533
+ if (!info) {
534
+ return;
535
+ }
536
+ return (0, lspConverters_1.convertQuickInfo)(ts, info, document, ctx.fileNameToUri, ctx.getTextDocument);
524
537
  },
525
- provideImplementation(document, position, token) {
538
+ async provideImplementation(document, position, token) {
526
539
  const uri = vscode_uri_1.URI.parse(document.uri);
527
540
  if (!isSemanticDocument(uri, document)) {
528
541
  return;
529
542
  }
530
- return worker(token, () => {
531
- const fileName = ctx.uriToFileName(uri);
532
- const offset = document.offsetAt(position);
533
- const entries = (0, shared_1.safeCall)(() => ctx.languageService.getImplementationAtPosition(fileName, offset));
534
- if (!entries) {
535
- return [];
536
- }
537
- return entries.map(entry => (0, lspConverters_1.convertDocumentSpantoLocationLink)(entry, ctx));
538
- });
543
+ if (await isCancellationRequestedWhileSync(token)) {
544
+ return;
545
+ }
546
+ const fileName = ctx.uriToFileName(uri);
547
+ const offset = document.offsetAt(position);
548
+ const entries = (0, shared_1.safeCall)(() => ctx.languageService.getImplementationAtPosition(fileName, offset));
549
+ if (!entries) {
550
+ return [];
551
+ }
552
+ return entries.map(entry => (0, lspConverters_1.convertDocumentSpantoLocationLink)(entry, ctx));
539
553
  },
540
- provideReferences(document, position, referenceContext, token) {
554
+ async provideReferences(document, position, referenceContext, token) {
541
555
  const uri = vscode_uri_1.URI.parse(document.uri);
542
556
  if (!isSemanticDocument(uri, document, true)) {
543
557
  return;
544
558
  }
545
- return worker(token, () => {
546
- const fileName = ctx.uriToFileName(uri);
547
- const offset = document.offsetAt(position);
548
- const references = (0, shared_1.safeCall)(() => ctx.languageService.findReferences(fileName, offset));
549
- if (!references) {
550
- return [];
551
- }
552
- const result = [];
553
- for (const reference of references) {
554
- if (referenceContext.includeDeclaration) {
555
- const definition = (0, lspConverters_1.convertDocumentSpanToLocation)(reference.definition, ctx);
556
- if (definition) {
557
- result.push(definition);
558
- }
559
+ if (await isCancellationRequestedWhileSync(token)) {
560
+ return;
561
+ }
562
+ const fileName = ctx.uriToFileName(uri);
563
+ const offset = document.offsetAt(position);
564
+ const references = (0, shared_1.safeCall)(() => ctx.languageService.findReferences(fileName, offset));
565
+ if (!references) {
566
+ return [];
567
+ }
568
+ const result = [];
569
+ for (const reference of references) {
570
+ if (referenceContext.includeDeclaration) {
571
+ const definition = (0, lspConverters_1.convertDocumentSpanToLocation)(reference.definition, ctx);
572
+ if (definition) {
573
+ result.push(definition);
559
574
  }
560
- for (const referenceEntry of reference.references) {
561
- const reference = (0, lspConverters_1.convertDocumentSpanToLocation)(referenceEntry, ctx);
562
- if (reference) {
563
- result.push(reference);
564
- }
575
+ }
576
+ for (const referenceEntry of reference.references) {
577
+ const reference = (0, lspConverters_1.convertDocumentSpanToLocation)(referenceEntry, ctx);
578
+ if (reference) {
579
+ result.push(reference);
565
580
  }
566
581
  }
567
- return result;
568
- });
582
+ }
583
+ return result;
569
584
  },
570
- provideFileReferences(document, token) {
585
+ async provideFileReferences(document, token) {
571
586
  const uri = vscode_uri_1.URI.parse(document.uri);
572
587
  if (!isSemanticDocument(uri, document, true)) {
573
588
  return;
574
589
  }
575
- return worker(token, () => {
576
- const fileName = ctx.uriToFileName(uri);
577
- const entries = (0, shared_1.safeCall)(() => ctx.languageService.getFileReferences(fileName));
578
- if (!entries) {
579
- return [];
580
- }
581
- return entries.map(entry => (0, lspConverters_1.convertDocumentSpanToLocation)(entry, ctx));
582
- });
590
+ if (await isCancellationRequestedWhileSync(token)) {
591
+ return;
592
+ }
593
+ const fileName = ctx.uriToFileName(uri);
594
+ const entries = (0, shared_1.safeCall)(() => ctx.languageService.getFileReferences(fileName));
595
+ if (!entries) {
596
+ return [];
597
+ }
598
+ return entries.map(entry => (0, lspConverters_1.convertDocumentSpanToLocation)(entry, ctx));
583
599
  },
584
- provideDocumentHighlights(document, position, token) {
600
+ async provideDocumentHighlights(document, position, token) {
585
601
  const uri = vscode_uri_1.URI.parse(document.uri);
586
602
  if (!isSemanticDocument(uri, document)) {
587
603
  return;
588
604
  }
589
- return worker(token, () => {
590
- const fileName = ctx.uriToFileName(uri);
591
- const offset = document.offsetAt(position);
592
- const highlights = (0, shared_1.safeCall)(() => ctx.languageService.getDocumentHighlights(fileName, offset, [fileName]));
593
- if (!highlights) {
594
- return [];
595
- }
596
- const results = [];
597
- for (const highlight of highlights) {
598
- for (const span of highlight.highlightSpans) {
599
- results.push((0, lspConverters_1.convertHighlightSpan)(span, document));
600
- }
605
+ if (await isCancellationRequestedWhileSync(token)) {
606
+ return;
607
+ }
608
+ const fileName = ctx.uriToFileName(uri);
609
+ const offset = document.offsetAt(position);
610
+ const highlights = (0, shared_1.safeCall)(() => ctx.languageService.getDocumentHighlights(fileName, offset, [fileName]));
611
+ if (!highlights) {
612
+ return [];
613
+ }
614
+ const results = [];
615
+ for (const highlight of highlights) {
616
+ for (const span of highlight.highlightSpans) {
617
+ results.push((0, lspConverters_1.convertHighlightSpan)(span, document));
601
618
  }
602
- return results;
603
- });
619
+ }
620
+ return results;
604
621
  },
605
- provideDocumentSemanticTokens(document, range, legend, token) {
622
+ async provideDocumentSemanticTokens(document, range, legend, token) {
606
623
  const uri = vscode_uri_1.URI.parse(document.uri);
607
624
  if (!isSemanticDocument(uri, document)) {
608
625
  return;
609
626
  }
610
- return worker(token, () => {
611
- return getDocumentSemanticTokens(uri, document, range, legend);
612
- });
627
+ if (await isCancellationRequestedWhileSync(token)) {
628
+ return;
629
+ }
630
+ return getDocumentSemanticTokens(uri, document, range, legend);
613
631
  },
614
- provideWorkspaceSymbols(query, token) {
615
- return worker(token, () => {
616
- const items = (0, shared_1.safeCall)(() => ctx.languageService.getNavigateToItems(query));
617
- if (!items) {
618
- return [];
619
- }
620
- return items
621
- .filter(item => item.containerName || item.kind !== 'alias')
622
- .map(item => (0, lspConverters_1.convertNavigateToItem)(item, ctx.getTextDocument(ctx.fileNameToUri(item.fileName))))
623
- .filter(item => !!item);
624
- });
632
+ async provideWorkspaceSymbols(query, token) {
633
+ if (await isCancellationRequestedWhileSync(token)) {
634
+ return;
635
+ }
636
+ const items = (0, shared_1.safeCall)(() => ctx.languageService.getNavigateToItems(query));
637
+ if (!items) {
638
+ return [];
639
+ }
640
+ return items
641
+ .filter(item => item.containerName || item.kind !== 'alias')
642
+ .map(item => (0, lspConverters_1.convertNavigateToItem)(item, ctx.getTextDocument(ctx.fileNameToUri(item.fileName))))
643
+ .filter(item => !!item);
625
644
  },
626
- provideFileRenameEdits(oldUri, newUri, token) {
627
- return worker(token, async () => {
628
- const document = ctx.getTextDocument(oldUri);
629
- const [formatOptions, preferences] = await Promise.all([
630
- (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
631
- (0, getUserPreferences_1.getUserPreferences)(ctx, document),
632
- ]);
633
- const fileToRename = ctx.uriToFileName(oldUri);
634
- const newFilePath = ctx.uriToFileName(newUri);
635
- const response = (0, shared_1.safeCall)(() => ctx.languageService.getEditsForFileRename(fileToRename, newFilePath, formatOptions, preferences));
636
- if (!response?.length) {
637
- return;
638
- }
639
- return (0, lspConverters_1.convertFileTextChanges)(response, ctx.fileNameToUri, ctx.getTextDocument);
640
- });
645
+ async provideFileRenameEdits(oldUri, newUri, token) {
646
+ if (await isCancellationRequestedWhileSync(token)) {
647
+ return;
648
+ }
649
+ const document = ctx.getTextDocument(oldUri);
650
+ const [formatOptions, preferences] = await Promise.all([
651
+ (0, getFormatCodeSettings_1.getFormatCodeSettings)(ctx, document, formattingOptions),
652
+ (0, getUserPreferences_1.getUserPreferences)(ctx, document),
653
+ ]);
654
+ const fileToRename = ctx.uriToFileName(oldUri);
655
+ const newFilePath = ctx.uriToFileName(newUri);
656
+ const response = (0, shared_1.safeCall)(() => ctx.languageService.getEditsForFileRename(fileToRename, newFilePath, formatOptions, preferences));
657
+ if (!response?.length) {
658
+ return;
659
+ }
660
+ return (0, lspConverters_1.convertFileTextChanges)(response, ctx.fileNameToUri, ctx.getTextDocument);
641
661
  },
642
- provideSignatureHelp(document, position, context, token) {
662
+ async provideSignatureHelp(document, position, context, token) {
643
663
  const uri = vscode_uri_1.URI.parse(document.uri);
644
664
  if (!isSemanticDocument(uri, document)) {
645
665
  return;
646
666
  }
647
- return worker(token, () => {
648
- const options = {};
649
- if (context?.triggerKind === 1) {
650
- options.triggerReason = {
651
- kind: 'invoked'
652
- };
653
- }
654
- else if (context?.triggerKind === 2) {
655
- options.triggerReason = {
656
- kind: 'characterTyped',
657
- triggerCharacter: context.triggerCharacter,
658
- };
659
- }
660
- else if (context?.triggerKind === 3) {
661
- options.triggerReason = {
662
- kind: 'retrigger',
663
- triggerCharacter: context.triggerCharacter,
667
+ if (await isCancellationRequestedWhileSync(token)) {
668
+ return;
669
+ }
670
+ const options = {};
671
+ if (context?.triggerKind === 1) {
672
+ options.triggerReason = {
673
+ kind: 'invoked'
674
+ };
675
+ }
676
+ else if (context?.triggerKind === 2) {
677
+ options.triggerReason = {
678
+ kind: 'characterTyped',
679
+ triggerCharacter: context.triggerCharacter,
680
+ };
681
+ }
682
+ else if (context?.triggerKind === 3) {
683
+ options.triggerReason = {
684
+ kind: 'retrigger',
685
+ triggerCharacter: context.triggerCharacter,
686
+ };
687
+ }
688
+ const fileName = ctx.uriToFileName(uri);
689
+ const offset = document.offsetAt(position);
690
+ const helpItems = (0, shared_1.safeCall)(() => ctx.languageService.getSignatureHelpItems(fileName, offset, options));
691
+ if (!helpItems) {
692
+ return;
693
+ }
694
+ return {
695
+ activeSignature: helpItems.selectedItemIndex,
696
+ activeParameter: helpItems.argumentIndex,
697
+ signatures: helpItems.items.map(item => {
698
+ const signature = {
699
+ label: '',
700
+ documentation: undefined,
701
+ parameters: []
664
702
  };
665
- }
666
- const fileName = ctx.uriToFileName(uri);
667
- const offset = document.offsetAt(position);
668
- const helpItems = (0, shared_1.safeCall)(() => ctx.languageService.getSignatureHelpItems(fileName, offset, options));
669
- if (!helpItems) {
670
- return;
671
- }
672
- return {
673
- activeSignature: helpItems.selectedItemIndex,
674
- activeParameter: helpItems.argumentIndex,
675
- signatures: helpItems.items.map(item => {
676
- const signature = {
677
- label: '',
678
- documentation: undefined,
679
- parameters: []
703
+ signature.label += ts.displayPartsToString(item.prefixDisplayParts);
704
+ item.parameters.forEach((p, i, a) => {
705
+ const label = ts.displayPartsToString(p.displayParts);
706
+ const parameter = {
707
+ label,
708
+ documentation: ts.displayPartsToString(p.documentation)
680
709
  };
681
- signature.label += ts.displayPartsToString(item.prefixDisplayParts);
682
- item.parameters.forEach((p, i, a) => {
683
- const label = ts.displayPartsToString(p.displayParts);
684
- const parameter = {
685
- label,
686
- documentation: ts.displayPartsToString(p.documentation)
687
- };
688
- signature.label += label;
689
- signature.parameters.push(parameter);
690
- if (i < a.length - 1) {
691
- signature.label += ts.displayPartsToString(item.separatorDisplayParts);
692
- }
693
- });
694
- signature.label += ts.displayPartsToString(item.suffixDisplayParts);
695
- return signature;
696
- }),
697
- };
698
- });
710
+ signature.label += label;
711
+ signature.parameters.push(parameter);
712
+ if (i < a.length - 1) {
713
+ signature.label += ts.displayPartsToString(item.separatorDisplayParts);
714
+ }
715
+ });
716
+ signature.label += ts.displayPartsToString(item.suffixDisplayParts);
717
+ return signature;
718
+ }),
719
+ };
699
720
  },
700
721
  };
701
722
  async function provideDiagnosticsWorker(document, token, mode) {
@@ -706,36 +727,37 @@ function create(ts, { isValidationEnabled = async (document, context) => {
706
727
  if (!await isValidationEnabled(document, context)) {
707
728
  return;
708
729
  }
709
- return await worker(token, () => {
710
- const fileName = ctx.uriToFileName(uri);
711
- const program = ctx.languageService.getProgram();
712
- const sourceFile = program?.getSourceFile(fileName);
713
- if (!program || !sourceFile) {
714
- return [];
715
- }
716
- const token = {
717
- isCancellationRequested() {
718
- return ctx.project.typescript?.languageServiceHost.getCancellationToken?.().isCancellationRequested() ?? false;
719
- },
720
- throwIfCancellationRequested() { },
721
- };
722
- if (mode === 'syntactic') {
723
- const syntacticDiagnostics = (0, shared_1.safeCall)(() => program.getSyntacticDiagnostics(sourceFile, token)) ?? [];
724
- const suggestionDiagnostics = (0, shared_1.safeCall)(() => ctx.languageService.getSuggestionDiagnostics(fileName)) ?? [];
725
- return [...syntacticDiagnostics, ...suggestionDiagnostics]
726
- .map(diagnostic => (0, lspConverters_1.convertDiagnostic)(diagnostic, document, ctx.fileNameToUri, ctx.getTextDocument))
727
- .filter(diagnostic => !!diagnostic);
728
- }
729
- else if (mode === 'semantic') {
730
- const semanticDiagnostics = (0, shared_1.safeCall)(() => program.getSemanticDiagnostics(sourceFile, token)) ?? [];
731
- const declarationDiagnostics = getEmitDeclarations(program.getCompilerOptions())
732
- ? (0, shared_1.safeCall)(() => program.getDeclarationDiagnostics(sourceFile, token)) ?? []
733
- : [];
734
- return [...semanticDiagnostics, ...declarationDiagnostics]
735
- .map(diagnostic => (0, lspConverters_1.convertDiagnostic)(diagnostic, document, ctx.fileNameToUri, ctx.getTextDocument))
736
- .filter(diagnostic => !!diagnostic);
737
- }
738
- });
730
+ if (mode === 'semantic' && await isCancellationRequestedWhileSync(token)) {
731
+ return;
732
+ }
733
+ const fileName = ctx.uriToFileName(uri);
734
+ const program = ctx.languageService.getProgram();
735
+ const sourceFile = program?.getSourceFile(fileName);
736
+ if (!program || !sourceFile) {
737
+ return [];
738
+ }
739
+ const tsToken = {
740
+ isCancellationRequested() {
741
+ return ctx.project.typescript?.languageServiceHost.getCancellationToken?.().isCancellationRequested() ?? false;
742
+ },
743
+ throwIfCancellationRequested() { },
744
+ };
745
+ if (mode === 'syntactic') {
746
+ const syntacticDiagnostics = (0, shared_1.safeCall)(() => program.getSyntacticDiagnostics(sourceFile, tsToken)) ?? [];
747
+ const suggestionDiagnostics = (0, shared_1.safeCall)(() => ctx.languageService.getSuggestionDiagnostics(fileName)) ?? [];
748
+ return [...syntacticDiagnostics, ...suggestionDiagnostics]
749
+ .map(diagnostic => (0, lspConverters_1.convertDiagnostic)(diagnostic, document, ctx.fileNameToUri, ctx.getTextDocument))
750
+ .filter(diagnostic => !!diagnostic);
751
+ }
752
+ else if (mode === 'semantic') {
753
+ const semanticDiagnostics = (0, shared_1.safeCall)(() => program.getSemanticDiagnostics(sourceFile, tsToken)) ?? [];
754
+ const declarationDiagnostics = getEmitDeclarations(program.getCompilerOptions())
755
+ ? (0, shared_1.safeCall)(() => program.getDeclarationDiagnostics(sourceFile, tsToken)) ?? []
756
+ : [];
757
+ return [...semanticDiagnostics, ...declarationDiagnostics]
758
+ .map(diagnostic => (0, lspConverters_1.convertDiagnostic)(diagnostic, document, ctx.fileNameToUri, ctx.getTextDocument))
759
+ .filter(diagnostic => !!diagnostic);
760
+ }
739
761
  }
740
762
  function getEmitDeclarations(compilerOptions) {
741
763
  return !!(compilerOptions.declaration || compilerOptions.composite);
@@ -750,22 +772,17 @@ function create(ts, { isValidationEnabled = async (document, context) => {
750
772
  }
751
773
  return (0, shared_1.isTsDocument)(document);
752
774
  }
753
- async function worker(token, fn) {
754
- let result;
755
- let oldSysVersion;
756
- let newSysVersion = await sys.sync?.();
757
- do {
758
- oldSysVersion = newSysVersion;
759
- try {
760
- result = await fn();
761
- }
762
- catch (err) {
763
- console.warn(err);
764
- break;
765
- }
766
- newSysVersion = await sys.sync?.();
767
- } while (newSysVersion !== oldSysVersion && !token.isCancellationRequested);
768
- return result;
775
+ async function isCancellationRequestedWhileSync(token) {
776
+ if (sys.sync) {
777
+ let oldSysVersion;
778
+ let newSysVersion = await sys.sync();
779
+ do {
780
+ oldSysVersion = newSysVersion;
781
+ languageService.getProgram(); // trigger sync
782
+ newSysVersion = await sys.sync();
783
+ } while (newSysVersion !== oldSysVersion && !token.isCancellationRequested);
784
+ }
785
+ return token.isCancellationRequested;
769
786
  }
770
787
  function getVirtualScriptByUri(uri) {
771
788
  const decoded = context.decodeEmbeddedDocumentUri(uri);
@@ -773,7 +790,7 @@ function create(ts, { isValidationEnabled = async (document, context) => {
773
790
  const virtualCode = decoded && sourceScript?.generated?.embeddedCodes.get(decoded[1]);
774
791
  if (virtualCode && sourceScript?.generated?.languagePlugin.typescript) {
775
792
  const { getServiceScript, getExtraServiceScripts } = sourceScript.generated?.languagePlugin.typescript;
776
- const sourceFileName = asFileName(sourceScript.id);
793
+ const sourceFileName = uriConverter.asFileName(sourceScript.id);
777
794
  if (getServiceScript(sourceScript.generated.root)?.code === virtualCode) {
778
795
  return {
779
796
  fileName: sourceFileName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volar-service-typescript",
3
- "version": "0.0.56",
3
+ "version": "0.0.57",
4
4
  "description": "Integrate TypeScript into Volar",
5
5
  "homepage": "https://github.com/volarjs/services/tree/master/packages/typescript",
6
6
  "bugs": "https://github.com/volarjs/services/issues",
@@ -26,7 +26,7 @@
26
26
  "devDependencies": {
27
27
  "@types/path-browserify": "latest",
28
28
  "@types/semver": "latest",
29
- "@volar/typescript": "~2.4.0-alpha.1"
29
+ "@volar/typescript": "~2.4.0-alpha.11"
30
30
  },
31
31
  "dependencies": {
32
32
  "path-browserify": "^1.0.1",
@@ -37,12 +37,12 @@
37
37
  "vscode-uri": "^3.0.8"
38
38
  },
39
39
  "peerDependencies": {
40
- "@volar/language-service": "~2.4.0-alpha.1"
40
+ "@volar/language-service": "~2.4.0-alpha.11"
41
41
  },
42
42
  "peerDependenciesMeta": {
43
43
  "@volar/language-service": {
44
44
  "optional": true
45
45
  }
46
46
  },
47
- "gitHead": "83dc20fd032ab64507ef7a0e643e1d0bf34f201b"
47
+ "gitHead": "8ec3487544e6b06d76f66202d222170446c91264"
48
48
  }