Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit 9784b98

Browse files
committed
ale#node#FindExecutable => ale#path#FindExecutable
ale#node#FindExecutable was moved to ale#path#FindExecutable in dense-analysis/ale@f5343133. Update the ale_linter to support both versions. Signed-off-by: Kevin Locke <[email protected]>
1 parent ee0ab83 commit 9784b98

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

ale_linters/jsonc/jsonlint.vim

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,25 @@ call ale#Set('jsonc_jsonlint_use_global', get(g:, 'ale_use_global_executables',
1313
call ale#Set('jsonc_sjc_executable', 'strip-json-comments')
1414
call ale#Set('jsonc_sjc_use_global', get(g:, 'ale_use_global_executables', 0))
1515

16+
" ale#node#FindExecutable was moved to ale#path#FindExecutable in
17+
" w0rp/ale@f5343133
18+
function! s:FindExecutable(buffer, base_var_name, path_list) abort
19+
try
20+
return ale#path#FindExecutable(a:buffer, a:base_var_name, a:path_list)
21+
catch /^Vim(return):E117: Unknown function: ale#path#FindExecutable$/
22+
return ale#node#FindExecutable(a:buffer, a:base_var_name, a:path_list)
23+
endtry
24+
endfunction
25+
1626
function! ale_linters#jsonc#jsonlint#GetJsonlintExecutable(buffer) abort
17-
return ale#node#FindExecutable(a:buffer, 'jsonc_jsonlint', [
27+
return s:FindExecutable(a:buffer, 'jsonc_jsonlint', [
1828
\ 'node_modules/.bin/jsonlint',
1929
\ 'node_modules/jsonlint/lib/cli.js',
2030
\])
2131
endfunction
2232

2333
function! ale_linters#jsonc#jsonlint#GetSjcExecutable(buffer) abort
24-
return ale#node#FindExecutable(a:buffer, 'jsonc_sjc', [
34+
return s:FindExecutable(a:buffer, 'jsonc_sjc', [
2535
\ 'node_modules/.bin/strip-json-comments',
2636
\ 'node_modules/strip-json-comments-cli/cli.js',
2737
\])

0 commit comments

Comments
 (0)