-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Make use of installed formatters? #850
Comments
What formatter do you have and for which section are you using them for? We cannot just hook Vetur into untrusted dependencies. |
You'll have to excuse my ignorance, as I've never authored a VS Code extension, so I don't know what is or isn't possible. I'm not suggesting hooking Vetur into arbitrary dependencies, but instead make use of a (perhaps a non-existing) VS Code API that might format a string of code (extracted from a Vue file) for a given Language. If it were possible, it would make Vetur more of a delegate and the formatting possibilities would be endless. Given this thread, I'm guessing maybe it's not currently possible with VS Code, but it seems like a rather straight forward and likely valuable idea. Are there other file formats similar to Edit: Maybe I am suggesting Vetur use arbitrary dependencies to format each section, but the trust would come from the fact that the user decided to install the extensions in the first place. If no extensions were installed and assuming you weren't doing anything special, you would still get formatting through VS Code's defaults for HTML, JavaScript, and CSS. |
As you mentioned, if you have 5 HTML formatters, there is no way for Vetur to say "use the third one". There is no API for getting a list of available formatters for a specific language or for getting currently active formatter. |
So that's it, just closed? Does the idea not have merit? VS Code is open source and always evolving, certainly it's worth pursuing? |
You can open issues on VS Code repo. Until they offer an API, there is nothing I can do. |
Info
This seems like a dumb question, but a very real possibility, so I have to ask...
Is it not possible to make use of already-installed formatter extensions in VS Code to do Vetur's bidding? Meaning if I already have a formatter for HTML, JavaScript, and CSS installed and configured how I like, is there not some VS Code API available to just format those sections?
If not, should we not urge VS Code to somehow expose this as a possibility? It seems like it would reduce a ton of potentially duplicative efforts and make this extension that much better.
The text was updated successfully, but these errors were encountered: