mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 04:34:25 +08:00
Add support for c3-lsp linter (#4836)
* Add support for c3-lsp linter Add support for c3-lang with the c3-lsp language server. Link: http://github.com/pherrymason/c3-lsp Link: http://c3-lang.org * fix linter error * fix: consistent use of the executable name Consistently use the executable name 'c3lsp' instead of the project name 'c3-lsp'. * c3lsp: add command line arguments to executable
This commit is contained in:
22
ale_linters/c3/c3lsp.vim
Normal file
22
ale_linters/c3/c3lsp.vim
Normal file
@@ -0,0 +1,22 @@
|
||||
" Author: Koni Marti <koni.marti@gmail.com>
|
||||
" Description: A Language Server implementation for C3
|
||||
|
||||
call ale#Set('c3_c3lsp_executable', 'c3lsp')
|
||||
call ale#Set('c3_c3lsp_options', '')
|
||||
call ale#Set('c3_c3lsp_init_options', {})
|
||||
|
||||
function! ale_linters#c3#c3lsp#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'c3_c3lsp_executable')
|
||||
|
||||
return ale#Escape(l:executable) . ale#Pad(ale#Var(a:buffer, 'c3_c3lsp_options'))
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('c3', {
|
||||
\ 'name': 'c3lsp',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'c3_c3lsp_executable')},
|
||||
\ 'command': function('ale_linters#c3#c3lsp#GetCommand'),
|
||||
\ 'project_root': function('ale#handlers#c3lsp#GetProjectRoot'),
|
||||
\ 'lsp_config': {b -> ale#handlers#c3lsp#GetInitOpts(b, 'c3_c3lsp_init_options')},
|
||||
\})
|
||||
Reference in New Issue
Block a user