aboutsummaryrefslogtreecommitdiff
path: root/.vim/after/plugin/yegappan-lsp.vim
diff options
context:
space:
mode:
Diffstat (limited to '.vim/after/plugin/yegappan-lsp.vim')
-rw-r--r--.vim/after/plugin/yegappan-lsp.vim39
1 files changed, 21 insertions, 18 deletions
diff --git a/.vim/after/plugin/yegappan-lsp.vim b/.vim/after/plugin/yegappan-lsp.vim
index 1f1ef45..3c1a9dc 100644
--- a/.vim/after/plugin/yegappan-lsp.vim
+++ b/.vim/after/plugin/yegappan-lsp.vim
@@ -1,23 +1,26 @@
packadd yegappan-lsp
-" Go language server
-call LspAddServer([#{
- \ name: 'golang',
- \ filetype: ['go', 'gomod'],
- \ omnicompl: v:true,
- \ path: exepath('gopls'),
- \ args: ['serve'],
- \ syncInit: v:true
- \ }])
-
-call LspAddServer([#{
- \ name: 'ruby',
- \ filetype: ['ruby'],
- \ omnicompl: v:true,
- \ path: exepath('solargraph'),
- \ args: ['stdio'],
- \ syncInit: v:true
- \ }])
+if executable('gopls')
+ call LspAddServer([#{
+ \ name: 'golang',
+ \ filetype: ['go', 'gomod'],
+ \ omnicompl: v:true,
+ \ path: exepath('gopls'),
+ \ args: ['serve'],
+ \ syncInit: v:true
+ \ }])
+endif
+
+if executable('solargraph')
+ call LspAddServer([#{
+ \ name: 'ruby',
+ \ filetype: ['ruby'],
+ \ omnicompl: v:true,
+ \ path: exepath('solargraph'),
+ \ args: ['stdio'],
+ \ syncInit: v:true
+ \ }])
+endif
call LspOptionsSet(#{
\ aleSupport: v:true,