DeltaXML / vscode-xslt-tokenizer

VSCode extension for highlighting XSLT and XPath (upto 3.0/3.1)
MIT License
46 stars 4 forks source link

Feature request: XSD intellisense #46

Open ArclightSA opened 3 years ago

ArclightSA commented 3 years ago

This extension has amazing support for XSLT 3.0, so I need to ask if this feature is planned to be added.

Currently in VS 2019, you can specify a schema (.xsd) file for a namespace, and it will inspect that schema to provide IntelliSense suggestions when you type using that namespace. This works even if you set the default namespace, then all un-prefixed items get the benefit of the code suggestions. For example, in our XSLT files, we set the default namespace in the header like so:

xmlns="http://www.cloudquoteafrica.com/siberix"

Is this something that already works in this extension (did I miss a setting somewhere)? If not, is it something that you are considering adding?

pgfearo commented 3 years ago

Thank you for this feedback. One of the reasons XSD support is missing right now is that it is hard to do this without adding an external dependancy for Java or .NET.

The Red Hat XML Extension does have this feature. I think they are looking at removing the need for a separate Java JRE installation also.

In the mean time I will continue to research how feasible it would be to add XSD support here.

pgfearo commented 3 years ago

While there is still no intellisense support for XSD, the extension now provides intellisense based on the last non-XSLT file opened in Visual Studio Code.

kczx3 commented 9 months ago

I think my request is for the same. I have a XSD for the input XML document but since the XML input is dynamic I don't have an XML document to open for the extension to then use it for intellisense. It would be awesome if this extension supported the xsl:importSchema element to get the information needed for XPath autocompletion.

pgfearo commented 9 months ago

@kczx3 I've yet to understand on how to best implement this XSD feature, but as a workaround, Is it possible to generate an XML document instance from your Schema? There are quite a few tools that do this which should work with most if not all XML Schemas.

If you can, a recently added extension feature may help. This lets you click on the 'auto-complete' label in the status bar to semi-permanently fix the XML document used for auto-completion. The XML document path is then stored in the current VS Code workspace, so your auto-completion will based on this file.