]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
autocomplete overwrites the dot character in typescript files. Fixes issue #71
authorYegappan Lakshmanan <yegappan@yahoo.com>
Fri, 21 Oct 2022 16:18:51 +0000 (09:18 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Fri, 21 Oct 2022 16:18:51 +0000 (09:18 -0700)
autoload/lsp/handlers.vim

index 9757e0a5c708bc3ce0ae5eaf51c47f822a803ce7..0523b55435a6b80cf1abd12546f62d37f9b82e3f 100644 (file)
@@ -161,15 +161,20 @@ def ProcessCompletionReply(lspserver: dict<any>, req: dict<any>, reply: dict<any
       return
     endif
 
-    # Find the start column for the completion.  If any of the entries
-    # returned by the LSP server has a starting position, then use that.
     var start_col: number = 0
-    for item in items
-      if item->has_key('textEdit')
-       start_col = item.textEdit.range.start.character + 1
-       break
-      endif
-    endfor
+
+    # FIXME: The following doesn't work with typescript as one of the
+    # completion item has a start column that is before the special character.
+    # For example, when completing the methods for "str.", the dot is removed.
+    #
+    # # Find the start column for the completion.  If any of the entries
+    # # returned by the LSP server has a starting position, then use that.
+    # for item in items
+    #   if item->has_key('textEdit')
+    #     start_col = item.textEdit.range.start.character + 1
+    #     break
+    #   endif
+    # endfor
 
     # LSP server didn't return a starting position for completion, search
     # backwards from the current cursor position for a non-keyword character.