From 985e9b26135dd6edd499257c51165778bc695d3d Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Mon, 1 Mar 2021 01:23:44 +0800 Subject: [PATCH] disable auto showSignature - if g:LSP_Show_Signature is false --- autoload/handlers.vim | 2 +- autoload/lsp.vim | 2 +- doc/lsp.txt | 12 ++++++++---- plugin/lsp.vim | 4 ++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/autoload/handlers.vim b/autoload/handlers.vim index 923e2f3..409a6e6 100644 --- a/autoload/handlers.vim +++ b/autoload/handlers.vim @@ -25,7 +25,7 @@ def s:processInitializeReply(lspserver: dict, req: dict, reply: dicthas_key('signatureHelpProvider') + if g:LSP_Show_Signature && caps->has_key('signatureHelpProvider') var triggers = caps.signatureHelpProvider.triggerCharacters for ch in triggers exe 'inoremap ' .. ch .. ' ' .. ch .. "=lsp#showSignature()" diff --git a/autoload/lsp.vim b/autoload/lsp.vim index 62124ca..cf10b7e 100644 --- a/autoload/lsp.vim +++ b/autoload/lsp.vim @@ -306,7 +306,7 @@ def lsp#addFile(bnr: number): void exe 'autocmd InsertLeave call lsp#leftInsertMode()' # map characters that trigger signature help - if lspserver.caps->has_key('signatureHelpProvider') + if g:LSP_Show_Signature && lspserver.caps->has_key('signatureHelpProvider') var triggers = lspserver.caps.signatureHelpProvider.triggerCharacters for ch in triggers exe 'inoremap ' .. ch .. ' ' .. ch diff --git a/doc/lsp.txt b/doc/lsp.txt index 121ee95..674bf2b 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -210,10 +210,14 @@ accepts a list of LSP servers with the above information. *:LspShowSignature* :LspShowSignature Displays the signature of the symbol (e.g. a function - or method) before the cursor in a popup. The popup is - also automatically displayed in insert mode after - entering a symbol name followed by a separator (e.g. a - opening parenthesis). + or method) before the cursor in a popup. + + The popup is also automatically displayed in insert + mode after entering a symbol name followed by a + separator (e.g. a opening parenthesis). Unless if: > + let g:LSP_Show_Signature = v:false +< + Default is true. *:LspDiagShow* :LspDiagShow Creates a new location list with the diagnostics diff --git a/plugin/lsp.vim b/plugin/lsp.vim index dbfd632..4b6bb74 100644 --- a/plugin/lsp.vim +++ b/plugin/lsp.vim @@ -11,6 +11,10 @@ if !exists('g:LSP_24x7_Complete') let g:LSP_24x7_Complete = v:true endif +if !exists('g:LSP_Show_Signature') + let g:LSP_Show_Signature = v:true +endif + augroup LSPAutoCmds au! autocmd BufNewFile,BufReadPost * -- 2.48.1