-
Notifications
You must be signed in to change notification settings - Fork 67
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
How to ExecuteCommand for servers which provides custom commands #563
Comments
The whole setup could be more filetype specific, see also #562 As a new user, the list of |
I suggested a new command for it, but not sure if we really need it. I mean, LSP sends the available custom commands through the We could have those commands appended to the Code Actions (since they work pretty similar)? btw, I used |
I am new to this plug-in. What was missing in
|
I don't believe it has the behavior I need. RegisterCmdHandler listen to commands that comes from the server and do actions as needed. The example you shared (from the doc) wait for a What I need is a way to call a command from the client. Calling a |
Okay, so this is for receiving from the server instead of sending. I wonder how
But in principle # autoload/lsp/codeaction.vim (lines 15-26)
export def DoCommand(lspserver: dict<any>, cmd: dict<any>)
if cmd->has_key('command') && CommandHandlers->has_key(cmd.command)
var CmdHandler: func = CommandHandlers[cmd.command]
try
call CmdHandler(cmd)
catch
util.ErrMsg($'"{cmd.command}" handler raised exception {v:exception}')
endtry
else
lspserver.executeCommand(cmd)
endif
enddef could be used, which at the moment is only used in
|
TSServer implements custom commands which can be used to trigger some actions.
https://github.com/typescript-language-server/typescript-language-server?tab=readme-ov-file#workspace-commands-workspaceexecutecommand
Is there a way in the client to call those custom actions?
Maybe a
:LspExecuteCommand _typescript.organizeImports
?The text was updated successfully, but these errors were encountered: