Open angelozerr opened 6 years ago
@fbricon @NikolasKomonen I will try to study this issue. If I can implement it, I think it will be easy to add advanced features for a lot of XML files (web.xml, pom.xml, etc).
Please give me your feedback.
FWIW, as I'm likely to write extensions for XML-LS one day, I'd rather not see XPath involved as it's not so fun to use and test and debug.
Instead, I would like the extension "service" to just give me the current node I may extend or not, and -in Java- I'll code on 1st line whether I extend or not. A canProcess(Node node)
in the extension interface would be welcome and more comfortable than XPath-based queries.
So -as a XPath hater- I suggest that unless you have a specific request, you ignore or close this ticket.
Managing custom completion, validation, hyperlink is often the same thing (ex: completion on files, on other XML elements, etc).
Using a system XPath can be really easy to add completion. Takes a sample:
here we wish to manage
We could declare this behaviour with some path like this:
which could manage directly those 3 features without coding something.
I had implemented this idea for WTP XML Editor in the project https://github.com/angelozerr/eclipse-wtp-xml-search and you have some examples:
for jetty XML file: https://github.com/angelozerr/eclipse-wtp-xml-search/blob/master/jetty/org.eclipse.jst.server.jetty.xml.core/plugin.xml#L38
for web.xml : https://github.com/angelozerr/eclipse-wtp-xml-search/blob/master/web/org.eclipse.jst.jee.web.xml/plugin.xml#L25