Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/language-server/src/lib/documents/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,8 @@ export function isInsideMoustacheTag(html: string, tagStart: number | null, posi
// TODO make this just check for '{'?
// Theoretically, someone could do {a < b} in a simple moustache tag
charactersBeforePosition.lastIndexOf('{#'),
charactersBeforePosition.lastIndexOf('{:')
charactersBeforePosition.lastIndexOf('{:'),
charactersBeforePosition.lastIndexOf('{@')
) > charactersBeforePosition.lastIndexOf('}')
);
} else {
Expand Down
12 changes: 12 additions & 0 deletions packages/language-server/test/lib/documents/parseHtml.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ describe('parseHtml', () => {
);
});

it('ignore binary operator inside @const', () => {
testRootElements(
parseHtml(
`{#if foo}
{@const bar = 1 << 2}
<Foo />
{/if}
<style></style>`
)
);
});

it('ignore less than operator inside control flow moustache', () => {
testRootElements(
parseHtml(
Expand Down