From ddfc43e774fd38e4051ba9fd3619ca9f0da6639f Mon Sep 17 00:00:00 2001 From: Ben Linsay Date: Wed, 18 Nov 2020 20:39:07 -0500 Subject: pass lsp intialization_options to rust-analyzer fixes #3350 --- ale_linters/rust/analyzer.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ale_linters') diff --git a/ale_linters/rust/analyzer.vim b/ale_linters/rust/analyzer.vim index 3666ec03..77d946f7 100644 --- a/ale_linters/rust/analyzer.vim +++ b/ale_linters/rust/analyzer.vim @@ -17,7 +17,7 @@ endfunction call ale#linter#Define('rust', { \ 'name': 'analyzer', \ 'lsp': 'stdio', -\ 'lsp_config': {b -> ale#Var(b, 'rust_analyzer_config')}, +\ 'initialization_options': {b -> ale#Var(b, 'rust_analyzer_config')}, \ 'executable': {b -> ale#Var(b, 'rust_analyzer_executable')}, \ 'command': function('ale_linters#rust#analyzer#GetCommand'), \ 'project_root': function('ale_linters#rust#analyzer#GetProjectRoot'), -- cgit v1.2.3 From 433b23be17095c0211685ff32e25fcdbfffe2ce7 Mon Sep 17 00:00:00 2001 From: Gonzalo Quero Date: Wed, 2 Sep 2020 13:08:46 +0100 Subject: feat: Add optional configuration file for Credo --- ale_linters/elixir/credo.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ale_linters') diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index 7c298502..15ebefb5 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -45,6 +45,16 @@ function! ale_linters#elixir#credo#GetMode() abort endif endfunction +function! ale_linters#elixir#credo#GetConfigFile() abort + let l:config_file = get(g:, 'ale_elixir_credo_config_file', '') + + if len(l:config_file) == 0 + return '' + else + return ' --config-file ' . l:config_file + endif +endfunction + function! ale_linters#elixir#credo#GetCommand(buffer) abort let l:project_root = ale#handlers#elixir#FindMixUmbrellaRoot(a:buffer) let l:mode = ale_linters#elixir#credo#GetMode() @@ -52,6 +62,7 @@ function! ale_linters#elixir#credo#GetCommand(buffer) abort return ale#path#CdString(l:project_root) \ . 'mix help credo && ' \ . 'mix credo ' . ale_linters#elixir#credo#GetMode() + \ . ale_linters#elixir#credo#GetConfigFile() \ . ' --format=flycheck --read-from-stdin %s' endfunction -- cgit v1.2.3 From 7e9d4fbfc820ae4198b07b204295fc3acd391209 Mon Sep 17 00:00:00 2001 From: Gonzalo Quero Date: Mon, 23 Nov 2020 10:21:09 +0000 Subject: refactor: Move test to the right file --- ale_linters/elixir/credo.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ale_linters') diff --git a/ale_linters/elixir/credo.vim b/ale_linters/elixir/credo.vim index 15ebefb5..892d47b9 100644 --- a/ale_linters/elixir/credo.vim +++ b/ale_linters/elixir/credo.vim @@ -48,11 +48,11 @@ endfunction function! ale_linters#elixir#credo#GetConfigFile() abort let l:config_file = get(g:, 'ale_elixir_credo_config_file', '') - if len(l:config_file) == 0 + if empty(l:config_file) return '' - else - return ' --config-file ' . l:config_file endif + + return ' --config-file ' . l:config_file endfunction function! ale_linters#elixir#credo#GetCommand(buffer) abort -- cgit v1.2.3 From 3f01cc247c200850046f59676b0dfead22986f9b Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Mon, 30 Nov 2020 13:28:04 -0500 Subject: dafny: add a timeLimit option and message-parsing --- ale_linters/dafny/dafny.vim | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'ale_linters') diff --git a/ale_linters/dafny/dafny.vim b/ale_linters/dafny/dafny.vim index b5b90675..b2060d60 100644 --- a/ale_linters/dafny/dafny.vim +++ b/ale_linters/dafny/dafny.vim @@ -14,13 +14,28 @@ function! ale_linters#dafny#dafny#Handle(buffer, lines) abort \ }) endfor + for l:match in ale#util#GetMatches(a:lines, '\v(.*)\((\d+),(\d+)\): (Verification of .{-} timed out after \d+ seconds)') + call add(l:output, { + \ 'bufnr': a:buffer, + \ 'col': l:match[3] + 0, + \ 'lnum': l:match[2] + 0, + \ 'text': l:match[4], + \ 'type': 'E', + \ }) + endfor + return l:output endfunction +function! ale_linters#dafny#dafny#GetCommand(buffer) abort + return printf('dafny %%s /compile:0 /timeLimit:%d', ale#Var(a:buffer, 'dafny_dafny_timelimit')) +endfunction + +call ale#Set('dafny_dafny_timelimit', 10) call ale#linter#Define('dafny', { \ 'name': 'dafny', \ 'executable': 'dafny', -\ 'command': 'dafny %s /compile:0', +\ 'command': function('ale_linters#dafny#dafny#GetCommand'), \ 'callback': 'ale_linters#dafny#dafny#Handle', \ 'lint_file': 1, \ }) -- cgit v1.2.3 From fa2186d95e30faa9c7e00400100ceca67ad45872 Mon Sep 17 00:00:00 2001 From: Andrea Conti Date: Sat, 12 Dec 2020 00:16:09 +0100 Subject: Update Julia language server run command --- ale_linters/julia/languageserver.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ale_linters') diff --git a/ale_linters/julia/languageserver.vim b/ale_linters/julia/languageserver.vim index 564bec39..ab105e7d 100644 --- a/ale_linters/julia/languageserver.vim +++ b/ale_linters/julia/languageserver.vim @@ -6,9 +6,9 @@ call ale#Set('julia_executable', 'julia') function! ale_linters#julia#languageserver#GetCommand(buffer) abort let l:julia_executable = ale#Var(a:buffer, 'julia_executable') - let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);' + let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);' - return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string) + return ale#Escape(l:julia_executable) . '--project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string) endfunction call ale#linter#Define('julia', { -- cgit v1.2.3 From 1f0cbc7dbd4f1957ac223d83027079c1dea7938d Mon Sep 17 00:00:00 2001 From: Andrea Conti Date: Sat, 12 Dec 2020 00:37:14 +0100 Subject: Fix space error in string concat --- ale_linters/julia/languageserver.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ale_linters') diff --git a/ale_linters/julia/languageserver.vim b/ale_linters/julia/languageserver.vim index ab105e7d..999ad815 100644 --- a/ale_linters/julia/languageserver.vim +++ b/ale_linters/julia/languageserver.vim @@ -8,7 +8,7 @@ function! ale_linters#julia#languageserver#GetCommand(buffer) abort let l:julia_executable = ale#Var(a:buffer, 'julia_executable') let l:cmd_string = 'using LanguageServer; using Pkg; import StaticLint; import SymbolServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, dirname(Pkg.Types.Context().env.project_file)); server.runlinter = true; run(server);' - return ale#Escape(l:julia_executable) . '--project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string) + return ale#Escape(l:julia_executable) . ' --project=@. --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string) endfunction call ale#linter#Define('julia', { -- cgit v1.2.3