mirror of
https://github.com/dense-analysis/ale.git
synced 2026-03-07 07:32:01 +08:00
Support gleamlsp language server for gleam (#4696)
This commit is contained in:
18
ale_linters/gleam/gleamlsp.vim
Normal file
18
ale_linters/gleam/gleamlsp.vim
Normal file
@@ -0,0 +1,18 @@
|
||||
" 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'),
|
||||
\})
|
||||
Reference in New Issue
Block a user