]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
none: rephrase the word and var and default value of additionalTextEdits
authorshane.xb.qian <shane.qian@foxmail.com>
Thu, 13 Apr 2023 17:19:13 +0000 (01:19 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Thu, 13 Apr 2023 17:19:13 +0000 (01:19 +0800)
Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
autoload/lsp/completion.vim
autoload/lsp/options.vim
doc/lsp.txt

index 7702e6d9a872e093cbe8679599710e6c952537b6..25039f2965fb66ecd979e8aec01fb40feaa21308 100644 (file)
@@ -517,7 +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
+      || !opt.lspOptions.completionTextEdit
     return
   endif
 
index b7690633f80c694488f9cdb3814a0a0fb80e99f5..3a6e75331247201daffea579f6d55476f90a120c 100644 (file)
@@ -33,9 +33,10 @@ 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,
+  # If true, apply the LSP server supplied text edits after a completion.
+  # If a snippet plugin is going to apply the text edits, then set this to
+  # false to avoid applying the text edits twice.
+  completionTextEdit: true,
   # instead of the signature
   noDiagHoverOnLine: true,
   # Suppress adding a new line on completion selection with <CR>
index 43478e0d22c2ab6363e38f934ec9369f3ede5560..84dcfb8c19a5a74d62107961b91e6aa266d58618 100644 (file)
@@ -395,10 +395,11 @@ 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.
+completionTextEdit     |Boolean| option.  If true, apply the LSP server
+                       supplied text edits after a completion.  If a snippet
+                       plugin is going to apply the text edits, then set
+                       this to false to avoid applying the text edits twice.
+                       By default this is set to true.
                                                *lsp-opt-noDiagHoverOnLine*
 noDiagHoverOnLine      |Boolean| option.  Suppress diagnostic hover from
                        appearing when the mouse is over the line instead of