diff options
author | w0rp <devw0rp@gmail.com> | 2020-09-08 22:19:13 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2020-09-08 22:19:13 +0100 |
commit | 6a367e44aa0feddd63b0e6d9505e21ca4442247e (patch) | |
tree | dde33e4215fdcd0848c170fc4eeffb9ac851693a /autoload | |
parent | 7d90ff56d96d601478f00895e009ae63a7d8b4bb (diff) | |
download | ale-6a367e44aa0feddd63b0e6d9505e21ca4442247e.zip |
Close #3003 - Show ignored linters in :ALEInfo
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale.vim | 8 | ||||
-rw-r--r-- | autoload/ale/debugging.vim | 13 | ||||
-rw-r--r-- | autoload/ale/linter.vim | 10 |
3 files changed, 24 insertions, 7 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index 5ec22f57..84003993 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -100,13 +100,7 @@ function! s:Lint(buffer, should_lint_file, timer_id) abort " Use the filetype from the buffer let l:filetype = getbufvar(a:buffer, '&filetype') let l:linters = ale#linter#Get(l:filetype) - - " Apply ignore lists for linters only if needed. - let l:ignore_config = ale#Var(a:buffer, 'linters_ignore') - let l:disable_lsp = ale#Var(a:buffer, 'disable_lsp') - let l:linters = !empty(l:ignore_config) || l:disable_lsp - \ ? ale#engine#ignore#Exclude(l:filetype, l:linters, l:ignore_config, l:disable_lsp) - \ : l:linters + let l:linters = ale#linter#RemoveIgnored(a:buffer, l:filetype, l:linters) " Tell other sources that they can start checking the buffer now. let g:ale_want_results_buffer = a:buffer diff --git a/autoload/ale/debugging.vim b/autoload/ale/debugging.vim index 4e134f8c..5e6d5906 100644 --- a/autoload/ale/debugging.vim +++ b/autoload/ale/debugging.vim @@ -8,6 +8,7 @@ let s:global_variable_list = [ \ 'ale_completion_delay', \ 'ale_completion_enabled', \ 'ale_completion_max_suggestions', +\ 'ale_disable_lsp', \ 'ale_echo_cursor', \ 'ale_echo_msg_error_str', \ 'ale_echo_msg_format', @@ -28,6 +29,7 @@ let s:global_variable_list = [ \ 'ale_linter_aliases', \ 'ale_linters', \ 'ale_linters_explicit', +\ 'ale_linters_ignore', \ 'ale_list_vertical', \ 'ale_list_window_size', \ 'ale_loclist_msg_format', @@ -196,6 +198,7 @@ function! s:EchoLSPErrorMessages(all_linter_names) abort endfunction function! ale#debugging#Info() abort + let l:buffer = bufnr('') let l:filetype = &filetype " We get the list of enabled linters for free by the above function. @@ -222,10 +225,20 @@ function! ale#debugging#Info() abort let l:fixers = uniq(sort(l:fixers[0] + l:fixers[1])) let l:fixers_string = join(map(copy(l:fixers), '"\n " . v:val'), '') + let l:non_ignored_names = map( + \ copy(ale#linter#RemoveIgnored(l:buffer, l:filetype, l:enabled_linters)), + \ 'v:val[''name'']', + \) + let l:ignored_names = filter( + \ copy(l:enabled_names), + \ 'index(l:non_ignored_names, v:val) < 0' + \) + call s:Echo(' Current Filetype: ' . l:filetype) call s:Echo('Available Linters: ' . string(l:all_names)) call s:EchoLinterAliases(l:all_linters) call s:Echo(' Enabled Linters: ' . string(l:enabled_names)) + call s:Echo(' Ignored Linters: ' . string(l:ignored_names)) call s:Echo(' Suggested Fixers: ' . l:fixers_string) call s:Echo(' Linter Variables:') call s:Echo('') diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index b483fc19..645c25f9 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -394,6 +394,16 @@ function! ale#linter#Get(original_filetypes) abort return reverse(l:combined_linters) endfunction +function! ale#linter#RemoveIgnored(buffer, filetype, linters) abort + " Apply ignore lists for linters only if needed. + let l:ignore_config = ale#Var(a:buffer, 'linters_ignore') + let l:disable_lsp = ale#Var(a:buffer, 'disable_lsp') + + return !empty(l:ignore_config) || l:disable_lsp + \ ? ale#engine#ignore#Exclude(a:filetype, a:linters, l:ignore_config, l:disable_lsp) + \ : a:linters +endfunction + " Given a buffer and linter, get the executable String for the linter. function! ale#linter#GetExecutable(buffer, linter) abort let l:Executable = a:linter.executable |