|
1 | 1 | import type { Disposable, LanguageServiceContext } from '@volar/language-service';
|
2 | 2 | import { VueVirtualCode, hyphenateAttr, hyphenateTag, tsCodegen } from '@vue/language-core';
|
3 | 3 | import { camelize, capitalize } from '@vue/shared';
|
4 |
| -import { getComponentSpans } from '@vue/typescript-plugin/lib/common'; |
5 | 4 | import type { ComponentPropInfo } from '@vue/typescript-plugin/lib/requests/getComponentProps';
|
6 | 5 | import { create as createHtmlService } from 'volar-service-html';
|
7 | 6 | import { create as createPugService } from 'volar-service-pug';
|
@@ -38,7 +37,6 @@ let modelData: html.HTMLDataV1;
|
38 | 37 |
|
39 | 38 | export function create(
|
40 | 39 | mode: 'html' | 'pug',
|
41 |
| - ts: typeof import('typescript'), |
42 | 40 | getTsPluginClient?: (context: LanguageServiceContext) => import('@vue/typescript-plugin/lib/requests').Requests | undefined
|
43 | 41 | ): LanguageServicePlugin {
|
44 | 42 | let customData: html.IHTMLDataProvider[] = [];
|
@@ -91,12 +89,6 @@ export function create(
|
91 | 89 | interFileDependencies: false,
|
92 | 90 | workspaceDiagnostics: false,
|
93 | 91 | },
|
94 |
| - semanticTokensProvider: { |
95 |
| - legend: { |
96 |
| - tokenTypes: ['class'], |
97 |
| - tokenModifiers: [], |
98 |
| - }, |
99 |
| - } |
100 | 92 | },
|
101 | 93 | create(context) {
|
102 | 94 | const tsPluginClient = getTsPluginClient?.(context);
|
@@ -269,63 +261,6 @@ export function create(
|
269 | 261 | ...templateErrors,
|
270 | 262 | ];
|
271 | 263 | },
|
272 |
| - |
273 |
| - provideDocumentSemanticTokens(document, range, legend) { |
274 |
| - |
275 |
| - if (!isSupportedDocument(document)) { |
276 |
| - return; |
277 |
| - } |
278 |
| - |
279 |
| - if (!context.project.vue) { |
280 |
| - return; |
281 |
| - } |
282 |
| - const vueCompilerOptions = context.project.vue.compilerOptions; |
283 |
| - |
284 |
| - const languageService = context.inject<(import('volar-service-typescript').Provide), 'typescript/languageService'>('typescript/languageService'); |
285 |
| - if (!languageService) { |
286 |
| - return; |
287 |
| - } |
288 |
| - |
289 |
| - const uri = URI.parse(document.uri); |
290 |
| - const decoded = context.decodeEmbeddedDocumentUri(uri); |
291 |
| - const sourceScript = decoded && context.language.scripts.get(decoded[0]); |
292 |
| - const root = sourceScript?.generated?.root; |
293 |
| - if (!(root instanceof VueVirtualCode)) { |
294 |
| - return; |
295 |
| - } |
296 |
| - |
297 |
| - const { template } = root.sfc; |
298 |
| - if (!template) { |
299 |
| - return; |
300 |
| - } |
301 |
| - |
302 |
| - const spans = getComponentSpans.call( |
303 |
| - { |
304 |
| - files: context.language.scripts, |
305 |
| - languageService, |
306 |
| - typescript: ts, |
307 |
| - vueOptions: vueCompilerOptions, |
308 |
| - }, |
309 |
| - root, |
310 |
| - template, |
311 |
| - { |
312 |
| - start: document.offsetAt(range.start), |
313 |
| - length: document.offsetAt(range.end) - document.offsetAt(range.start), |
314 |
| - } |
315 |
| - ); |
316 |
| - const classTokenIndex = legend.tokenTypes.indexOf('class'); |
317 |
| - |
318 |
| - return spans.map(span => { |
319 |
| - const start = document.positionAt(span.start); |
320 |
| - return [ |
321 |
| - start.line, |
322 |
| - start.character, |
323 |
| - span.length, |
324 |
| - classTokenIndex, |
325 |
| - 0, |
326 |
| - ]; |
327 |
| - }); |
328 |
| - }, |
329 | 264 | };
|
330 | 265 |
|
331 | 266 | async function provideHtmlData(sourceDocumentUri: URI, vueCode: VueVirtualCode) {
|
|
0 commit comments