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

Wrong primary language_server for formatting #11288

Open
1 task done
luckydye opened this issue May 2, 2024 · 5 comments · May be fixed by #11390
Open
1 task done

Wrong primary language_server for formatting #11288

luckydye opened this issue May 2, 2024 · 5 comments · May be fixed by #11390
Labels
defect [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc

Comments

@luckydye
Copy link
Contributor

luckydye commented May 2, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When trying to run formatting via lsp, it does not use the right language server.

I tried to to prioritise them with the "language_servers" settings like this:

"language_servers": [
    "biome",
    "typescript-language-server",
    "!eslint"
],

But I noticed it will still only use "typescript-language-server" to format the buffer.

Printing the language_server.name() to logs:
image
Should be "biome_lsp".

Environment

Zed: v0.135.0 (Zed Dev d8ca153)
OS: macOS 14.2.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@luckydye luckydye added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels May 2, 2024
@maxdeviant
Copy link
Member

@luckydye What do you have your "formatter setting set to? Is it "formatter": "language_server"?

@luckydye
Copy link
Contributor Author

luckydye commented May 2, 2024

@maxdeviant
Yes, these are my exact settings:

{
  "formatter": "language_server",
  "language_servers": [
    "biome",
    "typescript-language-server",
    "!eslint",
    "..."
  ]
}

@JosephTLyons JosephTLyons added language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc language server An umbrella label for all language servers and removed triage Maintainer needs to classify the issue admin read Pending admin review labels May 3, 2024
@luckydye
Copy link
Contributor Author

luckydye commented May 4, 2024

Maybe it would make sense to have a setting like this?

{
  "formatter": {
    "language_server": "biome"
  }
}

@unitythemaker
Copy link

This works for me, doesn't it work on you?

  "formatter": {
    "code_actions": {
      "source.fixAll.eslint": true
    }
  },

@luckydye
Copy link
Contributor Author

@unitythemaker source.fixAll fixes linting errors in most cases. This may work for for eslint, but its not a universal solution. Mainly because eslint sees formatting errors as lint errors, but biome for example, follows a different philosophy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors setting Feedback for preferences, configuration, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants