mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
@@ -385,6 +385,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['dhall'],
|
||||
\ 'description': 'Fix Dhall files with dhall-format.',
|
||||
\ },
|
||||
\ 'ormolu': {
|
||||
\ 'function': 'ale#fixers#ormolu#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'A formatter for Haskell source code.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
12
autoload/ale/fixers/ormolu.vim
Normal file
12
autoload/ale/fixers/ormolu.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
call ale#Set('haskell_ormolu_executable', 'ormolu')
|
||||
call ale#Set('haskell_ormolu_options', '')
|
||||
|
||||
function! ale#fixers#ormolu#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_ormolu_executable')
|
||||
let l:options = ale#Var(a:buffer, 'haskell_ormolu_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user