Skip to content

Commit

Permalink
fix(language-core): drop duplicate hints on incomplete tag (#4696)
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX authored Aug 25, 2024
1 parent 8eda337 commit 23dbcea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/language-core/lib/codegen/template/element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ export function* generateComponent(
): Generator<Code> {
const startTagOffset = node.loc.start.offset + options.template.content.substring(node.loc.start.offset).indexOf(node.tag);
const endTagOffset = !node.isSelfClosing && options.template.lang === 'html' ? node.loc.start.offset + node.loc.source.lastIndexOf(node.tag) : undefined;
const tagOffsets = endTagOffset !== undefined
? [startTagOffset, endTagOffset]
: [startTagOffset];
const tagOffsets =
endTagOffset !== undefined && endTagOffset > startTagOffset
? [startTagOffset, endTagOffset]
: [startTagOffset];
const propsFailedExps: {
node: CompilerDOM.SimpleExpressionNode;
prefix: string;
Expand Down

0 comments on commit 23dbcea

Please sign in to comment.