Skip to content

Commit

Permalink
fix: as turple
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Aug 9, 2024
1 parent ca77deb commit 12afa71
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/language-core/lib/utils/parseSfc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,10 @@ function createBlock(node: ElementNode, source: string) {
block.scoped = true;
}
else if (p.name === 'module') {
block.module = `${
p.value?.content ?? '$style'
}::${
p.value?.content ? p.value?.loc.start.offset - node.loc.start.offset : ''
}`;
block.module = [
p.value?.content ?? '$style',
p.value?.content ? p.value?.loc.start.offset - node.loc.start.offset : undefined
] as any;
}
}
else if (type === 'script' && p.name === 'setup') {
Expand Down
4 changes: 2 additions & 2 deletions packages/language-core/lib/virtualFile/computedSfc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ export function computedSfc(
return undefined;
}
else {
const [name, offset] = (_module as string).split('::');
const [name, offset] = _module as any as [string, number?];
return {
name,
offset: base.start + Number(offset)
offset: offset ? base.start + offset : undefined
};
}
});
Expand Down

0 comments on commit 12afa71

Please sign in to comment.