Skip to content

Commit 5e2d2ce

Browse files
authored
fix(language-core): remove semantic highlight of v-bind shorthand (#5321)
1 parent 15c7115 commit 5e2d2ce

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ function* generateValue(
176176
options,
177177
ctx,
178178
prop,
179-
exp,
180-
ctx.codeFeatures.all
179+
exp
181180
);
182181
}

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

+3-9
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ export function* generateElementProps(
150150
ctx,
151151
prop,
152152
prop.exp,
153-
ctx.codeFeatures.all,
154153
enableCodeFeatures
155154
)
156155
)
@@ -260,7 +259,6 @@ export function* generateElementProps(
260259
ctx,
261260
prop,
262261
prop.exp,
263-
ctx.codeFeatures.all,
264262
enableCodeFeatures
265263
)
266264
)];
@@ -281,17 +279,13 @@ export function* generatePropExp(
281279
ctx: TemplateCodegenContext,
282280
prop: CompilerDOM.DirectiveNode,
283281
exp: CompilerDOM.SimpleExpressionNode | undefined,
284-
features: VueCodeInformation,
285282
enableCodeFeatures: boolean = true
286283
): Generator<Code> {
287284
const isShorthand = prop.arg?.loc.start.offset === prop.exp?.loc.start.offset;
285+
const features = isShorthand
286+
? ctx.codeFeatures.withoutHighlightAndCompletion
287+
: ctx.codeFeatures.all;
288288

289-
if (isShorthand && features.completion) {
290-
features = {
291-
...features,
292-
completion: undefined,
293-
};
294-
}
295289
if (exp && exp.constType !== CompilerDOM.ConstantTypes.CAN_STRINGIFY) { // style='z-index: 2' will compile to {'z-index':'2'}
296290
if (!isShorthand) { // vue 3.4+
297291
yield* generateInterpolation(

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ export function* generateSlotOutlet(
5959
options,
6060
ctx,
6161
nameProp,
62-
nameProp.exp,
63-
ctx.codeFeatures.all
62+
nameProp.exp
6463
),
6564
`]`
6665
];

0 commit comments

Comments
 (0)