mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-10 03:31:34 +08:00
Add support for V: "v" (compiler) and "vfmt" fixer. (#3622)
* v: add "v fmt" fixer. * v: add "v" (build) linter. * v: fix vlint complaints and add documentation. * v: add tests. * v: use ale#Pad().
This commit is contained in:
@@ -440,6 +440,11 @@ let s:default_registry = {
|
||||
\ 'function': 'ale#fixers#ptop#Fix',
|
||||
\ 'suggested_filetypes': ['pascal'],
|
||||
\ 'description': 'Fix Pascal files with ptop.',
|
||||
\ },
|
||||
\ 'vfmt': {
|
||||
\ 'function': 'ale#fixers#vfmt#Fix',
|
||||
\ 'suggested_filetypes': ['v'],
|
||||
\ 'description': 'A formatter for V source code.',
|
||||
\ }
|
||||
\}
|
||||
|
||||
|
||||
13
autoload/ale/fixers/vfmt.vim
Normal file
13
autoload/ale/fixers/vfmt.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
" Author: fiatjaf <fiatjaf@alhur.es>
|
||||
" Description: Integration of `v fmt` with ALE.
|
||||
|
||||
call ale#Set('v_vfmt_options', '')
|
||||
|
||||
function! ale#fixers#vfmt#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'v_v_executable')
|
||||
let l:options = ale#Var(a:buffer, 'v_vfmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fmt' . ale#Pad(l:options)
|
||||
\}
|
||||
endfunction
|
||||
@@ -53,6 +53,7 @@ let s:default_ale_linters = {
|
||||
\ 'text': [],
|
||||
\ 'vue': ['eslint', 'vls'],
|
||||
\ 'zsh': ['shell'],
|
||||
\ 'v': ['v'],
|
||||
\}
|
||||
|
||||
" Testing/debugging helper to unload all linters.
|
||||
|
||||
Reference in New Issue
Block a user