From f3a70e199688b5b1ea595b3861f268ea2d7da062 Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Fri, 14 Apr 2023 00:48:39 +0800 Subject: [PATCH] feat: make additionalTextEdits be possible to disable Signed-off-by: shane.xb.qian --- autoload/lsp/completion.vim | 1 + autoload/lsp/options.vim | 3 +++ doc/lsp.txt | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/lsp/completion.vim b/autoload/lsp/completion.vim index dbf5b7e..7702e6d 100644 --- a/autoload/lsp/completion.vim +++ b/autoload/lsp/completion.vim @@ -517,6 +517,7 @@ def LspCompleteDone() var completionData: any = v:completed_item->get('user_data', '') if completionData->type() != v:t_dict || !completionData->has_key('additionalTextEdits') + || opt.lspOptions.noAdditionalTextEdits return endif diff --git a/autoload/lsp/options.vim b/autoload/lsp/options.vim index f69365f..b769063 100644 --- a/autoload/lsp/options.vim +++ b/autoload/lsp/options.vim @@ -33,6 +33,9 @@ export var lspOptions: dict = { ignoreMissingServer: false, # Focus on the location list window after LspShowReferences keepFocusInReferences: false, + # If not apply LSP server-initiated actions after completion + # specially if some others plugins had registered to do that + noAdditionalTextEdits: false, # instead of the signature noDiagHoverOnLine: true, # Suppress adding a new line on completion selection with diff --git a/doc/lsp.txt b/doc/lsp.txt index 291936e..43478e0 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -393,11 +393,17 @@ ignoreMissingServer |Boolean| option. Do not print a missing language *lsp-opt-keepFocusInReferences* keepFocusInReferences |Boolean| option. Focus on the location list window after LspShowReferences. + By default this is set to false. + *lsp-opt-noAdditionalTextEdits* +noAdditionalTextEdits |Boolean| option. If not apply LSP server-initiated + actions after completion, specially if some others + plugins had registered to do that. By default this is set to false. *lsp-opt-noDiagHoverOnLine* noDiagHoverOnLine |Boolean| option. Suppress diagnostic hover from appearing when the mouse is over the line instead of - the signature. By default this is set to true. + the signature. + By default this is set to true. *lsp-opt-noNewlineInCompletion* noNewlineInCompletion |Boolean| option. Suppress adding a new line on completion selection with . -- 2.48.1