Skip to content
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

Autodetect parser name with prettier by default #11558

Merged
merged 5 commits into from May 15, 2024

Conversation

SomeoneToIgnore
Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore commented May 8, 2024

Closes #11517

  • Removes forced prettier parser name for languages, making auto command to run prettier on every file by default.
  • Moves prettier configs away from plugin language declarations into language settings

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 8, 2024
@SomeoneToIgnore SomeoneToIgnore self-assigned this May 10, 2024
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/prettier-parser-names branch 2 times, most recently from cef20fd to 8dfa2f9 Compare May 15, 2024 12:48
@SomeoneToIgnore SomeoneToIgnore force-pushed the kb/prettier-parser-names branch 2 times, most recently from ed22c92 to 7dbffe9 Compare May 15, 2024 14:21
@SomeoneToIgnore
Copy link
Contributor Author

Removed language configs from current repo's plugins: vue, svelte, typescript, javascript, php, markdown, css, json, tsx, yaml, html, astro.
The following languages got a settings entry, but are external and still have old prettier declarations in them: sql, xml (seems to have used an odd plugin name according to https://prettier.io/docs/en/plugins fixed here), java, twig, scss, blade, graphql, twig

@maxdeviant
Copy link
Member

Removed language configs from current repo's plugins: vue, svelte, typescript, javascript, php, markdown, css, json, tsx, yaml, html, astro. The following languages got a settings entry, but are external and still have old prettier declarations in them: sql, xml (seems to have used an odd plugin name according to https://prettier.io/docs/en/plugins fixed here), java, twig, scss, blade, graphql, twig

@SomeoneToIgnore We might want to leave the field in the config.toml for all of the languages that are implemented as extensions, as otherwise it will be a breaking change for older versions of Zed.

So newer versions of Zed will just ignore that field, and after some time has passed then we can remove them.

@SomeoneToIgnore SomeoneToIgnore merged commit cb430fc into main May 15, 2024
8 checks passed
@SomeoneToIgnore SomeoneToIgnore deleted the kb/prettier-parser-names branch May 15, 2024 19:51
osiewicz pushed a commit to RemcoSmitsDev/zed that referenced this pull request May 18, 2024
Closes zed-industries#11517 

* Removes forced prettier parser name for languages, making `auto`
command to run prettier on every file by default.
* Moves prettier configs away from plugin language declarations into
language settings

Release Notes:

- N/A
SomeoneToIgnore added a commit that referenced this pull request May 25, 2024
…no path (#12273)

Follow-up of
#12095 (comment)
reverting back part of #11558
that was related to `language.toml` parsing.

Now all extensions that define `prettier_parser_name` in their language
configs, will enable formatting untitled buffers without any extra
language settings like

```json
{
  "languages": {
    "JSON": {
      "prettier": {
        "allowed": true,
        "parser": "json"
      }
    }
  }
}
```



Release Notes:

- Improved ergonomics of untitled buffer formatting with prettier, no
extra language settings are needed by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zed forces Prettier to opt out of its usual parser inference
2 participants