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

XSL support to resolve XML Schema of xsl #91

Closed
angelozerr opened this issue Sep 4, 2018 · 5 comments
Closed

XSL support to resolve XML Schema of xsl #91

angelozerr opened this issue Sep 4, 2018 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@angelozerr
Copy link
Contributor

Create an extension which resolves the XML Schema of xsl according the version declared in the xsl.

@fbricon
Copy link
Contributor

fbricon commented Oct 9, 2018

master fails with

[Trace - 12:08:31 AM] Sending request 'textDocument/completion - (454)'.
java.nio.file.AccessDeniedException: /lsp4xml
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:385)
	at java.base/java.nio.file.Files.createDirectory(Files.java:689)
	at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:796)
	at java.base/java.nio.file.Files.createDirectories(Files.java:782)
	at org.eclipse.lsp4xml.extensions.xsl.XSLURIResolverExtension.resolve(XSLURIResolverExtension.java:35)
	at org.eclipse.lsp4xml.uriresolver.URIResolverExtensionManager.resolve(URIResolverExtensionManager.java:62)
	at org.eclipse.lsp4xml.dom.XMLDocument.initializeSchemaLocation(XMLDocument.java:258)
	at org.eclipse.lsp4xml.dom.XMLDocument.initializeReferencedGrammar(XMLDocument.java:212)
	at org.eclipse.lsp4xml.dom.XMLDocument.initializeReferencedGrammarIfNeeded(XMLDocument.java:200)
	at org.eclipse.lsp4xml.dom.XMLDocument.getSchemaLocation(XMLDocument.java:88)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMDocument(ContentModelManager.java:83)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMDocument(ContentModelManager.java:78)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMElement(ContentModelManager.java:73)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMElement(ContentModelManager.java:61)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelCompletionParticipant.onAttributeName(ContentModelCompletionParticipant.java:98)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectAttributeNameSuggestions(XMLCompletions.java:542)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectAttributeNameSuggestions(XMLCompletions.java:524)
	at org.eclipse.lsp4xml.services.XMLCompletions.doComplete(XMLCompletions.java:136)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doComplete(XMLLanguageService.java:82)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:144)
	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)
java.nio.file.AccessDeniedException: /lsp4xml
	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:385)
	at java.base/java.nio.file.Files.createDirectory(Files.java:689)
	at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:796)
	at java.base/java.nio.file.Files.createDirectories(Files.java:782)
	at org.eclipse.lsp4xml.extensions.xsl.XSLURIResolverExtension.resolve(XSLURIResolverExtension.java:35)
	at org.eclipse.lsp4xml.uriresolver.URIResolverExtensionManager.resolve(URIResolverExtensionManager.java:62)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMDocument(ContentModelManager.java:111)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMDocument(ContentModelManager.java:98)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMDocument(ContentModelManager.java:78)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMElement(ContentModelManager.java:73)
	at org.eclipse.lsp4xml.extensions.contentmodel.model.ContentModelManager.findCMElement(ContentModelManager.java:61)
	at org.eclipse.lsp4xml.extensions.contentmodel.participants.ContentModelCompletionParticipant.onAttributeName(ContentModelCompletionParticipant.java:98)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectAttributeNameSuggestions(XMLCompletions.java:542)
	at org.eclipse.lsp4xml.services.XMLCompletions.collectAttributeNameSuggestions(XMLCompletions.java:524)
	at org.eclipse.lsp4xml.services.XMLCompletions.doComplete(XMLCompletions.java:136)
	at org.eclipse.lsp4xml.services.XMLLanguageService.doComplete(XMLLanguageService.java:82)
	at org.eclipse.lsp4xml.XMLTextDocumentService.lambda$completion$1(XMLTextDocumentService.java:144)
	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
Copy link
Contributor Author

It's because of https://github.com/angelozerr/lsp4xml/blob/master/org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/extensions/xsl/XSLURIResolverExtension.java#L34 which tries to export XML Schema of XSL in a directory.

We must provide an export folder (with config or by default). Are you OK with that? Any idea are welcome. I will work on this issue.

@fbricon
Copy link
Contributor

fbricon commented Oct 9, 2018

yeah we need a configurable working directory.
At the very least, the default value should be a path relative to the current working directory, like .schemas/, instead of /lsp4xml, which points at the system root

angelozerr added a commit that referenced this issue Oct 9, 2018
@angelozerr
Copy link
Contributor Author

@fbricon I have tried to fix the problem (deploy is done in "user.home") and I have written test with completion. But it takes a long time because I think https://www.w3.org/2009/01/xml.xsd takes a long time to compile. I will study this problem...

@angelozerr angelozerr self-assigned this Oct 10, 2018
@angelozerr
Copy link
Contributor Author

I will study this problem...

See #159

@angelozerr angelozerr added this to the v0.0.2 milestone Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants