mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 13:32:34 +08:00
tombi: support toml_tombi_online flag to control remote schema fetching (#5032)
This commit is contained in:
@@ -3,13 +3,20 @@
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_format_options', '')
|
||||
call ale#Set('toml_tombi_online', 0)
|
||||
|
||||
function! ale#fixers#tombi_format#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
let l:offline = ''
|
||||
|
||||
if !ale#Var(a:buffer, 'toml_tombi_online')
|
||||
let l:offline = '--offline'
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(l:offline)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_format_options')),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -3,13 +3,20 @@
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_lint_options', '')
|
||||
call ale#Set('toml_tombi_online', 0)
|
||||
|
||||
function! ale#fixers#tombi_lint#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
let l:offline = ''
|
||||
|
||||
if !ale#Var(a:buffer, 'toml_tombi_online')
|
||||
let l:offline = '--offline'
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' lint'
|
||||
\ . ale#Pad(l:offline)
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_lint_options')),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user