redhat-developer/vscode-xml

Plugin is not recognized as a XML formatter

Closed this issue ยท 9 comments

Even if the plugin is installed, it isn't recognized as a suitable XML formatter when trying to format a XML document, but the message "There is no formatter for 'xml'-files installed" is shown instead.

Screenshot 2019-06-07 at 09 55 52

Could you try disabling all extensions, then enabling only the XML one.

Also just to verify, do you have a JDK installed an setup? Are features like autocompletion or linting working?

Another thing to check is the preference "xml.format.enabled" and make sure that is 'true'

hello @NikolasKomonen ,

this is the same for me.
I already disabled all my extensions and this is still not working.
image

Also my JAVA_HOME directory is set
image

xorye commented

Thank you for reporting this issue.

Could you please go to the command palette (Ctrl+Shift+P), run "Show Running Extensions" and verify that the extension is running?

If the extension is running, it should look like this:
image

Are features like auto completion and linting working at all?

Are you attempting to format by clicking "Format Document" in the right-click context menu, or are you using Ctrl+Shift+I ? Does the "Format Document" option exist?

After disabling all extensions and enable this plugin again, everything works as expected. Now, I am enabling the other disabled extensions again. So far, there are no problems.

Thanks.

@xorye ,

After leaving it alone and focusing on other tasks, I see that now is working, also with other extensions.
What I haven't done until now, is saving the file as an XML, only formatted as an XML; should this be an issue?

Also, Ctrl+Shift+I enables a multi-line for me, but that one I think is a thing from my settings.
It's working now, adding the mention that the file must be saved as an XML before it could recognize the errors, formatting and so on.

Maybe there is something that I am doing wrong...?

xorye commented

This definitely seems like an issue with the XML extension. I was able to reproduce the issue and am currently investigating it.

Until the next release that fixes this issue, as a workaround, just save your document as an xml file.

I'm having the same issue, but saving the new file doesn't fix the problem. I've enabled/disabled the other extensions until I found the culprit: ms-toolsai.jupyter-keymap

If redhat.vscode-xml is loaded first, I can't format XML. if redhat.vscode-xml is loaded after ms-toolsai.jupyter-keymap then I can format XML (with all extensions enabled). I rarely use Jupyter and haven't tested whether loading them in this order inhibits any features of that extension.

microsoft/vscode-jupyter-keymap#19

@TBemrose do you benefit with other features like validation when you have the XML formatter problem?