danschultequb / qub-typescript-xml-vscode

This extension provides XML language support for VS Code, beyond simple text coloring.
MIT License
7 stars 0 forks source link

With alignAttributes set to true, format document doesn't align attributes #7

Closed danschultequb closed 7 years ago

danschultequb commented 7 years ago

If I have a document with the following contents:

    <sometag firstattr=""
    second="" />

And then I try to format the document with alignAttributes set to true, I would expect the result to be this:

    <sometag firstattr=""
             second="" />

Currently it doesn't respect alignAttributes, though, and results in this:

    <sometag firstattr=""
        second="" />

I have a few tests in my xml parser repository that show that this scenario works outside of the current VS Code extension. See James Fancy's review from Augutst 1, 2017 for the origin of this issue.

danschultequb commented 7 years ago

This happened because I changed the name of the extension recently ("qub-xml" to "qub-xml-vscode") but I forgot to change the names of the settings associated with the extension. To fix this problem, just make sure your alignAttributes setting is set using:

"qub-xml-vscode.formatOptions.alignAttributes": true

I also recommend updating to the latest version (1.2.5) too.

jamesfancy commented 7 years ago

@danschultequb I reinstalled the extentions and re-set qub-xml-vscode.formatOptions.alignAttributes to true. The issue is still there.

image

image

So, what's different between us and what does cause the different representation.


update at 2017-08-14 10:13 +0800

So strange. It works on another PC of mine (in office). I will try again after back home.

danschultequb commented 7 years ago

@jamesfancy I just tested this on my machine with version 1.2.6, and it seems to work fine. If you're still having issues, please send me a sample of XML that is giving you problems.

jamesfancy commented 7 years ago

@danschultequb It's ok now, thank you. Perhaps I met the problem since vscode didn't restart after the plugin updated.