mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-30 14:45:29 +08:00
@@ -305,6 +305,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['tex'],
|
||||
\ 'description' : 'Indent code within environments, commands, after headings and within special code blocks.',
|
||||
\ },
|
||||
\ 'pgformatter': {
|
||||
\ 'function': 'ale#fixers#pgformatter#Fix',
|
||||
\ 'suggested_filetypes': ['sql'],
|
||||
\ 'description': 'A PostgreSQL SQL syntax beautifier',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
12
autoload/ale/fixers/pgformatter.vim
Normal file
12
autoload/ale/fixers/pgformatter.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
call ale#Set('sql_pgformatter_executable', 'pg_format')
|
||||
call ale#Set('sql_pgformatter_options', '')
|
||||
|
||||
function! ale#fixers#pgformatter#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'sql_pgformatter_executable')
|
||||
let l:options = ale#Var(a:buffer, 'sql_pgformatter_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user