diff options
Diffstat (limited to 'ale_linters/scala/scalac.vim')
-rw-r--r-- | ale_linters/scala/scalac.vim | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/ale_linters/scala/scalac.vim b/ale_linters/scala/scalac.vim index 551284af..3dbdd925 100644 --- a/ale_linters/scala/scalac.vim +++ b/ale_linters/scala/scalac.vim @@ -2,29 +2,14 @@ " w0rp <devw0rp@gmail.com> " Description: Basic scala support using scalac -function! ale_linters#scala#scalac#GetExecutable(buffer) abort - if index(split(getbufvar(a:buffer, '&filetype'), '\.'), 'sbt') >= 0 - " Don't check sbt files - return '' - endif - - return 'scalac' -endfunction - -function! ale_linters#scala#scalac#GetCommand(buffer) abort - let l:executable = ale_linters#scala#scalac#GetExecutable(a:buffer) - - if empty(l:executable) - return '' - endif - - return ale#Escape(l:executable) . ' -Ystop-after:parser %t' +function! s:IsSbt(buffer) abort + return index(split(getbufvar(a:buffer, '&filetype'), '\.'), 'sbt') >= 0 endfunction call ale#linter#Define('scala', { \ 'name': 'scalac', -\ 'executable_callback': 'ale_linters#scala#scalac#GetExecutable', -\ 'command_callback': 'ale_linters#scala#scalac#GetCommand', +\ 'executable_callback': {buf -> s:IsSbt(buf) ? '' : 'scalac'}, +\ 'command': '%e -Ystop-after:parser %t', \ 'callback': 'ale#handlers#scala#HandleScalacLintFormat', \ 'output_stream': 'stderr', \}) |