diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fixers/xo.vim | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/autoload/ale/fixers/xo.vim b/autoload/ale/fixers/xo.vim index 06e58508..6c2901db 100644 --- a/autoload/ale/fixers/xo.vim +++ b/autoload/ale/fixers/xo.vim @@ -2,8 +2,17 @@ " Description: Fixing files with XO. function! ale#fixers#xo#Fix(buffer) abort - let l:executable = ale#handlers#xo#GetExecutable(a:buffer, 'javascript') - let l:options = ale#handlers#xo#GetOptions(a:buffer, 'javascript') + let l:filetype = getbufvar(a:buffer, '&filetype') + let l:type = '' + + if l:filetype =~# 'javascript' + let l:type = 'javascript' + elseif l:filetype =~# 'typescript' + let l:type = 'typescript' + endif + + let l:executable = ale#handlers#xo#GetExecutable(a:buffer, l:type) + let l:options = ale#handlers#xo#GetOptions(a:buffer, l:type) return { \ 'command': ale#node#Executable(a:buffer, l:executable) |