-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add supported commands in server capabilities (#11850)
## Summary This PR updates the server capabilities to include the commands that Ruff supports. This is similar to how there's a list of possible code actions supported by the server. I noticed this when I was trying to find whether Helix supported workspace commands or not based on Jane's comment (#11831 (comment)) and I found the `:lsp-workspace-command` in the editor but it didn't show up anything in the picker. So, I looked at the implementation in Helix (https://github.com/helix-editor/helix/blob/9c479e6d2de3bca9dec304f9182cee2b1c0ad766/helix-term/src/commands/typed.rs#L1372-L1384) which made me realize that Ruff doesn't provide this in its capabilities. Currently, this does require `ruff` to be first in the list of language servers in the user config but that should be resolved by helix-editor/helix#10176. So, the following config should work: ```toml [[language]] name = "python" # Ruff should come first until helix-editor/helix#10176 is released language-servers = ["ruff", "pyright"] ``` ## Test Plan 1. Neovim's server capabilities output should include the supported commands: ``` executeCommandProvider = { commands = { "ruff.applyFormat", "ruff.applyAutofix", "ruff.applyOrganizeImports", "ruff.printDebugInformation" }, workDoneProgress = false }, ``` 2. Helix should now display the commands to pick from when `:lsp-workspace-command` is invoked: <img width="832" alt="Screenshot 2024-06-13 at 08 47 14" src="https://github.com/astral-sh/ruff/assets/67177269/09048ecd-c974-4e09-ab56-9482ff3d780b">
- Loading branch information
1 parent
bcbddac
commit 9dc226b
Showing
2 changed files
with
70 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters