GitXplorerGitXplorer
k

lspoints

public
19 stars
6 forks
4 issues

Commits

List of commits on branch main.
Verified
0e58571787ce00bd3d9fa4b44d7fe327bf711257

Merge pull request #17 from mityu/attach-callback-bufnr

kkuuote committed a month ago
Verified
6c0355f60fc83c22eb49b2f4e5f02cd7dda31abb

Merge pull request #11 from mityu/fix-lspformat

kkuuote committed a month ago
Verified
a44f3edd8a97a60a96f8f46ab8f3a530eed749e0

Merge pull request #18 from tani/main

kkuuote committed a month ago
Unverified
108e1de4615096eef60f9373c8f5447c204ecb9e

fix: formatting via lsp is broken for another buffer

mmityu committed 4 months ago
Verified
695fbebf2e09e1c27bff474e727bbe918ccdedee

Update README.md

ttani committed 3 months ago
Verified
a096f97baa1d14214ef9c2aae793b8fea4e95b2f

Update README.md

ttani committed 3 months ago

README

The README file for this repository.

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

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