redhat-developer / redhat-developer/quarkus-ls

Go to definition for broken tag in Qute template causes `Exception`

Open
#855 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug definition qute
Dominant language
Java
Stars
50
Forks
18
Avg merge
22h 11m
Merged PRs (30d)
3

Description

Given the following template:

{# foo=1 /} {! NO_SECTION_NAME !}

If you hover over the #, then the following Exception occurs:

stack trace
SEVERE: Internal error: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "tagName" is null
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "tagName" is null
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "tagName" is null
	at com.redhat.qute.project.QuteProject.findUserTag(QuteProject.java:420)
	at com.redhat.qute.services.QuteDefinition.findDefinitionFromParameter(QuteDefinition.java:476)
	at com.redhat.qute.services.QuteDefinition.findDefinition(QuteDefinition.java:97)
	at com.redhat.qute.services.QuteLanguageService.findDefinition(QuteLanguageService.java:146)
	at com.redhat.qute.ls.template.TemplateFileTextDocumentService.lambda$definition$14(TemplateFileTextDocumentService.java:212)
	at com.redhat.qute.ls.commons.ModelTextDocuments.lambda$computeModelAsyncCompose$1(ModelTextDocuments.java:144)
	at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
	... 6 more

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with QuteProject.findUserTag(), identified in the stack trace, and follow its callers in QuteDefinition.findDefinitionFromParameter() and findDefinition(). Reproduce the hover action using the template shown in the issue. Done means the broken tag no longer causes an exception during go-to-definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.