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

Support executing LSP commands #13756

Open
1 task done
Feel-ix-343 opened this issue Jul 2, 2024 · 6 comments
Open
1 task done

Support executing LSP commands #13756

Feel-ix-343 opened this issue Jul 2, 2024 · 6 comments
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] language server An umbrella label for all language servers markdown Markdown markup support

Comments

@Feel-ix-343
Copy link
Contributor

Check for existing issues

  • Completed

Describe the feature

Some language servers use the LSP command interface to provide some more custom functionality.

Popular editors such as vscode and neovim support this.

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

I find how helix implements this (though incomplete) to be pretty great UX. Here is a gif of me using LSP commands with my language server markdown-oxide to open some daily notes.

helix-command

@notpeter notpeter added editor Feedback for code editing, formatting, editor iterations, etc markdown Markdown markup support language server An umbrella label for all language servers and removed triage labels Jul 3, 2024
@rcjsuen
Copy link

rcjsuen commented Jul 31, 2024

interface ClientCapabilities {
	workspace?: {
		/**
		 * The client supports applying batch edits
		 * to the workspace by supporting the request
		 * 'workspace/applyEdit'
		 */
		applyEdit?: boolean;
	}
}

From what I can tell here, applyEdit is not currently declared as a capability. Some language servers will "execute" the requested commands by actually delegating back to the client to apply a WorkspaceEdit (by sending a workspace/applyEdit request to the client) so Zed should take a look at the workspace/applyEdit request also when looking at workspace/executeCommand.

@kelveden
Copy link

As a reference, here is the specification for execute command.

From a selfish perspective, I'd love to see this feature added to enable us Clojure engineers to leverage some of the s-expression specific "power tools" from clojure-lsp - as you can see from that matrix, there are a bunch of those commands that aren't exposed as code actions.

@AlbertMarashi
Copy link
Contributor

AlbertMarashi commented Sep 9, 2024

Need this to close some SvelteKit missing type issues

@lnay
Copy link
Contributor

lnay commented Oct 2, 2024

There is currently no way (as far as I am aware) to send a textDocument/build or textDocument/forwardSearch to the language server. These are non-standard requests implemented by texlab which are important for LaTeX and the lack of these pushes users to configure bespoke tasks tailored to their setup (rzukic/zed-latex#29).

Ideally users would have these requests associated to a keybinding.

I envision a solution where the zed_extension_api exposes a way to send these requests, and allow them to register actions which can send these requests, and be bound by the user to a key combination. The internal Rust extension seems to have the ability to directly register tasks, however they can only run executables.

@AlbertMarashi
Copy link
Contributor

+1 on that. I also wanted an ability for extensions to expose actions that use some of the underlying LSP features

@lnay
Copy link
Contributor

lnay commented Nov 13, 2024

Maybe tag "extension infrastructure"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] language server An umbrella label for all language servers markdown Markdown markup support
Projects
None yet
Development

No branches or pull requests

6 participants