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

NPE in CodeLens with empty XML file #1396

Closed
angelozerr opened this issue Dec 8, 2022 · 2 comments · Fixed by #1397
Closed

NPE in CodeLens with empty XML file #1396

angelozerr opened this issue Dec 8, 2022 · 2 comments · Fixed by #1397
Assignees
Labels
bug Something isn't working codelens
Milestone

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Dec 8, 2022

Create an empty XML file. You will see in the log

[Error - 16:14:05] Dec 08, 2022 04:14:05 org.eclipse.lemminx.services.XMLCodeLens getCodelens()
Message: Error while processing code lens for the participant 'org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCodeLensParticipant'.
java.lang.NullPointerException
	at org.eclipse.lemminx.utils.XMLPositionUtility.createRange(XMLPositionUtility.java:935)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCodeLensParticipant.createReferencedGrammarLenses(ContentModelCodeLensParticipant.java:94)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCodeLensParticipant.doCodeLens(ContentModelCodeLensParticipant.java:80)
	at org.eclipse.lemminx.services.XMLCodeLens.getCodelens(XMLCodeLens.java:51)
	at org.eclipse.lemminx.services.XMLLanguageService.getCodeLens(XMLLanguageService.java:255)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$codeLens$21(XMLTextDocumentService.java:448)
	at org.eclipse.lemminx.commons.ModelTextDocuments.lambda$computeModelAsync$0(ModelTextDocuments.java:118)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:479)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)
@angelozerr angelozerr added bug Something isn't working codelens labels Dec 8, 2022
@angelozerr
Copy link
Contributor Author

@JessicaJHee or @datho7561 could you have time to investigate the problem please?

@datho7561
Copy link
Contributor

I can take a look at it.

@datho7561 datho7561 self-assigned this Dec 8, 2022
datho7561 added a commit to datho7561/lemminx that referenced this issue Dec 8, 2022
Closes eclipse#1396

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 added this to the 0.23.0 milestone Dec 8, 2022
angelozerr pushed a commit that referenced this issue Dec 9, 2022
Closes #1396

Signed-off-by: David Thompson <davthomp@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 codelens
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants