mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Add support for ptop fixer (#3652)
* Add support for `ptop` fixer * add test file for ptop tests * called wrong fixer in assertion test * use ' %s %t' instead of ' %t %t'
This commit is contained in:
@@ -430,6 +430,11 @@ let s:default_registry = {
|
||||
\ 'function': 'ale#fixers#ormolu#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'A formatter for Haskell source code.',
|
||||
\ },
|
||||
\ 'ptop': {
|
||||
\ 'function': 'ale#fixers#ptop#Fix',
|
||||
\ 'suggested_filetypes': ['pascal'],
|
||||
\ 'description': 'Fix Pascal files with ptop.',
|
||||
\ }
|
||||
\}
|
||||
|
||||
|
||||
17
autoload/ale/fixers/ptop.vim
Normal file
17
autoload/ale/fixers/ptop.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Author: BarrOff https://github.com/BarrOff
|
||||
" Description: Integration of ptop with ALE.
|
||||
|
||||
call ale#Set('pascal_ptop_executable', 'ptop')
|
||||
call ale#Set('pascal_ptop_options', '')
|
||||
|
||||
function! ale#fixers#ptop#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'pascal_ptop_executable')
|
||||
let l:options = ale#Var(a:buffer, 'pascal_ptop_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %s %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user