]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
feat: make additionalTextEdits be possible to disable
authorshane.xb.qian <shane.qian@foxmail.com>
Thu, 13 Apr 2023 16:48:39 +0000 (00:48 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Thu, 13 Apr 2023 16:48:39 +0000 (00:48 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/completion.vim
autoload/lsp/options.vim
doc/lsp.txt

index dbf5b7e50d84906406549aefec560b433e506e73..7702e6d9a872e093cbe8679599710e6c952537b6 100644 (file)
@@ -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
 
index f69365feb9d86e06cf99c9b862896981cdc302be..b7690633f80c694488f9cdb3814a0a0fb80e99f5 100644 (file)
@@ -33,6 +33,9 @@ export var lspOptions: dict<any> = {
   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 <CR>
index 291936ea1d590c907a6711a1eccad152aaf96bc3..43478e0d22c2ab6363e38f934ec9369f3ede5560 100644 (file)
@@ -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 <CR>.