summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/refmt.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/ale/fixers/refmt.vim')
-rw-r--r--autoload/ale/fixers/refmt.vim18
1 files changed, 18 insertions, 0 deletions
diff --git a/autoload/ale/fixers/refmt.vim b/autoload/ale/fixers/refmt.vim
new file mode 100644
index 00000000..514f950a
--- /dev/null
+++ b/autoload/ale/fixers/refmt.vim
@@ -0,0 +1,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