Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(language-core): inlay hints for <component :is> and <slot :name> #4661

Merged
merged 12 commits into from
Oct 23, 2024
Prev Previous commit
Next Next commit
chore: merge
  • Loading branch information
KazariEX committed Aug 7, 2024
commit a279ac0081dadba7db3e5b5e671cf2f4ffab51b5
10 changes: 5 additions & 5 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function* generateComponent(
let dynamicTagInfo: {
exp: CompilerDOM.ElementNode | CompilerDOM.ExpressionNode;
tag: string;
offset: number;
offsets: [number, number | undefined];
isComponentIsShorthand?: boolean;
} | undefined;

Expand All @@ -64,7 +64,7 @@ export function* generateComponent(
dynamicTagInfo = {
exp: prop.exp,
tag: prop.exp.content,
offset: prop.exp.loc.start.offset,
offsets: [prop.exp.loc.start.offset, undefined],
isComponentIsShorthand: prop.arg.loc.end.offset === prop.exp.loc.end.offset
};
props = props.filter(p => p !== prop);
Expand All @@ -77,7 +77,7 @@ export function* generateComponent(
dynamicTagInfo = {
exp: node,
tag: node.tag,
offset: startTagOffset,
offsets: [startTagOffset, endTagOffset],
};
}

Expand Down Expand Up @@ -118,7 +118,7 @@ export function* generateComponent(
ctx,
dynamicTagInfo.tag,
dynamicTagInfo.exp,
dynamicTagInfo.offset,
dynamicTagInfo.offsets[0],
ctx.codeFeatures.all,
'(',
')',
Expand All @@ -132,8 +132,8 @@ export function* generateComponent(
yield* generateInterpolation(
options,
ctx,
dynamicTagInfo.tag,
dynamicTagInfo.exp,
dynamicTagInfo.astHolder,
dynamicTagInfo.offsets[1],
{
...ctx.codeFeatures.all,
Expand Down
Loading