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

@@ -0,0 +1,16 @@
Before:
call ale#assert#SetUpFixerTest('verilog', 'verible_format')
After:
call ale#assert#TearDownFixerTest()
Execute(The verible format callback should return the correct default values):
AssertFixer {'command': ale#Escape('verible-verilog-format') .' -'}
Execute(The verible format callback should allow a custom executable):
let g:ale_verilog_verible_format_executable = 'foo/bar'
AssertFixer {'command': ale#Escape('foo/bar') . ' -'}
Execute(The verible format callback should allow custom options):
let g:ale_verilog_verible_format_options = '--foo --bar'
AssertFixer {'command': ale#Escape('verible-verilog-format') .' --foo --bar -'}

View File

@@ -0,0 +1,33 @@
Before:
call ale#assert#SetUpLinterTest('verilog', 'verible_ls')
After:
call ale#assert#TearDownLinterTest()
Execute(The default executable path and arguments should be correct):
AssertLinter 'verible-verilog-ls', ale#Escape('verible-verilog-ls') . ' --rules_config_search'
Execute(The project root should be detected correctly in empty directory):
AssertLSPProject '.'
Execute(The project root should be detected correctly with verible.filelist):
call ale#test#SetFilename('../test-files/verilog/verible/module.sv')
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/verilog/verible')
Execute(The LSP values should be set correctly):
call ale#test#SetFilename('../test-files/verilog/verible/module.sv')
AssertLSPLanguage 'verilog'
AssertLSPOptions {}
AssertLSPConfig {}
AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/verilog/verible')
Execute(The verible LSP callback should allow custom options):
let g:ale_verilog_verible_ls_options = '--foo --bar'
AssertLinter 'verible-verilog-ls', ale#Escape('verible-verilog-ls') . ' --foo --bar'
Execute(The verible LSP callback should allow custom rules):
let g:ale_verilog_verible_ls_rules = '+foo,-bar'
AssertLinter 'verible-verilog-ls', ale#Escape('verible-verilog-ls') . ' --rules_config_search --rules=+foo,-bar'

View File

@@ -0,0 +1 @@
./module.sv

View File

@@ -119,7 +119,7 @@ Execute(The defaults for the zsh filetype should be correct):
Execute(The defaults for the verilog filetype should be correct):
" This filetype isn't configured with default, so we can test loading all
" available linters with this.
AssertEqual ['hdl_checker', 'iverilog', 'slang', 'verilator', 'vlog', 'xvlog', 'yosys'], GetLinterNames('verilog')
AssertEqual ['hdl_checker', 'iverilog', 'slang', 'verible_ls', 'verilator', 'vlog', 'xvlog', 'yosys'], GetLinterNames('verilog')
let g:ale_linters_explicit = 1