Fix #2544 - Completion positions are off by one

This commit is contained in:
w0rp 2019-05-30 10:26:09 +01:00
parent 4f02edc3f8
commit 27146ade32
No known key found for this signature in database
GPG Key ID: 0FC1ECAA8C81CD83
2 changed files with 3 additions and 6 deletions

View File

@ -521,10 +521,7 @@ function! s:OnReady(linter, lsp_details) abort
let l:message = ale#lsp#message#Completion(
\ l:buffer,
\ b:ale_completion_info.line,
\ min([
\ b:ale_completion_info.line_length,
\ b:ale_completion_info.column,
\ ]) + 1,
\ b:ale_completion_info.column,
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),
\)
endif

View File

@ -219,7 +219,7 @@ Execute(The right message should be sent for the initial LSP request):
\ }],
\ [0, 'textDocument/completion', {
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
\ 'position': {'line': 0, 'character': 3},
\ 'position': {'line': 0, 'character': 2},
\ }],
\ ],
\ g:message_list
@ -280,7 +280,7 @@ Execute(Two completion requests shouldn't be sent in a row):
\ }],
\ [0, 'textDocument/completion', {
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
\ 'position': {'line': 0, 'character': 3},
\ 'position': {'line': 0, 'character': 2},
\ }],
\ ],
\ g:message_list