diff options
author | w0rp <w0rp@users.noreply.github.com> | 2020-08-09 01:32:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-09 01:32:27 +0100 |
commit | 8bfb5c64073cf12018e5b7e115867b2ef4dfa7e0 (patch) | |
tree | 872bd1184510a99d263860dd19998c8663b0c754 /autoload | |
parent | 2d174db5b2a9a405285fa58eb37f508aee4726bf (diff) | |
parent | 4222f32cc4d2f04e2ea7764b72f9f2fe106c71d7 (diff) | |
download | ale-8bfb5c64073cf12018e5b7e115867b2ef4dfa7e0.zip |
Merge pull request #2849 from DonnieWest/excludeTsserverWarnings
Allow the user to remove warnings from completions
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/completion.vim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index b00fc6a3..f5e25cd0 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -17,6 +17,7 @@ let g:ale_completion_delay = get(g:, 'ale_completion_delay', 100) let g:ale_completion_excluded_words = get(g:, 'ale_completion_excluded_words', []) let g:ale_completion_max_suggestions = get(g:, 'ale_completion_max_suggestions', 50) let g:ale_completion_tsserver_autoimport = get(g:, 'ale_completion_tsserver_autoimport', 0) +let g:ale_completion_tsserver_remove_warnings = get(g:, 'ale_completion_tsserver_remove_warnings', 0) let s:timer_id = -1 let s:last_done_pos = [] @@ -397,10 +398,14 @@ function! ale#completion#ParseTSServerCompletions(response) abort let l:names = [] for l:suggestion in a:response.body - call add(l:names, { - \ 'word': l:suggestion.name, - \ 'source': get(l:suggestion, 'source', ''), - \}) + let l:kind = get(l:suggestion, 'kind', '') + + if g:ale_completion_tsserver_remove_warnings == 0 || l:kind isnot# 'warning' + call add(l:names, { + \ 'word': l:suggestion.name, + \ 'source': get(l:suggestion, 'source', ''), + \}) + endif endfor return l:names |