RiFi2k / format-html-in-php

Basically this vscode extension uses all your standard configurations for html formatting, and your standard configurations for format on save, etc. It more or less works exactly how vscode should already work as it pertains to HTML in PHP files.
The Unlicense
33 stars 6 forks source link

Add workbench command #8

Closed DonyorM closed 5 years ago

DonyorM commented 5 years ago

Would it be possible to have a workbench command to format the html specifically when requested without having to have format onBeforeSave enabled? I'm working in a team and I don't want to unnecessarily clutter commit logs if I didn't really edit the html of a file that someone else wrote, so I want to be able to run this extension only on command.

Thanks for writing this, it looks great.

RiFi2k commented 5 years ago

This is on my radar, it's tough because VScode only allows you to register one formatting extension per language, so if I were to do that then you couldn't use PHPCBF or something like that.

I do like the idea of just a command for formatting though, would you be looking to do highlighted regions of text or the whole document? I'm assuming your looking to do specific blocks of text. On a side note what I do in this case is format the whole doc and then remove the chucks I don't want to commit with a GUI like Gitkraken. It's not the greatest solution.

DonyorM commented 5 years ago

Honestly both would be nice but I was more thinking of the whole document. Basically my issue is I'm working a team, and when I'm only editing php code, and not the surronding html, I don't want to add meaningless whitespace to the commit log, because not everyone is using this extension.

RiFi2k commented 5 years ago

Added a keybinding and right click context menu options.