redhat-developer / redhat-developer/quarkus-ls
Unexpected parser error with select sections
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 50
- Forks
- 18
- Avg merge
- 22h 11m
- Merged PRs (30d)
- 3
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/parser/TemplateParser.java around line 352 and reproduce the template with empty #else, #case, and #is sections. Trace how their closing tags are matched. Done means these valid sections parse without the SECTION_BLOCK_END_DOES_NOT_MATCH_START error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100