diff options
author | Alex Piechowski <alex@piechowski.io> | 2021-12-28 04:23:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-28 20:23:57 +0900 |
commit | 48f68598cb49c5711f31d9ed204a4f0fdc390330 (patch) | |
tree | 5522796651f64bbb590d1ed63e76c86f2ba17204 /autoload/ale/fixers/crystal.vim | |
parent | dcec4b3c37880c0564b62b5a8e7ec424c64c8333 (diff) | |
download | ale-48f68598cb49c5711f31d9ed204a4f0fdc390330.zip |
Add auto-fixer for crystal (#4016)
Diffstat (limited to 'autoload/ale/fixers/crystal.vim')
-rw-r--r-- | autoload/ale/fixers/crystal.vim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/autoload/ale/fixers/crystal.vim b/autoload/ale/fixers/crystal.vim new file mode 100644 index 00000000..4ba702ba --- /dev/null +++ b/autoload/ale/fixers/crystal.vim @@ -0,0 +1,14 @@ +call ale#Set('crystal_format_executable', 'crystal') +call ale#Set('crystal_format_options', '') + +function! ale#fixers#crystal#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'crystal_format_executable') + let l:options = ale#Var(a:buffer, 'crystal_format_options') + + return { + \ 'command': ale#Escape(l:executable) + \ . ' tool format' + \ . ale#Pad(l:options) + \ . ' -' + \} +endfunction |