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: Drew Olson <drew@drewolson.org>
2 " Description: Integrate ALE with purescript-language-server.
4 call ale#Set('purescript_ls_executable', 'purescript-language-server')
5 call ale#Set('purescript_ls_use_global', get(g:, 'ale_use_global_executables', 0))
6 call ale#Set('purescript_ls_config', {})
8 function! ale_linters#purescript#ls#GetExecutable(buffer) abort
9 return ale#path#FindExecutable(a:buffer, 'purescript_ls', [
10 \ 'node_modules/.bin/purescript-language-server',
14 function! ale_linters#purescript#ls#GetCommand(buffer) abort
15 let l:executable = ale_linters#purescript#ls#GetExecutable(a:buffer)
17 return ale#Escape(l:executable) . ' --stdio'
20 function! ale_linters#purescript#ls#FindProjectRoot(buffer) abort
21 let l:config = ale#path#FindNearestFile(a:buffer, 'bower.json')
24 return fnamemodify(l:config, ':h')
27 let l:config = ale#path#FindNearestFile(a:buffer, 'psc-package.json')
30 return fnamemodify(l:config, ':h')
33 let l:config = ale#path#FindNearestFile(a:buffer, 'spago.dhall')
36 return fnamemodify(l:config, ':h')
42 call ale#linter#Define('purescript', {
43 \ 'name': 'purescript-language-server',
44 \ 'aliases': ['purescriptls'],
46 \ 'executable': function('ale_linters#purescript#ls#GetExecutable'),
47 \ 'command': function('ale_linters#purescript#ls#GetCommand'),
48 \ 'project_root': function('ale_linters#purescript#ls#FindProjectRoot'),
49 \ 'lsp_config': {b -> ale#Var(b, 'purescript_ls_config')},