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

Add support for textDocument/typeDefinition from XML to XMLSchema/DTD #510

Merged
merged 1 commit into from
Jul 17, 2019

Conversation

angelozerr
Copy link
Contributor

Fix #371

Signed-off-by: azerr azerr@redhat.com

@angelozerr
Copy link
Contributor Author

You can play with this XSD Type Definition PR, but my code is very ugly. XSD Type definition works with global and local xs:element local and global. xs:attribute is not implemented yet. I will work on it after cleaning my code and writing tests.

Here a demo:

XSDTypeDefinitionDemo

@fbricon
Copy link
Contributor

fbricon commented Jul 12, 2019

java.io.FileNotFoundException: /fbricon/.lsp4xml/cache/http/maven.apache.org/xsd/maven-4.0.0.xsd (No such file or directory)
	at java.io.FileInputStream.open0(Native Method)
	at java.io.FileInputStream.open(FileInputStream.java:195)
	at java.io.FileInputStream.<init>(FileInputStream.java:138)
	at com.google.common.io.Files$FileByteSource.openStream(Files.java:129)
	at com.google.common.io.Files$FileByteSource.read(Files.java:153)
	at com.google.common.io.ByteSource$AsCharSource.read(ByteSource.java:470)
	at org.eclipse.lsp4xml.extensions.xsd.contentmodel.CMXSDDocument.findTypeLocation(CMXSDDocument.java:239)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelTypeDefinitionParticipant.findTypeDefinition(ContentModelTypeDefinitionParticipant.java:30)
	at org.eclipse.lsp4xml.services.XMLTypeDefinition.findTypeDefinition(XMLTypeDefinition.java:52)
	at org.eclipse.lsp4xml.services.XMLLanguageService.findTypeDefinition(XMLLanguageService.java:220)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$typeDefinition$15(XMLTextDocumentService.java:321)
	at java.util.concurrent.CompletableFuture.biApply(CompletableFuture.java:1105)
	at java.util.concurrent.CompletableFuture$BiApply.tryFire(CompletableFuture.java:1070)
	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)

@fbricon
Copy link
Contributor

fbricon commented Jul 12, 2019

cache location should be /Users/fbricon/.lsp4xml/cache/ instead of /fbricon/.lsp4xml/cache

@angelozerr angelozerr force-pushed the xsd-type-def branch 3 times, most recently from 461ae40 to 8e67709 Compare July 15, 2019 15:52
@angelozerr
Copy link
Contributor Author

@fbricon please retry this PR. I have written several tests and all are passing. My code should be clean now. Thank's for your review.

@angelozerr angelozerr force-pushed the xsd-type-def branch 8 times, most recently from e0861ac to c15c6f5 Compare July 17, 2019 08:44
@angelozerr
Copy link
Contributor Author

@fbricon I have rebase my PR and finish to write tests. You can review it when you will have time.

@fbricon fbricon merged commit c1e0a34 into master Jul 17, 2019
@angelozerr angelozerr deleted the xsd-type-def branch July 18, 2019 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for textDocument/typeDefinition from XML to XMLSchema/DTD
2 participants