Skip to content

Commit 64f5da2

Browse files
authored
fix(language-core): avoid references highlight of unrelated native element tags (#5563)
1 parent 6d59dee commit 64f5da2

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/language-core/lib/codegen/codeFeatures.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,12 @@ const raw = {
2424
navigation: {
2525
navigation: true,
2626
},
27+
navigationWithoutHighlight: {
28+
navigation: { shouldHighlight: () => false },
29+
},
2730
navigationWithoutRename: {
2831
navigation: { shouldRename: () => false },
2932
},
30-
navigationAndCompletion: {
31-
navigation: true,
32-
completion: true,
33-
},
3433
navigationAndAdditionalCompletion: {
3534
navigation: true,
3635
completion: { isAdditional: true },
@@ -63,10 +62,6 @@ const raw = {
6362
verification: true,
6463
navigation: true,
6564
},
66-
withoutHighlightAndCompletionAndNavigation: {
67-
semantic: { shouldHighlight: () => false },
68-
verification: true,
69-
},
7065
withoutSemantic: {
7166
verification: true,
7267
navigation: true,

packages/language-core/lib/codegen/template/element.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,18 @@ export function* generateElement(
301301
: undefined;
302302
const failedPropExps: FailedPropExpression[] = [];
303303

304+
const features = {
305+
...codeFeatures.semanticWithoutHighlight,
306+
...codeFeatures.navigationWithoutHighlight,
307+
};
308+
304309
yield `__VLS_asFunctionalElement(__VLS_elements`;
305310
yield* generatePropertyAccess(
306311
options,
307312
ctx,
308313
node.tag,
309314
startTagOffset,
310-
ctx.codeFeatures.withoutHighlightAndCompletion,
315+
features,
311316
);
312317
if (endTagOffset !== undefined) {
313318
yield `, __VLS_elements`;
@@ -316,7 +321,7 @@ export function* generateElement(
316321
ctx,
317322
node.tag,
318323
endTagOffset,
319-
ctx.codeFeatures.withoutHighlightAndCompletion,
324+
features,
320325
);
321326
}
322327
yield `)(`;

0 commit comments

Comments
 (0)