question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't report formatting capability for disabled languages

See original GitHub issue

Is 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:

https://github.com/prettier/prettier-vscode/blob/4fb0cd18ea5f7b61379eabd605a40742187e3798/src/LanguageResolver.ts#L33

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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lonix1commented, Feb 12, 2021

Same problem here

"prettier.disableLanguages": [
  // ...
  "typescript",
]

But when opening a .ts file, I get “choose your formatter” prompt.

I can suppress the prompt by doing:

"[typescript]": { "editor.defaultFormatter": "vscode.typescript-language-features" }

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.

0reactions
github-actions[bot]commented, Jun 12, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

DISABILITY-INCLUSIVE LANGUAGE GUIDELINES
Avoid labelling people and do not mention a person's disability or impairment unless it is relevant, particularly in internal communications and emails. You ......
Read more >
Disability - APA Style - American Psychological Association
The language used should be selected with the understanding that disabled people's expressed preferences regarding identification supersede matters of style.
Read more >
Section 1557: Frequently Asked Questions | HHS.gov
Frequently Asked Questions on the Estimates for the Top 15 Languages Spoken by Individuals with Limited English Proficiency. Frequently Asked Questions on ...
Read more >
Guidelines for Writing About People With Disabilities
This factsheet provides guidelines for portraying individuals with disabilities in a respectful and balanced way by using language that is accurate, neutral and ......
Read more >
ADA Requirements - Effective Communication
This publication is designed to help title II and title III entities understand how the rules for effective communication apply to them.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found