ale/autoload/ale/fixers/hackfmt.vim
Fred Emmott 238201805d
Split Hack out from PHP, modernize
fixes #1738

- Replace previous `hh_client` usage with LSP client
- Add `HHAST` linter
- Split Hack from PHP: Hack is increasingly diverging from PHP:
  - Hack tools do not understand PHP
  - Most PHP tools do not handle Hack code well (including vim's syntax
    highightling files)
  - http://github.com/hhvm/vim-hack now sets filetype to `hack`
2018-08-02 11:28:56 -07:00

19 lines
568 B
VimL

" Author: Sam Howie <samhowie@gmail.com>
" Description: Integration of hackfmt with ALE.
call ale#Set('hack_hackfmt_executable', 'hackfmt')
call ale#Set('hack_hackfmt_options', '')
function! ale#fixers#hackfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'hack_hackfmt_executable')
let l:options = ale#Var(a:buffer, 'hack_hackfmt_options')
return {
\ 'command': ale#Escape(l:executable)
\ . ' -i'
\ . (empty(l:options) ? '' : ' ' . l:options)
\ . ' %t',
\ 'read_temporary_file': 1,
\}
endfunction