1
0
Fork 0
mirror of synced 2024-06-02 07:21:09 -04:00
ultimate-vim/sources_non_forked/ale/autoload/ale/fixers/jq.vim

23 lines
599 B
VimL
Raw Normal View History

call ale#Set('json_jq_executable', 'jq')
call ale#Set('json_jq_options', '')
2018-11-01 06:03:42 -04:00
call ale#Set('json_jq_filters', '.')
function! ale#fixers#jq#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'json_jq_executable')
endfunction
function! ale#fixers#jq#Fix(buffer) abort
2019-03-08 06:04:56 -05:00
let l:options = ale#Var(a:buffer, 'json_jq_options')
let l:filters = ale#Var(a:buffer, 'json_jq_filters')
2018-11-01 06:03:42 -04:00
2019-03-08 06:04:56 -05:00
if empty(l:filters)
return 0
endif
2019-03-08 06:04:56 -05:00
return {
\ 'command': ale#Escape(ale#fixers#jq#GetExecutable(a:buffer))
\ . ' ' . l:filters . ' '
\ . l:options,
\}
endfunction