Skip to content

Commit f7bdeaa

Browse files
authored
fix(language-service): do not provide semantic tokens and document highlights for non-file scheme files (#5653)
1 parent cb6eef1 commit f7bdeaa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/language-service/lib/plugins/typescript-semantic-tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export function create(
3939
return {
4040
async provideDocumentSemanticTokens(document, range, legend) {
4141
const info = resolveEmbeddedCode(context, document.uri);
42-
if (info?.code.id !== 'main') {
42+
if (info?.script.id.scheme !== 'file' || info.code.id !== 'main') {
4343
return;
4444
}
4545
const start = document.offsetAt(range.start);

packages/language-service/lib/plugins/vue-document-highlights.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function create(
1414
return {
1515
async provideDocumentHighlights(document, position) {
1616
const info = resolveEmbeddedCode(context, document.uri);
17-
if (info?.code.id !== 'main') {
17+
if (info?.script.id.scheme !== 'file' || info.code.id !== 'main') {
1818
return;
1919
}
2020

0 commit comments

Comments
 (0)