mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-22 17:48:37 +08:00
Merge remote-tracking branch 'AlexeiDrake/master' into bugfix/c-lsp-build-dir-settings
This commit is contained in:
@@ -215,6 +215,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Fix Haskell files with brittany.',
|
||||
\ },
|
||||
\ 'hindent': {
|
||||
\ 'function': 'ale#fixers#hindent#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Fix Haskell files with hindent.',
|
||||
\ },
|
||||
\ 'hlint': {
|
||||
\ 'function': 'ale#fixers#hlint#Fix',
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
|
||||
20
autoload/ale/fixers/hindent.vim
Normal file
20
autoload/ale/fixers/hindent.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: AlexeiDrake <drake.alexei@gmail.com>
|
||||
" Description: Integration of hindent formatting with ALE.
|
||||
"
|
||||
call ale#Set('haskell_hindent_executable', 'hindent')
|
||||
|
||||
function! ale#fixers#hindent#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'haskell_hindent_executable')
|
||||
|
||||
return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'hindent')
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#hindent#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#hindent#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user