aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-07 02:44:09 +0200
committerGitHub <noreply@github.com>2021-09-07 02:44:09 +0200
commit00294b84031711013a385f18c0fb0e8db84ebaf9 (patch)
treee45de668229c6b41643c5d1fa0fdb5beb0ff60fa /plugin
parentlazily require servers for faster startup times (#77) (diff)
downloadmason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.gz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.bz2
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.lz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.xz
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.tar.zst
mason-00294b84031711013a385f18c0fb0e8db84ebaf9.zip
add direct integration with libuv instead of going through termopen, also implement a UI (#79)
* add direct integration with libuv instead of going through termopen, also implement a UI * alleged free perf boosts yo that's free cycles
Diffstat (limited to 'plugin')
-rw-r--r--plugin/nvim-lsp-installer.vim29
1 files changed, 19 insertions, 10 deletions
diff --git a/plugin/nvim-lsp-installer.vim b/plugin/nvim-lsp-installer.vim
index cd610f3c..1cd772ef 100644
--- a/plugin/nvim-lsp-installer.vim
+++ b/plugin/nvim-lsp-installer.vim
@@ -10,36 +10,45 @@ function! s:MapServerName(servers) abort
endfunction
function! s:LspInstallCompletion(...) abort
- return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer'.get_available_servers()"))), "\n")
+ return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_available_servers()"))), "\n")
endfunction
function! s:LspUninstallCompletion(...) abort
- return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer'.get_installed_servers()"))), "\n")
+ return join(sort(s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_installed_servers()"))), "\n")
endfunction
-function! s:LspInstall(server_name) abort
- call luaeval("require'nvim-lsp-installer'.install(_A)", a:server_name)
+function! s:LspInstall(server_names) abort
+ for server_name in split(a:server_names, " ")
+ call luaeval("require'nvim-lsp-installer'.install(_A)", server_name)
+ endfor
endfunction
-function! s:LspUninstall(server_name) abort
- call luaeval("require'nvim-lsp-installer'.uninstall(_A)", a:server_name)
+function! s:LspUninstall(server_names) abort
+ for server_name in split(a:server_names, " ")
+ call luaeval("require'nvim-lsp-installer'.uninstall(_A)", server_name)
+ endfor
endfunction
function! s:LspUninstallAll() abort
- for server in s:MapServerName(luaeval("require'nvim-lsp-installer'.get_installed_servers()"))
+ for server in s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_installed_servers()"))
call s:LspUninstall(server)
endfor
endfunction
function! s:LspPrintInstalled() abort
- echo s:MapServerName(luaeval("require'nvim-lsp-installer'.get_installed_servers()"))
+ echo s:MapServerName(luaeval("require'nvim-lsp-installer.servers'.get_installed_servers()"))
+endfunction
+
+function! s:LspInstallInfo() abort
+ lua require'nvim-lsp-installer'.display()
endfunction
-command! -nargs=1 -complete=custom,s:LspInstallCompletion LspInstall exe s:LspInstall("<args>")
-command! -nargs=1 -complete=custom,s:LspUninstallCompletion LspUninstall exe s:LspUninstall("<args>")
+command! -nargs=+ -complete=custom,s:LspInstallCompletion LspInstall exe s:LspInstall("<args>")
+command! -nargs=+ -complete=custom,s:LspUninstallCompletion LspUninstall exe s:LspUninstall("<args>")
command! LspUninstallAll call s:LspUninstallAll()
command! LspPrintInstalled call s:LspPrintInstalled()
+command! LspInstallInfo call s:LspInstallInfo()
autocmd User LspAttachBuffers lua require"nvim-lsp-installer".lsp_attach_proxy()