Skip to content

Commit

Permalink
perf: delay get text
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Sep 13, 2023
1 parent cce193d commit ead6adb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/vue-language-service/src/languageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,10 @@ function resolvePlugins(
async provideSemanticDiagnostics(document, token) {
const result = await base.provideSemanticDiagnostics?.(document, token);
return result?.map(diagnostic => {
const text = document.getText(diagnostic.range);
if (
diagnostic.source === 'ts'
&& diagnostic.code === 2578 /* Unused '@ts-expect-error' directive. */
&& text === '// @ts-expect-error __VLS_TS_EXPECT_ERROR'
&& document.getText(diagnostic.range) === '// @ts-expect-error __VLS_TS_EXPECT_ERROR'
) {
diagnostic.source = 'vue';
diagnostic.code = 'ts-2578';
Expand Down

0 comments on commit ead6adb

Please sign in to comment.