Skip to content

kuuote/lspoints

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lspoints

Asynchronous LSP Gateway Plugin powered by denops.vim

Warning

As it is made for study, it may behave weird or break suddenly.

Installation

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
Loading

Configuration

To use lspoints, you need to configure two things.

  1. What language servers are available.
  2. What extensions are available.

Language servers

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()

Extensions

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'])

Configuration example

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()

Further readings

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 .

nvim_diagnostics for lspoints (builtin)

This is an extension to integrate lspoints into the diagnostic function of Neovim.

Installation

You need to add 'nvim_diagnostics' to g:lspoints#extensions.

let g:lspoints#extensions = ['nvim_diagnostics']

Usage

This extension automatically displays diagnostics in Neovim. You do not need to do anything.

format for lspoints (builtin)

This is an extension to call format function of language servers.

Installation

You need to add 'format' to g:lspoints#extensions.

let g:lspoints#extensions = ['format']

Usage

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

About

Asynchronous LSP Gateway Plugin for denops.vim

Resources

License

Stars

Watchers

Forks

Packages

No packages published