GitXplorerGitXplorer
k

lspoints

public
19 stars
6 forks
4 issues

Commits

List of commits on branch main.
Verified
32516e44416a37d6b8a64bed3d3de881c3485a6e

Add README

ttani committed 3 months ago
Unverified
f35ee809f96b625c441ba6fcff039979a2cd2d9f

fix: missing argument prefix

kkuuote committed 3 months ago
Unverified
3bcc972788a3e24e09de60caf0d0569080e18340

fix: don't use default argument

kkuuote committed 3 months ago
Unverified
55f73e9bc6fb87a9f9e567ce98912585467d094d

faet: add `lspoints#request_async()`

kkuuote committed 3 months ago
Unverified
93df6a72856758dadac9ef1d2e2a707b5ff7699a

feat: add bufnr information in LspointsAttach autocmd

mmityu committed 3 months ago
Unverified
5f9329b0683b064d3c11677a44861f12abe1775d

feat: add bufnr argument in AttachCallback

mmityu 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