Skip to content

Commit

Permalink
perf
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Aug 30, 2024
1 parent 2cc52bd commit 4a98355
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/language-core/lib/parsers/scriptSetupRanges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ export function parseScriptSetupRanges(
});
ts.forEachChild(ast, child => visitNode(child, [ast]));

const templateRefNames = new Set(templateRefs.map(ref => ref.name));
bindings = bindings.filter(range => {
const name = ast.text.substring(range.start, range.end);
return templateRefs.every(ref => ref.name !== name);
const name = text.substring(range.start, range.end);
return !templateRefNames.has(name);
});

return {
Expand Down

0 comments on commit 4a98355

Please sign in to comment.