summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/refmt.vim
blob: 514f950a9e5a3a528e1fd6874f4bfc08534e7b9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
" Author: Ahmed El Gabri <@ahmedelgabri>
" Description: Integration of refmt with ALE.

call ale#Set('reasonml_refmt_executable', 'refmt')
call ale#Set('reasonml_refmt_options', '')

function! ale#fixers#refmt#Fix(buffer) abort
    let l:executable = ale#Var(a:buffer, 'reasonml_refmt_executable')
    let l:options = ale#Var(a:buffer, 'reasonml_refmt_options')

    return {
    \   'command': ale#Escape(l:executable)
    \       . (empty(l:options) ? '' : ' ' . l:options)
    \       . ' --in-place'
    \       . ' %t',
    \   'read_temporary_file': 1,
    \}
endfunction