helix
helix copied to clipboard
Add LSP workspace command picker
LSPs can communicate that they can run additional commands via the executeCommandProvider. This adds a picker for these commands. To use it you need to map it to e.g. <space>W.
For a default keybind for this, I think <space>c could make sense.
We should find a default keybind for this before merging - it looks like there's a bug with the command palette where it can't create any new pickers (for example running the jumplist picker command from the command palette)
I agree with <space>c as a mnemonic for "command". I'll add the keybinding. But ultimately I'm not 100% sure this should have a default keybinding, as only very few LSP actually use this, so most users won't need it. I guess it can't hurt though.
I think a typable command would be a better fit here. It's not as widely used as the other LSP features like goto-*, and I would consider the space layer of keybinds to be precious real estate that we will run out off too fast if we're not careful. Making it a typable commands also makes it easy to remap in the config.
It would be cool if the command could accept the command as an optional argument without opening the picker.
As suggested I added the command name as an optional argument. This should make it really useful for adding a custom keybinding to run a specific command.
I just tried this out using the typescript-language-server and it looks like some workspace actions are NOOP. For instance, running Organize Imports does nothing in Helix while it does correctly sort the imports when I run the same command in Sublime Text or VSCode.
I just tried this out using the
typescript-language-serverand it looks like some workspace actions are NOOP. For instance, runningOrganize Importsdoes nothing in Helix while it does correctly sort the imports when I run the same command in Sublime Text or VSCode.
Maybe this LSP server modifies the file outside of the editor. What happens when you reload the file in helix ?
I just tried this out using the
typescript-language-serverand it looks like some workspace actions are NOOP. For instance, runningOrganize Importsdoes nothing in Helix while it does correctly sort the imports when I run the same command in Sublime Text or VSCode.Maybe this LSP server modifies the file outside of the editor. What happens when you reload the file in helix ?
Yep. That seem to be case. Reloading the file manually works. Not ideal. But it works.