mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-07 18:31:04 +08:00
Add floskell for Haskell formatting
This commit is contained in:
@@ -190,6 +190,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['hack'],
|
||||
\ 'description': 'Fix Hack files with hackfmt.',
|
||||
\ },
|
||||
\ 'floskell': {
|
||||
\ 'function': 'ale#fixers#floskell#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Fix Haskell files with floskell.',
|
||||
\ },
|
||||
\ 'hfmt': {
|
||||
\ 'function': 'ale#fixers#hfmt#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
|
||||
20
autoload/ale/fixers/floskell.vim
Normal file
20
autoload/ale/fixers/floskell.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: robertjlooby <robertjlooby@gmail.com>
|
||||
" Description: Integration of floskell with ALE.
|
||||
|
||||
call ale#Set('haskell_floskell_executable', 'floskell')
|
||||
|
||||
function! ale#fixers#floskell#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_floskell_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'floskell')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#floskell#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#floskell#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user