mirror of
https://github.com/dense-analysis/ale
synced 2025-02-16 12:16:56 +00:00
Add separated func for deoplete
Deoplete needs `get_complete_position` method and it has a different signature. It already fetches the input string and attempts to detect the position with `\k*` regexp patterns.
This commit is contained in:
parent
f5a908bf99
commit
e0f8304860
@ -215,6 +215,10 @@ function! ale#completion#GetCompletionPosition() abort
|
|||||||
return l:column - len(l:match) - 1
|
return l:column - len(l:match) - 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! ale#completion#GetCompletionPositionForDeoplete(input) abort
|
||||||
|
return match(a:input, '\k*$')
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! ale#completion#GetCompletionResult() abort
|
function! ale#completion#GetCompletionResult() abort
|
||||||
if exists('b:ale_completion_result')
|
if exists('b:ale_completion_result')
|
||||||
return b:ale_completion_result
|
return b:ale_completion_result
|
||||||
|
@ -27,8 +27,10 @@ class Source(Base):
|
|||||||
self.input_pattern = r'(\.|::|->)\w*$'
|
self.input_pattern = r'(\.|::|->)\w*$'
|
||||||
|
|
||||||
# Returns an integer for the start position, as with omnifunc.
|
# Returns an integer for the start position, as with omnifunc.
|
||||||
def get_completion_position(self):
|
def get_complete_position(self, context):
|
||||||
return self.vim.call('ale#completion#GetCompletionPosition')
|
return self.vim.call(
|
||||||
|
'ale#completion#GetCompletionPositionForDeoplete', context['input']
|
||||||
|
)
|
||||||
|
|
||||||
def gather_candidates(self, context):
|
def gather_candidates(self, context):
|
||||||
# Stop early if ALE can't provide completion data for this buffer.
|
# Stop early if ALE can't provide completion data for this buffer.
|
||||||
|
Loading…
Reference in New Issue
Block a user