mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 05:22:31 +08:00
Merge pull request #2690 from iclanzan/purty
Add purty fixer for PureScript
This commit is contained in:
@@ -235,6 +235,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['haskell'],
|
||||
\ 'description': 'Refactor Haskell files with stylish-haskell.',
|
||||
\ },
|
||||
\ 'purty': {
|
||||
\ 'function': 'ale#fixers#purty#Fix',
|
||||
\ 'suggested_filetypes': ['purescript'],
|
||||
\ 'description': 'Format PureScript files with purty.',
|
||||
\ },
|
||||
\ 'ocamlformat': {
|
||||
\ 'function': 'ale#fixers#ocamlformat#Fix',
|
||||
\ 'suggested_filetypes': ['ocaml'],
|
||||
|
||||
22
autoload/ale/fixers/purty.vim
Normal file
22
autoload/ale/fixers/purty.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Author: iclanzan <sorin@iclanzan.com>
|
||||
" Description: Integration of purty with ALE.
|
||||
|
||||
call ale#Set('purescript_purty_executable', 'purty')
|
||||
|
||||
function! ale#fixers#purty#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'purescript_purty_executable')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#purty#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#purty#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ' --write'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user