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

feature request: use vscode config for formatting inline template #4

Open
sandangel opened this issue Jan 25, 2018 · 3 comments
Open

Comments

@sandangel
Copy link

I had add vscode config html "html.format.wrapAttributes": "force-aligned", but the formatter ignored it and every attribute just go on 1 line make template hard to read.

Can you add support use vscode html config to format inline template?

@onixie
Copy link
Owner

onixie commented Feb 13, 2018

It's a bit tricky, cuz I use vscode-xml internally to format inline template. And as you can see it is for xml, and html settings are totally ignored. I'll consider how to make it, but maybe a little bit time needed.

@sandangel
Copy link
Author

don't worry, this is an open source project. In the meantime can you tell me why we don't use vscode html formatter? Is it feasible to replace vscode-xml with something like vscode-html? And it would be great if we can have formatOnSave feature.

@onixie
Copy link
Owner

onixie commented Feb 14, 2018

yes, I admit html can be more appropriate than xml on this subject, though templates are often not valid html.
Actually the reason to choose vscode-xml is quite accidental. The html formatter was more troublesome when dealing with bindings in template. Since bindings are js-like expressions, people can write code like *ngIf="1 < 2" which make html formatter paralysis. BTW, the xml formatter cannot help the case either, but work a bit better.

P.S., there are some other html formatter extensions in marketplace, but even worse than the default one .

formatOnSave can be another feature, I do think it is useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants