redhat-developer / quarkus-ls

Language server for Quarkus tooling
Eclipse Public License 2.0
44 stars 15 forks source link

Unexpected parser error with select sections #844

Open JessicaJHee opened 1 year ago

JessicaJHee commented 1 year ago

The following case should be allowed since there are no errors when Quarkus is built:

{#if true}
Hello
{#else}
Hi
{/else}  --> unexpected error is reported here
{/if}
Parser error: section block end tag [else] does not match the start tag [else]

qute(SECTION_BLOCK_END_DOES_NOT_MATCH_START)

This issue happens with #else, #case, and #is sections that are declared as empty sections here: https://github.com/redhat-developer/quarkus-ls/blob/0726aa5d09e5a8eaeec2b0cc9da30e2a4966f0ba/qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/parser/template/TemplateParser.java#L352