Skip to content

Commit

Permalink
c3lsp: add command line arguments to executable
Browse files Browse the repository at this point in the history
  • Loading branch information
konimarti committed Dec 31, 2024
1 parent 0f2ab86 commit 5b61b4c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ale_linters/c3/c3lsp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
" 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': '%e',
\ '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')},
\})
10 changes: 10 additions & 0 deletions doc/ale-c3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ g:ale_c3_c3lsp_executable *g:ale_c3_c3lsp_executable*
This variable can be changed to set the path to c3lsp executable.


g:ale_c3_c3lsp_options *g:ale_c3_c3lsp_options*
*b:ale_c3_c3lsp_options*

Type: |String|
Default: `''`

Add command line options to the c3lsp executable. This is useful to specify
the path to the C3 standard library with '-stdlib-path=<path>'.


g:ale_c3_c3lsp_init_options *g:ale_c3_c3lsp_init_options*
*b:ale_c3_c3lsp_init_options*
Type: |Dictionary|
Expand Down

0 comments on commit 5b61b4c

Please sign in to comment.