Don't report formatting capability for disabled languages
See original GitHub issueIs your feature request related to a problem? Please describe.
The problem is: I have prettier enabled, and I want to disable it (via settings.json
) for a language that already has a formatter (like json
). When trying to format it, vscode
prompts to choose a formatter for that language.
Describe the solution you’d like
Ideally, the extension shouldn’t report the capability to format the languages set by prettier.disableLanguages
setting. I’d take a quick look at the code and it seems possible, but I don’t know if it have any other implications.
See:
Describe alternatives you’ve considered
The most cheap alternative is to just set the default formatter for that languageId
, but creating a language entry just for disabling Prettier seems not… okay(?)
There’s also the possibility to disable Prettier for a workspace that you use another formatter, but again, this don’t seem okay(?)
Additional context
–
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top GitHub Comments
Same problem here
But when opening a
.ts
file, I get “choose your formatter” prompt.I can suppress the prompt by doing:
But that seems unnecessary. And I need to do that for every language.
Related to my issue #1786. Prettier is too aggressive. There should be a
prettier.enableLanguages
setting to eliminate this problem altogether.This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.