diff options
author | Nick Gavalas <njg@fb.com> | 2018-09-10 18:55:49 -0400 |
---|---|---|
committer | Nick Gavalas <njg@fb.com> | 2018-09-12 15:47:57 -0400 |
commit | b4513fc4b0381bdff00c52e294e6da6c7f27aa19 (patch) | |
tree | 6100777ec89473e95393894e6d375282b3979618 /autoload | |
parent | 78af99c2566ef8fed443ce253e0de9323b9e5043 (diff) | |
download | ale-b4513fc4b0381bdff00c52e294e6da6c7f27aa19.zip |
fix non-. prefix triggers overfiltering results
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/completion.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index e96774c3..2556d50c 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -98,14 +98,15 @@ function! ale#completion#GetTriggerCharacter(filetype, prefix) abort return '' endfunction -function! ale#completion#Filter(buffer, suggestions, prefix) abort +function! ale#completion#Filter(buffer, filetype, suggestions, prefix) abort let l:excluded_words = ale#Var(a:buffer, 'completion_excluded_words') + let l:triggers = s:GetFiletypeValue(s:trigger_character_map, a:filetype) " For completing... " foo. " ^ " We need to include all of the given suggestions. - if a:prefix is# '.' + if index(l:triggers, a:prefix) >= 0 let l:filtered_suggestions = a:suggestions else let l:filtered_suggestions = [] @@ -369,7 +370,7 @@ function! ale#completion#ParseLSPCompletions(response) abort endfor if has_key(l:info, 'prefix') - return ale#completion#Filter(l:buffer, l:results, l:info.prefix) + return ale#completion#Filter(l:buffer, &filetype, l:results, l:info.prefix) endif return l:results @@ -390,6 +391,7 @@ function! ale#completion#HandleTSServerResponse(conn_id, response) abort if l:command is# 'completions' let l:names = ale#completion#Filter( \ l:buffer, + \ &filetype, \ ale#completion#ParseTSServerCompletions(a:response), \ b:ale_completion_info.prefix, \)[: g:ale_completion_max_suggestions - 1] |