diff --git a/ale_linters/coffee/coffee.vim b/ale_linters/coffee/coffee.vim index 243fec6..ac9ef79 100644 --- a/ale_linters/coffee/coffee.vim +++ b/ale_linters/coffee/coffee.vim @@ -1,10 +1,23 @@ " Author: KabbAmine - https://github.com/KabbAmine " Description: Coffee for checking coffee files +function! ale_linters#coffee#coffee#GetExecutable(buffer) abort + return ale#util#ResolveLocalPath( + \ a:buffer, + \ 'node_modules/.bin/coffee', + \ 'coffee' + \) +endfunction + +function! ale_linters#coffee#coffee#GetCommand(buffer) abort + return ale_linters#coffee#coffee#GetExecutable(a:buffer) + \ . ' -cp -s' +endfunction + call ale#linter#Define('coffee', { \ 'name': 'coffee', -\ 'executable': 'coffee', -\ 'command': 'coffee -cp -s', +\ 'executable_callback': 'ale_linters#coffee#coffee#GetExecutable', +\ 'command_callback': 'ale_linters#coffee#coffee#GetCommand', \ 'output_stream': 'stderr', \ 'callback': 'ale#handlers#HandleGCCFormat', \})