All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Dmitri Vereshchagin <dmitri.vereshchagin@gmail.com>
2 " Description: LSP linter for Erlang files
4 call ale#Set('erlang_erlang_ls_executable', 'erlang_ls')
5 call ale#Set('erlang_erlang_ls_log_dir', '')
6 call ale#Set('erlang_erlang_ls_log_level', 'info')
8 function! s:GetCommand(buffer) abort
9 let l:log_dir = ale#Var(a:buffer, 'erlang_erlang_ls_log_dir')
10 let l:log_level = ale#Var(a:buffer, 'erlang_erlang_ls_log_level')
15 let l:command .= ' --log-dir=' . ale#Escape(l:log_dir)
18 let l:command .= ' --log-level=' . ale#Escape(l:log_level)
23 function! s:FindProjectRoot(buffer) abort
33 " This is a way to find Erlang/OTP root (the one that is managed
34 " by kerl or asdf). Useful if :ALEGoToDefinition takes us there.
35 let l:markers += ['.kerl_config']
37 for l:marker in l:markers
38 let l:path = l:marker[-1:] is# '/'
39 \ ? ale#path#FindNearestDirectory(a:buffer, l:marker)
40 \ : ale#path#FindNearestFile(a:buffer, l:marker)
43 return ale#path#Dirname(l:path)
50 call ale#linter#Define('erlang', {
51 \ 'name': 'erlang_ls',
52 \ 'executable': {b -> ale#Var(b, 'erlang_erlang_ls_executable')},
53 \ 'command': function('s:GetCommand'),
55 \ 'project_root': function('s:FindProjectRoot'),
56 \ 'aliases': ['erlang-ls'],