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:
Nicolas Derumigny
2025-08-13 16:41:56 +02:00
committed by GitHub
parent 29f1ff2579
commit 6d7bc15d9a
12 changed files with 196 additions and 2 deletions

View File

@@ -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.

View 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