Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovering "missing close tag" parser error yields Exception in CodeAction code #812

Closed
datho7561 opened this issue Mar 13, 2023 · 2 comments · Fixed by #820
Closed

Hovering "missing close tag" parser error yields Exception in CodeAction code #812

datho7561 opened this issue Mar 13, 2023 · 2 comments · Fixed by #820
Assignees
Labels
bug Something isn't working qute validation
Milestone

Comments

@datho7561
Copy link
Contributor

Here is an example Qute template:

<html>

{! {#switch myString}
  {#case "asdf"}
  <h3>title</h3>
{/switch} !}

{#each items}

{#each items}
  {it.name}
{/each}

{#each items}

{#each items}
  {it.name}
{/each}



{/}

<p>
</p>

</html>

The error appears in the wrong place (it should be at the end of the file), and when you hover it, there is an Exception in the CodeAction code:

Mar. 13, 2023 12:15:55 P.M. com.redhat.qute.services.QuteCodeActions doCodeActions
SEVERE: Failed creating CodeAction Request
com.redhat.qute.ls.commons.BadLocationException: The character value, {7} of the line24}, is out of bounds.
	at com.redhat.qute.ls.commons.TreeLineTracker.getOffsetAt(TreeLineTracker.java:1246)
	at com.redhat.qute.ls.commons.TextDocument.offsetAt(TextDocument.java:71)
	at com.redhat.qute.parser.template.Template.offsetAt(Template.java:88)
	at com.redhat.qute.services.AbstractPositionRequest.<init>(AbstractPositionRequest.java:34)
	at com.redhat.qute.services.codeactions.CodeActionRequest.<init>(CodeActionRequest.java:51)
	at com.redhat.qute.services.QuteCodeActions.doCodeActions(QuteCodeActions.java:102)
	at com.redhat.qute.services.QuteLanguageService.doCodeActions(QuteLanguageService.java:104)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.lambda$codeAction$9(TemplateFileTextDocumentService.java:165)
	at com.redhat.qute.ls.commons.ModelTextDocuments.lambda$computeModelAsyncCompose$1(ModelTextDocuments.java:144)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
@datho7561 datho7561 added bug Something isn't working qute labels Mar 13, 2023
@angelozerr
Copy link
Contributor

Could you give us the location where you hover the template please?

@datho7561
Copy link
Contributor Author

datho7561 commented Mar 13, 2023

The error marker, which should appear after <p>|

angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 18, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 18, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 18, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 19, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 20, 2023
angelozerr added a commit to angelozerr/quarkus-ls that referenced this issue Mar 20, 2023
@datho7561 datho7561 added this to the 0.14.0 milestone Mar 20, 2023
datho7561 pushed a commit that referenced this issue Mar 20, 2023
errors.

Fixes #812

Signed-off-by: azerr <azerr@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working qute validation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants