mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-10 03:31:34 +08:00
Add support for Dune (#4263)
* Add support for dune * Add test * Undo reformatting of Markdown file * Refer to ale-ocaml-dune from ale.txt
This commit is contained in:
@@ -78,6 +78,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['dhall'],
|
||||
\ 'description': 'Standard code formatter for the Dhall language and removing dead code',
|
||||
\ },
|
||||
\ 'dune': {
|
||||
\ 'function': 'ale#fixers#dune#Fix',
|
||||
\ 'suggested_filetypes': ['dune'],
|
||||
\ 'description': 'Fix dune files with dune format',
|
||||
\ },
|
||||
\ 'fecs': {
|
||||
\ 'function': 'ale#fixers#fecs#Fix',
|
||||
\ 'suggested_filetypes': ['javascript', 'css', 'html'],
|
||||
|
||||
16
autoload/ale/fixers/dune.vim
Normal file
16
autoload/ale/fixers/dune.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Author: Albert Peschar <albert@peschar.net>
|
||||
" Description: Fix files with dune format.
|
||||
|
||||
call ale#Set('ocaml_dune_executable', 'dune')
|
||||
call ale#Set('ocaml_dune_options', '')
|
||||
|
||||
function! ale#fixers#dune#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ocaml_dune_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ocaml_dune_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user