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: Jeffrey Lau - https://github.com/zoonfafer
2 " Description: YAML Language Server https://github.com/redhat-developer/yaml-language-server
4 call ale#Set('yaml_ls_executable', 'yaml-language-server')
5 call ale#Set('yaml_ls_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('yaml_ls_config', {})
8 function! ale_linters#yaml#ls#GetExecutable(buffer) abort
9 return ale#path#FindExecutable(a:buffer, 'yaml_ls', [
10 \ 'node_modules/.bin/yaml-language-server',
14 function! ale_linters#yaml#ls#GetCommand(buffer) abort
15 let l:executable = ale_linters#yaml#ls#GetExecutable(a:buffer)
17 return ale#Escape(l:executable) . ' --stdio'
20 " Just use the current file
21 function! ale_linters#yaml#ls#FindProjectRoot(buffer) abort
22 let l:project_file = expand('#' . a:buffer . ':p')
24 return fnamemodify(l:project_file, ':h')
27 call ale#linter#Define('yaml', {
28 \ 'name': 'yaml-language-server',
29 \ 'aliases': ['yamlls'],
31 \ 'executable': function('ale_linters#yaml#ls#GetExecutable'),
32 \ 'command': function('ale_linters#yaml#ls#GetCommand'),
33 \ 'project_root': function('ale_linters#yaml#ls#FindProjectRoot'),
34 \ 'lsp_config': {b -> ale#Var(b, 'yaml_ls_config')},