feat: openscad-lsp support (#5156)
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

This commit is contained in:
jniklasson
2026-08-19 17:24:42 +09:00
committed by GitHub
parent 0aa1ea11e0
commit 1c6e71732f
6 changed files with 67 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
" 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'),
\})