From ebc6718c0a31c609a1b6500bfdca2aae16ce4721 Mon Sep 17 00:00:00 2001 From: Jonathan Palardy Date: Sun, 14 Jan 2024 03:43:59 -0800 Subject: Support gleamlsp language server for gleam (#4696) --- ale_linters/gleam/gleamlsp.vim | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 ale_linters/gleam/gleamlsp.vim (limited to 'ale_linters/gleam/gleamlsp.vim') diff --git a/ale_linters/gleam/gleamlsp.vim b/ale_linters/gleam/gleamlsp.vim new file mode 100644 index 00000000..f32d1434 --- /dev/null +++ b/ale_linters/gleam/gleamlsp.vim @@ -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'), +\}) -- cgit v1.2.3