Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Jan 8, 2025
1 parent f7a1cba commit 116a294
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export class DocumentHighlightProviderImpl implements DocumentHighlightProvider
const endTag = '/' + name;
const endTagStart = content.lastIndexOf(endTag, candidate.end);

if (endTagStart < startTagStart) {
return null; // can happen in loose parser mode for unclosed tags
}

ranges.push([endTagStart, endTagStart + endTag.length]);

if (candidate.type === 'EachBlock' && candidate.else) {
Expand Down
2 changes: 1 addition & 1 deletion packages/language-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export function startServer(options?: LSOptions) {
},
documentHighlightProvider:
evt.initializationOptions?.configuration?.svelte.plugin.svelte
?.documentHighlight?.enable === false
?.documentHighlight?.enable === true
}
};
});
Expand Down

0 comments on commit 116a294

Please sign in to comment.