Asynchronous LSP Gateway Plugin powered by denops.vim
Warning
As it is made for study, it may behave weird or break suddenly.
You need to install lspoints with denops as follows:
Plug 'vim-denops/denops.vim'
Plug 'kuuote/lspoints'
Important
As lspoints is a gateway, you achive no functionalities without extensions. The following graph is the overview of the architecture.
graph LR
subgraph Lspoints
direction TB
copilot-langauge-server ---|LSP| lspoints
deno_lsp ---|LSP| lspoints
efm-langserver ---|LSP| lspoints
end
lspoints --- lspoints-copilot
lspoints --- ddc-source-lsp
lspoints --- lspoints-hover
lspoints --- nvim_diagnostics
lspoints --- format
format --- Vim/Neovim
nvim_diagnostics --- Vim/Neovim
lspoints-hover --- Vim/Neovim
lspoints-copilot --- Vim/Neovim
ddc-source-lsp --- Vim/Neovim
To use lspoints, you need to configure two things.
- What language servers are available.
- What extensions are available.
function s:attach_denols() abort
call lspoints#attach('denols', #{
\ cmd: ['deno', 'lsp'],
\ initializationOptions: #{
\ enable: v:true,
\ unstable: v:true,
\ suggest: #{
\ autoImports: v:false,
\ },
\ },
\ })
endfunction
autocmd FileType typescript,typescriptreact call s:attach_denols()
You need to specify extension to be used.
let g:lspoints#extensions = ['nvim_diagnostics', 'format']
Alternatively, you can load extensions dynamically.
call lspoints#load_extensions(['nvim_diagnostics', 'format'])
The example is just a combined version of the above code.
let g:lspoints#extensions = ['nvim_diagnostics', 'format']
function s:attach_denols() abort
call lspoints#attach('denols', #{
\ cmd: ['deno', 'lsp'],
\ initializationOptions: #{
\ enable: v:true,
\ unstable: v:true,
\ suggest: #{
\ autoImports: v:false,
\ },
\ },
\ })
endfunction
autocmd FileType typescript,typescriptreact call s:attach_denols()
Again, you will not get any functionality without extensions. Please read the documentation of the extensions. You can find the lspoint extensions at https://github.com/search?q=lspoints&type=repositories .
This is an extension to integrate lspoints into the diagnostic function of Neovim.
You need to add 'nvim_diagnostics'
to g:lspoints#extensions
.
let g:lspoints#extensions = ['nvim_diagnostics']
This extension automatically displays diagnostics in Neovim. You do not need to do anything.
This is an extension to call format function of language servers.
You need to add 'format'
to g:lspoints#extensions
.
let g:lspoints#extensions = ['format']
When you call denops#request('lspoints', 'executeCommand', ['format', 'execute', bufnr()])
, the language server formats your code.
nnoremap mf <Cmd>call denops#request('lspoints', 'executeCommand', ['format', 'execute', bufnr()])<CR>
© 2024 Kuuote