Skip to content

Commit c75b33b

Browse files
committed
Update element.ts
1 parent 1e84ae7 commit c75b33b

File tree

1 file changed

+3
-5
lines changed
  • packages/language-core/lib/codegen/template

1 file changed

+3
-5
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function* generateComponent(
5252
exp: CompilerDOM.ElementNode | CompilerDOM.ExpressionNode;
5353
tag: string;
5454
offsets: [number, number | undefined];
55-
isComponentIsShorthand?: boolean;
5655
} | undefined;
5756

5857
if (isComponentTag) {
@@ -63,11 +62,13 @@ export function* generateComponent(
6362
&& prop.arg?.loc.source === 'is'
6463
&& prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION
6564
) {
65+
if (prop.arg.loc.end.offset === prop.exp.loc.end.offset) {
66+
ctx.inlayHints.push(createVBindShorthandInlayHintInfo(prop.exp.loc, 'is'));
67+
}
6668
dynamicTagInfo = {
6769
exp: prop.exp,
6870
tag: prop.exp.content,
6971
offsets: [prop.exp.loc.start.offset, undefined],
70-
isComponentIsShorthand: prop.arg.loc.end.offset === prop.exp.loc.end.offset
7172
};
7273
props = props.filter(p => p !== prop);
7374
break;
@@ -114,9 +115,6 @@ export function* generateComponent(
114115
yield `]${endOfLine}`;
115116
}
116117
else if (dynamicTagInfo) {
117-
if (dynamicTagInfo.isComponentIsShorthand) {
118-
ctx.inlayHints.push(createVBindShorthandInlayHintInfo(dynamicTagInfo.exp.loc, 'is'));
119-
}
120118
yield `const ${var_originalComponent} = (`;
121119
yield* generateInterpolation(
122120
options,

0 commit comments

Comments
 (0)