Write erlc output files to the temporary directory

In particular, if we're working with a leex (.xrl) or yecc (.yrl) source
file, erlc would otherwise generate the corresponding .erl file in the
current directory (often the project root), which is generally not what
we want.

Unconditionally writing erlc output to a temporary directory also
matches Flycheck's behavior.
This commit is contained in:
Jon Parise 2017-03-10 08:23:46 -08:00
parent bd07d04670
commit 7d6b313065
1 changed files with 2 additions and 1 deletions

View File

@ -3,7 +3,8 @@
let g:ale_erlang_erlc_options = get(g:, 'ale_erlang_erlc_options', '')
function! ale_linters#erlang#erlc#GetCommand(buffer) abort
return 'erlc ' . g:ale_erlang_erlc_options . ' %t'
let l:temp_dir = has('win32') ? $TMP : $TMPDIR
return 'erlc -o ' . l:temp_dir . ' ' . g:ale_erlang_erlc_options . ' %t'
endfunction
function! ale_linters#erlang#erlc#Handle(buffer, lines) abort