1
0
Fork 0
mirror of synced 2024-11-14 13:08:59 -05:00
ultimate-vim/sources_non_forked/ale/ale_linters/gleam/gleamlsp.vim

19 lines
640 B
VimL
Raw Normal View History

2024-02-11 12:33:58 -05:00
" 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'),
\})