mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Add support for verible: language server + fixer (#4994)
* Add support for verible: language server + fixer * verible: add default flag, rules support for verible-ls
This commit is contained in:
committed by
GitHub
parent
29f1ff2579
commit
6d7bc15d9a
@@ -742,6 +742,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['toml'],
|
||||
\ 'description': 'Lints TOML files',
|
||||
\ },
|
||||
\ 'verible_format': {
|
||||
\ 'function': 'ale#fixers#verible_format#Fix',
|
||||
\ 'suggested_filetypes': ['verilog'],
|
||||
\ 'description': 'Formats verilog files using verible.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
17
autoload/ale/fixers/verible_format.vim
Normal file
17
autoload/ale/fixers/verible_format.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Author: Nicolas Derumigny <https://github.com/nicolasderumigny>
|
||||
" Description: verible formatter for verilog.
|
||||
|
||||
call ale#Set('verilog_verible_format_executable', 'verible-verilog-format')
|
||||
call ale#Set('verilog_verible_format_options', '')
|
||||
|
||||
function! ale#fixers#verible_format#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#Var(a:buffer, 'verilog_verible_format_executable'))
|
||||
let l:command = l:executable
|
||||
let l:options = ale#Var(a:buffer, 'verilog_verible_format_options')
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {'command': l:command . ' -'}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user