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 ContentModelCompletionParticipant.addCompletionItem #720

Closed
fbricon opened this issue May 25, 2020 · 0 comments · Fixed by #721
Closed

NPE in ContentModelCompletionParticipant.addCompletionItem #720

fbricon opened this issue May 25, 2020 · 0 comments · Fixed by #721
Assignees
Labels
bug Something isn't working completion This issue or enhancement is related to completion support regression
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented May 25, 2020

Given the following xml:

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"[
<!ENTITY mdash "&#x2014;">
]>
m| 
<web-app>
  <display-name>Servlet 2.3 Web Application</display-name>
</web-app>

when typing anything outside the nodes, I get an NPE:

[Error - 2:10:18 PM] May 25, 2020 02:10:18 org.eclipse.lemminx.services.XMLCompletions collectOpenTagSuggestions()
Message: While performing ICompletionParticipant#onTagOpen
java.lang.IllegalArgumentException: Property must not be null: label
	at org.eclipse.lsp4j.util.Preconditions.checkNotNull(Preconditions.java:29)
	at org.eclipse.lsp4j.CompletionItem.<init>(CompletionItem.java:144)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCompletionParticipant.addCompletionItem(ContentModelCompletionParticipant.java:244)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCompletionParticipant.fillWithChildrenElementDeclaration(ContentModelCompletionParticipant.java:183)
	at org.eclipse.lemminx.extensions.contentmodel.participants.ContentModelCompletionParticipant.onTagOpen(ContentModelCompletionParticipant.java:65)
	at org.eclipse.lemminx.services.XMLCompletions.collectOpenTagSuggestions(XMLCompletions.java:608)
	at org.eclipse.lemminx.services.XMLCompletions.collectInsideContent(XMLCompletions.java:733)
	at org.eclipse.lemminx.services.XMLCompletions.doComplete(XMLCompletions.java:224)
	at org.eclipse.lemminx.services.XMLLanguageService.doComplete(XMLLanguageService.java:139)
	at org.eclipse.lemminx.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:189)
	at java.base/java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1307)
	at java.base/java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1276)
	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:1016)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:177)

There's no issue with vscode-xml 0.11.0, so it's a regression

@fbricon fbricon added bug Something isn't working good first issue Good for newcomers completion This issue or enhancement is related to completion support regression labels May 25, 2020
angelozerr added a commit that referenced this issue May 25, 2020
Fixes #720

Signed-off-by: azerr <azerr@redhat.com>
angelozerr added a commit that referenced this issue May 25, 2020
Fixes #720

Signed-off-by: azerr <azerr@redhat.com>
@angelozerr angelozerr added this to the 0.12.0 milestone May 25, 2020
@angelozerr angelozerr removed the good first issue Good for newcomers label May 25, 2020
@angelozerr angelozerr self-assigned this May 25, 2020
fbricon pushed a commit that referenced this issue May 25, 2020
Fixes #720

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 completion This issue or enhancement is related to completion support regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants