Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork77
Development
Details
There are
java.*actions that's being called by Language Servers. Following are the definedcommands in VSCodeAs client,nvim-java-refactor registers client commands to
vim.lsp.commandsat jdtls LS attach live we have donehereGod knows where is the documentation that defines the approach to handle the action on client side but we could try to replicate what VSCode is doing.
- First of all, I would start by grep searching the command in VSCode Java project. Ex:-
java.action.overrideMethodsPrompt - Commands are defined as constants incommands.ts file
- Do a reference check and find the client command implementation. Ex:-source
- Sometimes we might have to send some LSP requests to complete the command.source
- Some functions such as
apply_workspace_editis available throughvim.lsp.util
- First of all, I would start by grep searching the command in VSCode Java project. Ex:-
Details
We are usingrequest function ofvim.lsp.Client function to communicate withthejdtls.
fun(method:string,params:table?,handler:lsp.Handler?,bufnr:integer?):boolean,integer?`)
This has almost 1 to 1 mapping withvscode APIs most of the time.
awaitthis.languageClient.sendRequest(method:string,params: any,// handler is not passed since there is async / await// buffer I'm guessing is set to current buffer by default???);
However, some APIs sends more arguments, to which we don't have a Neovim luaequivalent I'm guessing. Following is an example.
awaitthis.languageClient.sendRequest(CompileWorkspaceRequest.type,isFullCompile,token,);
To make this request, probablyclient.rpc.request should be used withoutrequest() wrapper.