mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-03 08:32:50 +08:00
Add raco_fmt fixer for Racket files (#4354)
* Add raco_fmt fixer for Racket files * Fix command and add test * Fix quoting
This commit is contained in:
@@ -570,6 +570,11 @@ let s:default_registry = {
|
||||
\ 'function': 'ale#fixers#zigfmt#Fix',
|
||||
\ 'suggested_filetypes': ['zig'],
|
||||
\ 'description': 'Official formatter for Zig',
|
||||
\ },
|
||||
\ 'raco_fmt': {
|
||||
\ 'function': 'ale#fixers#raco_fmt#Fix',
|
||||
\ 'suggested_filetypes': ['racket'],
|
||||
\ 'description': 'Fix Racket files with raco fmt.',
|
||||
\ }
|
||||
\}
|
||||
|
||||
|
||||
15
autoload/ale/fixers/raco_fmt.vim
Normal file
15
autoload/ale/fixers/raco_fmt.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: Jeremy Cantrell <jmcantrell@gmail.com>
|
||||
" Description: Integration of raco fmt with ALE.
|
||||
|
||||
call ale#Set('racket_raco_fmt_executable', 'raco')
|
||||
call ale#Set('racket_raco_fmt_options', '')
|
||||
|
||||
function! ale#fixers#raco_fmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'racket_raco_fmt_executable')
|
||||
let l:options = ale#Var(a:buffer, 'racket_raco_fmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fmt'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user