mirror of
https://github.com/dense-analysis/ale.git
synced 2026-09-25 21:23:13 +08:00
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s
24 lines
840 B
VimL
24 lines
840 B
VimL
" Author: Johan Niklasson <johan@niklasson-embedded.se>
|
|
" Description: openscad-lsp support for OpenSCAD
|
|
|
|
call ale#Set('openscad_openscad_lsp_executable', 'openscad-lsp')
|
|
call ale#Set('openscad_openscad_lsp_options', '')
|
|
|
|
function! ale_linters#openscad#openscad_lsp#GetProjectRoot(buffer) abort
|
|
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
|
|
|
|
if !empty(l:git_path)
|
|
return fnamemodify(l:git_path, ':h:h')
|
|
endif
|
|
|
|
return expand('#' . a:buffer . ':p:h')
|
|
endfunction
|
|
|
|
call ale#linter#Define('openscad', {
|
|
\ 'name': 'openscad_lsp',
|
|
\ 'lsp': 'stdio',
|
|
\ 'executable': {b -> ale#Var(b, 'openscad_openscad_lsp_executable')},
|
|
\ 'command': {b -> '%e --stdio' . ale#Pad(ale#Var(b, 'openscad_openscad_lsp_options'))},
|
|
\ 'project_root': function('ale_linters#openscad#openscad_lsp#GetProjectRoot'),
|
|
\})
|