1
0
Fork 0
mirror of synced 2024-09-19 20:52:55 -04:00
ultimate-vim/sources_non_forked/ale/ale_linters/gleam/gleamlsp.vim
2024-02-11 18:33:58 +01:00

18 lines
640 B
VimL

" Author: Jonathan Palardt https://github.com/jpalardy
" Description: Support for Gleam Language Server
call ale#Set('gleam_gleamlsp_executable', 'gleam')
function! ale_linters#gleam#gleamlsp#GetProjectRoot(buffer) abort
let l:gleam_toml = ale#path#FindNearestFile(a:buffer, 'gleam.toml')
return !empty(l:gleam_toml) ? fnamemodify(l:gleam_toml, ':p:h') : ''
endfunction
call ale#linter#Define('gleam', {
\ 'name': 'gleamlsp',
\ 'lsp': 'stdio',
\ 'executable': {buffer -> ale#Var(buffer, 'gleam_gleamlsp_executable')},
\ 'command': '%e lsp',
\ 'project_root': function('ale_linters#gleam#gleamlsp#GetProjectRoot'),
\})