Fix #500 - Support defining aliases for linter names

This commit is contained in:
w0rp
2017-05-27 21:27:42 +01:00
parent 8e997ac231
commit aca5a00fb7
6 changed files with 156 additions and 33 deletions

View File

@@ -105,6 +105,22 @@ function! s:EchoCommandHistory() abort
endfor
endfunction
function! s:EchoLinterAliases(all_linters) abort
let l:first = 1
for l:linter in a:all_linters
if !empty(l:linter.aliaes)
if !l:first
echom ' Linter Aliases:'
endif
let l:first = 0
echom string(l:linter.name) . ' -> ' . string(l:linter.aliaes)
endif
endfor
endfunction
function! ale#debugging#Info() abort
let l:filetype = &filetype
@@ -120,8 +136,13 @@ function! ale#debugging#Info() abort
call extend(l:all_linters, ale#linter#GetAll(l:aliased_filetype))
endfor
let l:all_names = map(l:all_linters, 'v:val[''name'']')
let l:enabled_names = map(l:enabled_linters, 'v:val[''name'']')
let l:all_names = map(copy(l:all_linters), 'v:val[''name'']')
let l:enabled_names = map(copy(l:enabled_linters), 'v:val[''name'']')
let l:linter_aliases = []
for l:linter in l:all_linters
call add(l:linter_aliases, [l:linter.name, l:linter.aliaes])
endfor
" Load linter variables to display
" This must be done after linters are loaded.
@@ -129,6 +150,7 @@ function! ale#debugging#Info() abort
echom ' Current Filetype: ' . l:filetype
echom 'Available Linters: ' . string(l:all_names)
call s:EchoLinterAliases(l:all_linters)
echom ' Enabled Linters: ' . string(l:enabled_names)
echom ' Linter Variables:'
echom ''