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

Closing CDATA tag throws exception #341

Closed
fbricon opened this issue Apr 3, 2019 · 0 comments
Closed

Closing CDATA tag throws exception #341

fbricon opened this issue Apr 3, 2019 · 0 comments
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 Apr 3, 2019

With lsp4xml 0.5.0 from master, given

<script>
   <![CDATA[
      <message>Foo</message>
   ]]
</script>

when you type the closing bracket on L4, an exception is thrown:

Message: Internal error: java.lang.ClassCastException: org.eclipse.lsp4xml.dom.DOMCDATASection cannot be cast to org.eclipse.lsp4xml.dom.DOMElement
java.util.concurrent.CompletionException: java.lang.ClassCastException: org.eclipse.lsp4xml.dom.DOMCDATASection cannot be cast to org.eclipse.lsp4xml.dom.DOMElement
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:604)
	at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
	at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused by: java.lang.ClassCastException: org.eclipse.lsp4xml.dom.DOMCDATASection cannot be cast to org.eclipse.lsp4xml.dom.DOMElement
	at org.eclipse.lsp4xml.services.XMLCompletions.doTagComplete(XMLCompletions.java:341)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doTagComplete(XMLLanguageService.java:193)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doAutoClose(XMLLanguageService.java:203)
	at org.eclipse.lsp4xml.XMLLanguageServer.lambda$closeTag$1(XMLLanguageServer.java:211)
	at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
	... 6 more

There's no such error in lsp4xml 0.4.0

@fbricon fbricon added bug Something isn't working completion This issue or enhancement is related to completion support regression labels Apr 3, 2019
@fbricon fbricon added this to the v0.5.0 milestone Apr 3, 2019
NikolasKomonen added a commit to NikolasKomonen/lsp4xml that referenced this issue Apr 4, 2019
Fixes eclipse-lemminx#341

Signed-off-by: Nikolas Komonen <[email protected]>
fbricon pushed a commit that referenced this issue Apr 4, 2019
Fixes #341

Signed-off-by: Nikolas Komonen <[email protected]>
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

No branches or pull requests

1 participant