From 2f23313004cccdabbc95ad6ffef6795cddff5c87 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Fri, 21 Oct 2022 09:18:51 -0700 Subject: [PATCH] autocomplete overwrites the dot character in typescript files. Fixes issue #71 --- autoload/lsp/handlers.vim | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/autoload/lsp/handlers.vim b/autoload/lsp/handlers.vim index 9757e0a..0523b55 100644 --- a/autoload/lsp/handlers.vim +++ b/autoload/lsp/handlers.vim @@ -161,15 +161,20 @@ def ProcessCompletionReply(lspserver: dict, req: dict, reply: dicthas_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. -- 2.48.1