mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 21:44:47 +08:00
Fix #2544 - Completion positions are off by one
This commit is contained in:
@@ -521,10 +521,7 @@ function! s:OnReady(linter, lsp_details) abort
|
|||||||
let l:message = ale#lsp#message#Completion(
|
let l:message = ale#lsp#message#Completion(
|
||||||
\ l:buffer,
|
\ l:buffer,
|
||||||
\ b:ale_completion_info.line,
|
\ b:ale_completion_info.line,
|
||||||
\ min([
|
|
||||||
\ b:ale_completion_info.line_length,
|
|
||||||
\ b:ale_completion_info.column,
|
\ b:ale_completion_info.column,
|
||||||
\ ]) + 1,
|
|
||||||
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),
|
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),
|
||||||
\)
|
\)
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ Execute(The right message should be sent for the initial LSP request):
|
|||||||
\ }],
|
\ }],
|
||||||
\ [0, 'textDocument/completion', {
|
\ [0, 'textDocument/completion', {
|
||||||
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
|
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
|
||||||
\ 'position': {'line': 0, 'character': 3},
|
\ 'position': {'line': 0, 'character': 2},
|
||||||
\ }],
|
\ }],
|
||||||
\ ],
|
\ ],
|
||||||
\ g:message_list
|
\ g:message_list
|
||||||
@@ -280,7 +280,7 @@ Execute(Two completion requests shouldn't be sent in a row):
|
|||||||
\ }],
|
\ }],
|
||||||
\ [0, 'textDocument/completion', {
|
\ [0, 'textDocument/completion', {
|
||||||
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
|
\ 'textDocument': {'uri': ale#path#ToURI(expand('%:p'))},
|
||||||
\ 'position': {'line': 0, 'character': 3},
|
\ 'position': {'line': 0, 'character': 2},
|
||||||
\ }],
|
\ }],
|
||||||
\ ],
|
\ ],
|
||||||
\ g:message_list
|
\ g:message_list
|
||||||
|
|||||||
Reference in New Issue
Block a user