-
Notifications
You must be signed in to change notification settings - Fork 2
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
Configuration for non-default formatter? #4
Comments
I don't think this would be possible. In the current implementation I'm calling VSCode's Format Document action that in turn calls the default formatter (in this case prettier). I can't directly call a specific extension AFAIK. This is my first VS Code extension, so my knowledge is very limited. You may try changing your default formatter for typescript files or in that particular workspace: "[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.formatOnSave": false,
"editor.codeActionsOnSave": ["source.fixAll.format", "source.fixAll.eslint"]
}, |
Hm, yeah.. wonder if there's another API to call
The use case is to actually use multiple formatters in a row 😓 (Prettier first, then the built-in TS/JS thing) |
Oh.. Will try to look into if that's possible and expose multiple actions. You might be interested in prettier/prettier-vscode#1555 |
Oh, nice - thanks for the heads up! I've subscribed over there too. |
Hi @rohit-gohri 👋
I would like to run a non-default formatter on a specific file (namely the
TypeScript and JavaScript Language Features
, in order to format SQL in tagged template literals), and I was wondering whether you would be open to adding support for other, non-default formatters (eg. "Format Document With...")?Not sure how the configuration would look, maybe something like:
Or, as an example, to format using Prettier if it's not the default:
Not sure if that kind of configuration is supported though. I guess the minimal version of this feature would be to provide a single key like:
But then again, that would mean a key for any supported formatter. However, maybe it's an ok tradeoff... 🤔
The text was updated successfully, but these errors were encountered: