Introduce g:lsp_settings_disable_suggestions (#265)

* Introduce g:lsp_settings_disable_suggestions

* Problem: When you use lsp for certain filetypes, you see
  "Please do :LspInstallServer to enable Language Server" message
  every time when you open a file that you don't need lsp supports.
  It's hard to disable all the possible filetypes but the one
  you use.
* Solution: Provide a way to opt-out the messages.

* Revserse the role

* Reverse even more
This commit is contained in:
ujihisa
2020-06-26 17:55:08 -07:00
committed by GitHub
parent f267543158
commit 87b47864e2
2 changed files with 7 additions and 1 deletions

View File

@@ -477,7 +477,7 @@ function! s:vim_lsp_load_or_suggest(ft) abort
delcommand LspRegisterServer
if l:disabled == 0 && l:found ==# 0
if a:ft !=# '_'
if a:ft !=# '_' && get(g:, 'lsp_settings_enable_suggestions', 1) == 1
call s:vim_lsp_settings_suggest(a:ft)
endif
else

View File

@@ -122,6 +122,12 @@ and put schemas property like below:
}
<
*g:lsp_settings_enable_suggestions*
g:lsp_settings_enable_suggestions
Default: 1
Set 0 only if you'd like to opt-out "Please do :LspInstallServer to enable
Language Server" suggestion messages.
:LspSettingsLocalEdit [root] *:LspSettingsLocalEdit*
Edit local settings. Accepts an optional explicit [root] directory that
contains the .vim-lsp-settings config directory.