From ddf4e7e9bab24423ef4388bd923a532d8fb3227f Mon Sep 17 00:00:00 2001 From: Horacio Sanson Date: Sun, 12 Jul 2020 20:49:04 +0900 Subject: Enable ktlint fixer for kotlin files. --- autoload/ale/fix/registry.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 1b3ca1a8..ef30f529 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -327,7 +327,7 @@ let s:default_registry = { \ }, \ 'ktlint': { \ 'function': 'ale#fixers#ktlint#Fix', -\ 'suggested_filetypes': ['kt'], +\ 'suggested_filetypes': ['kt', 'kotlin'], \ 'description': 'Fix Kotlin files with ktlint.', \ }, \ 'styler': { -- cgit v1.2.3 From f1080a2bbe701949de16f8b93481375ee5732322 Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 2 Aug 2020 12:31:06 +0700 Subject: Dhall language support (fixes #2820) --- autoload/ale/dhall.vim | 21 +++++++++++++++ autoload/ale/fix/registry.vim | 15 +++++++++++ autoload/ale/fixers/dhall_format.vim | 14 ++++++++++ autoload/ale/fixers/dhall_freeze.vim | 18 +++++++++++++ autoload/ale/fixers/dhall_lint.vim | 14 ++++++++++ doc/ale-dhall.txt | 52 ++++++++++++++++++++++++++++++++++++ doc/ale.txt | 4 +++ supported-tools.md | 4 +++ 8 files changed, 142 insertions(+) create mode 100644 autoload/ale/dhall.vim create mode 100644 autoload/ale/fixers/dhall_format.vim create mode 100644 autoload/ale/fixers/dhall_freeze.vim create mode 100644 autoload/ale/fixers/dhall_lint.vim create mode 100644 doc/ale-dhall.txt diff --git a/autoload/ale/dhall.vim b/autoload/ale/dhall.vim new file mode 100644 index 00000000..6e57c4a7 --- /dev/null +++ b/autoload/ale/dhall.vim @@ -0,0 +1,21 @@ +" Author: toastal +" Description: Functions for working with Dhall’s executable + +call ale#Set('dhall_executable', 'dhall') +call ale#Set('dhall_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('dhall_options', '') + +function! ale#dhall#GetExecutable(buffer) abort + return ale#Escape(ale#Var(a:buffer, 'dhall_executable')) +endfunction + +function! ale#dhall#GetExecutableWithOptions(buffer) abort + let l:executable = ale#dhall#GetExecutable(a:buffer) + + return l:executable + \ . ale#Pad(ale#Var(a:buffer, 'dhall_options')) +endfunction + +function! ale#dhall#GetCommand(buffer) abort + return '%e ' . ale#Pad(ale#Var(a:buffer, 'dhall_options')) +endfunction diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 02b02699..3dc5c774 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -32,6 +32,21 @@ let s:default_registry = { \ 'suggested_filetypes': ['d'], \ 'description': 'Fix D files with dfmt.', \ }, +\ 'dhall-format': { +\ 'function': 'ale#fixers#dhall_format#Fix', +\ 'suggested_filetypes': ['dhall'], +\ 'description': 'Standard code formatter for the Dhall language', +\ }, +\ 'dhall-freeze': { +\ 'function': 'ale#fixers#dhall_freeze#Freeze', +\ 'suggested_filetypes': ['dhall'], +\ 'description': 'Add integrity checks to remote import statements of an expression for the Dhall language', +\ }, +\ 'dhall-lint': { +\ 'function': 'ale#fixers#dhall_lint#Fix', +\ 'suggested_filetypes': ['dhall'], +\ 'description': 'Standard code formatter for the Dhall language and removing dead code', +\ }, \ 'fecs': { \ 'function': 'ale#fixers#fecs#Fix', \ 'suggested_filetypes': ['javascript', 'css', 'html'], diff --git a/autoload/ale/fixers/dhall_format.vim b/autoload/ale/fixers/dhall_format.vim new file mode 100644 index 00000000..214af2c8 --- /dev/null +++ b/autoload/ale/fixers/dhall_format.vim @@ -0,0 +1,14 @@ +" Author: toastal +" Description: Dhall’s built-in formatter + +function! ale#fixers#dhall_format#Fix(buffer) abort + let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) + let l:command = l:executable + \ . ' format' + \ . ' --inplace %t' + + return { + \ 'command': l:command, + \ 'read_temporary_file': 1, + \} +endfunction diff --git a/autoload/ale/fixers/dhall_freeze.vim b/autoload/ale/fixers/dhall_freeze.vim new file mode 100644 index 00000000..74ae7530 --- /dev/null +++ b/autoload/ale/fixers/dhall_freeze.vim @@ -0,0 +1,18 @@ +" Author: toastal +" Description: Dhall’s package freezing + +call ale#Set('dhall_freeze_options', '') + +function! ale#fixers#dhall_freeze#Freeze(buffer) abort + let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) + let l:command = l:executable + \ . ' freeze' + \ . ale#Pad(ale#Var(a:buffer, 'dhall_freeze_options')) + \ . ' --inplace %t' + + + return { + \ 'command': l:command, + \ 'read_temporary_file': 1, + \} +endfunction diff --git a/autoload/ale/fixers/dhall_lint.vim b/autoload/ale/fixers/dhall_lint.vim new file mode 100644 index 00000000..2abbe6f7 --- /dev/null +++ b/autoload/ale/fixers/dhall_lint.vim @@ -0,0 +1,14 @@ +" Author: toastal +" Description: Dhall’s built-in linter/formatter + +function! ale#fixers#dhall_lint#Fix(buffer) abort + let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) + let l:command = l:executable + \ . ' lint' + \ . ' --inplace %t' + + return { + \ 'command': l:command, + \ 'read_temporary_file': 1, + \} +endfunction diff --git a/doc/ale-dhall.txt b/doc/ale-dhall.txt new file mode 100644 index 00000000..44b0bf32 --- /dev/null +++ b/doc/ale-dhall.txt @@ -0,0 +1,52 @@ +=============================================================================== +ALE Dhall Integration *ale-dhall-options* + +g:ale_dhall_executable *g:ale_dhall_executable* + *b:ale_dhall_executable* + Type: |String| + Default: `'dhall'` + +g:ale_dhall_options g:ale_dhall_options + b:ale_dhall_options + Type: |String| + Default: `''` + + This variable can be set to pass additional options to the 'dhall` executable. + This is shared with `dhall-freeze` and `dhall-lint`. +> + let g:dhall_options = '--ascii' +< + +=============================================================================== +dhall-format *ale-dhall-format* + +Dhall + (https://dhall-lang.org/) + + +=============================================================================== +dhall-freeze *ale-dhall-freeze* + +Dhall + (https://dhall-lang.org/) + +g:ale_dhall_freeze_options g:ale_dhall_freeze_options + b:ale_dhall_freeze_options + Type: |String| + Default: `''` + + This variable can be set to pass additional options to the 'dhall freeze` + executable. +> + let g:dhall_freeze_options = '--all' +< + +=============================================================================== +dhall-lint *ale-dhall-lint* + +Dhall + (https://dhall-lang.org/) + + +=============================================================================== + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale.txt b/doc/ale.txt index ea49eedb..4b914b82 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2374,6 +2374,10 @@ documented in additional help files. dart....................................|ale-dart-options| dartanalyzer..........................|ale-dart-dartanalyzer| dartfmt...............................|ale-dart-dartfmt| + dhall...................................|ale-dhall-options| + dhall-format..........................|ale-dhall-format| + dhall-freeze..........................|ale-dhall-freeze| + dhall-lint............................|ale-dhall-lint| dockerfile..............................|ale-dockerfile-options| dockerfile_lint.......................|ale-dockerfile-dockerfile_lint| hadolint..............................|ale-dockerfile-hadolint| diff --git a/supported-tools.md b/supported-tools.md index 7fa6ec4f..d708ae80 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -127,6 +127,10 @@ formatting. * [dartanalyzer](https://github.com/dart-lang/sdk/tree/master/pkg/analyzer_cli) :floppy_disk: * [dartfmt](https://github.com/dart-lang/sdk/tree/master/utils/dartfmt) * [language_server](https://github.com/natebosch/dart_language_server) +* Dhall + * [dhall-format](https://github.com/dhall-lang) + * [dhall-freeze](https://github.com/dhall-lang) + * [dhall-lint](https://github.com/dhall-lang) * Dockerfile * [dockerfile_lint](https://github.com/projectatomic/dockerfile_lint) * [hadolint](https://github.com/hadolint/hadolint) -- cgit v1.2.3 From 167e2e77506c55831921ee40dc30c92f7f2aaae8 Mon Sep 17 00:00:00 2001 From: toastal Date: Sun, 2 Aug 2020 23:58:49 +0700 Subject: tests --- test/fixers/test_dhall_format_fixer_callback.vader | 27 ++++++++++++++++++++ test/fixers/test_dhall_freeze_fixer_callback.vader | 29 ++++++++++++++++++++++ test/fixers/test_dhall_lint_fixer_callback.vader | 27 ++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 test/fixers/test_dhall_format_fixer_callback.vader create mode 100644 test/fixers/test_dhall_freeze_fixer_callback.vader create mode 100644 test/fixers/test_dhall_lint_fixer_callback.vader diff --git a/test/fixers/test_dhall_format_fixer_callback.vader b/test/fixers/test_dhall_format_fixer_callback.vader new file mode 100644 index 00000000..02873473 --- /dev/null +++ b/test/fixers/test_dhall_format_fixer_callback.vader @@ -0,0 +1,27 @@ +Before: + Save g:ale_dhall_executable + Save g:ale_dhall_options + + " Use an invalid global executable, so we don’t match it. + let g:ale_dhall_executable = 'odd-dhall' + let g:ale_dhall_options = '--ascii' + + call ale#test#SetDirectory('/testplugin/test/dhall') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The dhall-format callback should return the correct options): + call ale#test#SetFilename('../dhall_files/testfile.dhall') + + AssertEqual + \ { + \ 'command': ale#Escape('odd-dhall') + \ . ' --ascii' + \ . ' format' + \ . ' --inplace %t', + \ 'read_temporary_file': 1, + \ }, + \ ale#fixers#dhall_format#Fix(bufnr('')) diff --git a/test/fixers/test_dhall_freeze_fixer_callback.vader b/test/fixers/test_dhall_freeze_fixer_callback.vader new file mode 100644 index 00000000..6e9650eb --- /dev/null +++ b/test/fixers/test_dhall_freeze_fixer_callback.vader @@ -0,0 +1,29 @@ +Before: + Save g:ale_dhall_executable + Save g:ale_dhall_options + + " Use an invalid global executable, so we don’t match it. + let g:ale_dhall_executable = 'odd-dhall' + let g:ale_dhall_options = '--ascii' + let g:ale_dhall_freeze_options = '--all' + + call ale#test#SetDirectory('/testplugin/test/dhall') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The dhall-freeze callback should return the correct options): + call ale#test#SetFilename('../dhall_files/testfile.dhall') + + AssertEqual + \ { + \ 'command': ale#Escape('odd-dhall') + \ . ' --ascii' + \ . ' freeze' + \ . ' --all' + \ . ' --inplace %t', + \ 'read_temporary_file': 1, + \ }, + \ ale#fixers#dhall_freeze#Freeze(bufnr('')) diff --git a/test/fixers/test_dhall_lint_fixer_callback.vader b/test/fixers/test_dhall_lint_fixer_callback.vader new file mode 100644 index 00000000..c60b7a73 --- /dev/null +++ b/test/fixers/test_dhall_lint_fixer_callback.vader @@ -0,0 +1,27 @@ +Before: + Save g:ale_dhall_executable + Save g:ale_dhall_options + + " Use an invalid global executable, so we don’t match it. + let g:ale_dhall_executable = 'odd-dhall' + let g:ale_dhall_options = '--ascii' + + call ale#test#SetDirectory('/testplugin/test/dhall') + +After: + Restore + + call ale#test#RestoreDirectory() + +Execute(The dhall-lint callback should return the correct options): + call ale#test#SetFilename('../dhall_files/testfile.dhall') + + AssertEqual + \ { + \ 'command': ale#Escape('odd-dhall') + \ . ' --ascii' + \ . ' lint' + \ . ' --inplace %t', + \ 'read_temporary_file': 1, + \ }, + \ ale#fixers#dhall_lint#Fix(bufnr('')) -- cgit v1.2.3 From ed47008710a2295ff3bf2d2e6372ee29cdbe6c39 Mon Sep 17 00:00:00 2001 From: toastal Date: Mon, 14 Sep 2020 09:20:53 +0700 Subject: addressing missing docs + cleaning up older Dhall files --- autoload/ale/dhall.vim | 7 +++++-- autoload/ale/fix/registry.vim | 5 ----- autoload/ale/fixers/dhall.vim | 23 ---------------------- autoload/ale/fixers/dhall_format.vim | 2 +- doc/ale-supported-languages-and-tools.txt | 2 ++ test/fixers/test_dhall_fixer_callback.vader | 11 ----------- test/fixers/test_dhall_format_fixer_callback.vader | 11 ++++------- test/fixers/test_dhall_freeze_fixer_callback.vader | 13 ++++-------- test/fixers/test_dhall_lint_fixer_callback.vader | 13 ++++-------- 9 files changed, 20 insertions(+), 67 deletions(-) delete mode 100644 autoload/ale/fixers/dhall.vim delete mode 100644 test/fixers/test_dhall_fixer_callback.vader diff --git a/autoload/ale/dhall.vim b/autoload/ale/dhall.vim index 6e57c4a7..cc54418f 100644 --- a/autoload/ale/dhall.vim +++ b/autoload/ale/dhall.vim @@ -1,4 +1,4 @@ -" Author: toastal +" Author: Pat Brisbin , toastal " Description: Functions for working with Dhall’s executable call ale#Set('dhall_executable', 'dhall') @@ -6,7 +6,10 @@ call ale#Set('dhall_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('dhall_options', '') function! ale#dhall#GetExecutable(buffer) abort - return ale#Escape(ale#Var(a:buffer, 'dhall_executable')) + let l:executable = ale#Var(a:buffer, 'dhall_executable') + + " Dhall is written in Haskell and commonly installed with Stack + return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'dhall') endfunction function! ale#dhall#GetExecutableWithOptions(buffer) abort diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 0a729cf9..218a0f95 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -390,11 +390,6 @@ let s:default_registry = { \ 'suggested_filetypes': ['html', 'htmldjango'], \ 'description': 'Fix HTML files with html-beautify.', \ }, -\ 'dhall': { -\ 'function': 'ale#fixers#dhall#Fix', -\ 'suggested_filetypes': ['dhall'], -\ 'description': 'Fix Dhall files with dhall-format.', -\ }, \} " Reset the function registry to the default entries. diff --git a/autoload/ale/fixers/dhall.vim b/autoload/ale/fixers/dhall.vim deleted file mode 100644 index 18f6006c..00000000 --- a/autoload/ale/fixers/dhall.vim +++ /dev/null @@ -1,23 +0,0 @@ -" Author: Pat Brisbin -" Description: Integration of dhall-format with ALE. - -call ale#Set('dhall_format_executable', 'dhall') - -function! ale#fixers#dhall#GetExecutable(buffer) abort - let l:executable = ale#Var(a:buffer, 'dhall_format_executable') - - " Dhall is written in Haskell and commonly installed with Stack - return ale#handlers#haskell_stack#EscapeExecutable(l:executable, 'dhall') -endfunction - -function! ale#fixers#dhall#Fix(buffer) abort - let l:executable = ale#fixers#dhall#GetExecutable(a:buffer) - - return { - \ 'command': l:executable - \ . ' format' - \ . ' --inplace' - \ . ' %t', - \ 'read_temporary_file': 1, - \} -endfunction diff --git a/autoload/ale/fixers/dhall_format.vim b/autoload/ale/fixers/dhall_format.vim index 214af2c8..d4021983 100644 --- a/autoload/ale/fixers/dhall_format.vim +++ b/autoload/ale/fixers/dhall_format.vim @@ -1,6 +1,6 @@ " Author: toastal " Description: Dhall’s built-in formatter - +" function! ale#fixers#dhall_format#Fix(buffer) abort let l:executable = ale#dhall#GetExecutableWithOptions(a:buffer) let l:command = l:executable diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index c6bcf421..7579566a 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -121,6 +121,8 @@ Notes: * `language_server` * Dhall * `dhall-format` + * `dhall-freeze` + * `dhall-lint` * Dockerfile * `dockerfile_lint` * `hadolint` diff --git a/test/fixers/test_dhall_fixer_callback.vader b/test/fixers/test_dhall_fixer_callback.vader deleted file mode 100644 index f27880b7..00000000 --- a/test/fixers/test_dhall_fixer_callback.vader +++ /dev/null @@ -1,11 +0,0 @@ -Before: - call ale#assert#SetUpFixerTest('dhall', 'dhall') - -After: - call ale#assert#TearDownFixerTest() - -Execute(The default command should be correct): - AssertFixer - \ { 'read_temporary_file': 1, - \ 'command': ale#Escape('dhall') . ' format --inplace %t' - \ } diff --git a/test/fixers/test_dhall_format_fixer_callback.vader b/test/fixers/test_dhall_format_fixer_callback.vader index 02873473..9bc17f7e 100644 --- a/test/fixers/test_dhall_format_fixer_callback.vader +++ b/test/fixers/test_dhall_format_fixer_callback.vader @@ -6,22 +6,19 @@ Before: let g:ale_dhall_executable = 'odd-dhall' let g:ale_dhall_options = '--ascii' - call ale#test#SetDirectory('/testplugin/test/dhall') + call ale#assert#SetUpFixerTest('dhall-format', 'dhall-format') After: - Restore - - call ale#test#RestoreDirectory() + call ale#assert#TearDownFixerTest() Execute(The dhall-format callback should return the correct options): call ale#test#SetFilename('../dhall_files/testfile.dhall') - AssertEqual + AssertFixer \ { \ 'command': ale#Escape('odd-dhall') \ . ' --ascii' \ . ' format' \ . ' --inplace %t', \ 'read_temporary_file': 1, - \ }, - \ ale#fixers#dhall_format#Fix(bufnr('')) + \ } diff --git a/test/fixers/test_dhall_freeze_fixer_callback.vader b/test/fixers/test_dhall_freeze_fixer_callback.vader index 6e9650eb..c8f820bb 100644 --- a/test/fixers/test_dhall_freeze_fixer_callback.vader +++ b/test/fixers/test_dhall_freeze_fixer_callback.vader @@ -7,17 +7,13 @@ Before: let g:ale_dhall_options = '--ascii' let g:ale_dhall_freeze_options = '--all' - call ale#test#SetDirectory('/testplugin/test/dhall') + call ale#assert#SetUpFixerTest('dhall-freeze', 'dhall-freeze') After: - Restore - - call ale#test#RestoreDirectory() + call ale#assert#TearDownFixerTest() Execute(The dhall-freeze callback should return the correct options): - call ale#test#SetFilename('../dhall_files/testfile.dhall') - - AssertEqual + AssertFixer \ { \ 'command': ale#Escape('odd-dhall') \ . ' --ascii' @@ -25,5 +21,4 @@ Execute(The dhall-freeze callback should return the correct options): \ . ' --all' \ . ' --inplace %t', \ 'read_temporary_file': 1, - \ }, - \ ale#fixers#dhall_freeze#Freeze(bufnr('')) + \ } diff --git a/test/fixers/test_dhall_lint_fixer_callback.vader b/test/fixers/test_dhall_lint_fixer_callback.vader index c60b7a73..82229363 100644 --- a/test/fixers/test_dhall_lint_fixer_callback.vader +++ b/test/fixers/test_dhall_lint_fixer_callback.vader @@ -6,22 +6,17 @@ Before: let g:ale_dhall_executable = 'odd-dhall' let g:ale_dhall_options = '--ascii' - call ale#test#SetDirectory('/testplugin/test/dhall') + call ale#assert#SetUpFixerTest('dhall-lint', 'dhall-lint') After: - Restore - - call ale#test#RestoreDirectory() + call ale#assert#TearDownFixerTest() Execute(The dhall-lint callback should return the correct options): - call ale#test#SetFilename('../dhall_files/testfile.dhall') - - AssertEqual + AssertFixer \ { \ 'command': ale#Escape('odd-dhall') \ . ' --ascii' \ . ' lint' \ . ' --inplace %t', \ 'read_temporary_file': 1, - \ }, - \ ale#fixers#dhall_lint#Fix(bufnr('')) + \ } -- cgit v1.2.3 From 48cbf1cb36e6e289be6275e6643504326963c3a4 Mon Sep 17 00:00:00 2001 From: toastal Date: Fri, 25 Sep 2020 08:26:17 +0700 Subject: dhall alias --- autoload/ale/fix/registry.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 218a0f95..7b2682bf 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -36,6 +36,7 @@ let s:default_registry = { \ 'function': 'ale#fixers#dhall_format#Fix', \ 'suggested_filetypes': ['dhall'], \ 'description': 'Standard code formatter for the Dhall language', +\ 'aliases': ['dhall'], \ }, \ 'dhall-freeze': { \ 'function': 'ale#fixers#dhall_freeze#Freeze', -- cgit v1.2.3 From 96d84159469dfc28bde82bacfa1c3bc81b0cbdfa Mon Sep 17 00:00:00 2001 From: Manoel Brunnen Date: Tue, 3 Nov 2020 23:06:14 +0100 Subject: Add -imacros to C flags --- autoload/ale/c.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/autoload/ale/c.vim b/autoload/ale/c.vim index cff53125..c7b1e20a 100644 --- a/autoload/ale/c.vim +++ b/autoload/ale/c.vim @@ -152,6 +152,7 @@ function! ale#c#ParseCFlags(path_prefix, should_quote, raw_arguments) abort \ || stridx(l:option, '-idirafter') == 0 \ || stridx(l:option, '-iframework') == 0 \ || stridx(l:option, '-include') == 0 + \ || stridx(l:option, '-imacros') == 0 if stridx(l:option, '-I') == 0 && l:option isnot# '-I' let l:arg = join(split(l:option, '\zs')[2:], '') let l:option = '-I' -- cgit v1.2.3 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 +- test/command_callback/test_rust_analyzer_callbacks.vader | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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'), diff --git a/test/command_callback/test_rust_analyzer_callbacks.vader b/test/command_callback/test_rust_analyzer_callbacks.vader index 95866076..efab1378 100644 --- a/test/command_callback/test_rust_analyzer_callbacks.vader +++ b/test/command_callback/test_rust_analyzer_callbacks.vader @@ -16,5 +16,5 @@ Execute(The project root should be detected correctly): Execute(Should accept configuration settings): AssertLSPConfig {} - let b:ale_rust_analyzer_config = {'rust': {'clippy_preference': 'on'}} - AssertLSPConfig {'rust': {'clippy_preference': 'on'}} + let b:ale_rust_analyzer_config = {'diagnostics': {'disabled': ['unresolved-import']}} + AssertLSPOptions {'diagnostics': {'disabled': ['unresolved-import']}} -- cgit v1.2.3 From 2ab46d4b8e9611e25cd880ee1f4b4a71b59f0446 Mon Sep 17 00:00:00 2001 From: Dalius Dobravolskas Date: Wed, 23 Sep 2020 16:08:14 +0300 Subject: Show tsserver hints/suggestions in Ale. --- autoload/ale/lsp_linter.vim | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/autoload/ale/lsp_linter.vim b/autoload/ale/lsp_linter.vim index dcd76e8f..6c286f9c 100644 --- a/autoload/ale/lsp_linter.vim +++ b/autoload/ale/lsp_linter.vim @@ -85,12 +85,18 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort endif let l:info.syntax_loclist = l:thislist - else + elseif a:error_type is# 'semantic' if len(l:thislist) is 0 && len(get(l:info, 'semantic_loclist', [])) is 0 let l:no_changes = 1 endif let l:info.semantic_loclist = l:thislist + else + if len(l:thislist) is 0 && len(get(l:info, 'suggestion_loclist', [])) is 0 + let l:no_changes = 1 + endif + + let l:info.suggestion_loclist = l:thislist endif if l:no_changes @@ -98,6 +104,7 @@ function! s:HandleTSServerDiagnostics(response, error_type) abort endif let l:loclist = get(l:info, 'semantic_loclist', []) + \ + get(l:info, 'suggestion_loclist', []) \ + get(l:info, 'syntax_loclist', []) call ale#engine#HandleLoclist(l:linter_name, l:buffer, l:loclist, 0) @@ -150,6 +157,9 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort elseif get(a:response, 'type', '') is# 'event' \&& get(a:response, 'event', '') is# 'syntaxDiag' call s:HandleTSServerDiagnostics(a:response, 'syntax') + elseif get(a:response, 'type', '') is# 'event' + \&& get(a:response, 'event', '') is# 'suggestionDiag' + call s:HandleTSServerDiagnostics(a:response, 'suggestion') endif endfunction -- cgit v1.2.3 From c098a07d67090442164b4bca82ebbedae992bf50 Mon Sep 17 00:00:00 2001 From: Dalius Dobravolskas Date: Wed, 23 Sep 2020 16:24:45 +0300 Subject: Tests added. --- ...test_redundant_tsserver_rendering_avoided.vader | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/test/test_redundant_tsserver_rendering_avoided.vader b/test/test_redundant_tsserver_rendering_avoided.vader index 6125ebc2..12897da4 100644 --- a/test/test_redundant_tsserver_rendering_avoided.vader +++ b/test/test_redundant_tsserver_rendering_avoided.vader @@ -138,3 +138,31 @@ Execute(Non-empty then non-empty semantic errors should be handled): call ale#lsp_linter#HandleLSPResponse(1, CreateError('semanticDiag', 'x')) Assert g:ale_handle_loclist_called + +Execute(Subsequent empty lists should be ignored): + let g:ale_buffer_info[bufnr('')].suggestion_loclist [] + + call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', '')) + + Assert !g:ale_handle_loclist_called + +Execute(Empty then non-empty semantic errors should be handled): + let g:ale_buffer_info[bufnr('')].suggestion_loclist = [] + + call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x')) + + Assert g:ale_handle_loclist_called + +Execute(Non-empty then empty semantic errors should be handled): + let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x') + + call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', '')) + + Assert g:ale_handle_loclist_called + +Execute(Non-empty then non-empty semantic errors should be handled): + let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x') + + call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x')) + + Assert g:ale_handle_loclist_called -- cgit v1.2.3 From 17c0c3c731ddf543161195fa55b73721a3bf490d Mon Sep 17 00:00:00 2001 From: Dalius Dobravolskas Date: Wed, 23 Sep 2020 16:35:47 +0300 Subject: Test fix. --- test/test_redundant_tsserver_rendering_avoided.vader | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/test_redundant_tsserver_rendering_avoided.vader b/test/test_redundant_tsserver_rendering_avoided.vader index 12897da4..bde5d152 100644 --- a/test/test_redundant_tsserver_rendering_avoided.vader +++ b/test/test_redundant_tsserver_rendering_avoided.vader @@ -111,7 +111,7 @@ Execute(An initial list of semantic errors should be handled): Assert g:ale_handle_loclist_called -Execute(Subsequent empty lists should be ignored): +Execute(Subsequent empty lists should be ignored - semantic): let g:ale_buffer_info[bufnr('')].semantic_loclist = [] call ale#lsp_linter#HandleLSPResponse(1, CreateError('semanticDiag', '')) @@ -139,28 +139,28 @@ Execute(Non-empty then non-empty semantic errors should be handled): Assert g:ale_handle_loclist_called -Execute(Subsequent empty lists should be ignored): - let g:ale_buffer_info[bufnr('')].suggestion_loclist [] +Execute(Subsequent empty lists should be ignored - suggestion): + let g:ale_buffer_info[bufnr('')].suggestion_loclist = [] call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', '')) Assert !g:ale_handle_loclist_called -Execute(Empty then non-empty semantic errors should be handled): +Execute(Empty then non-empty suggestion messages should be handled): let g:ale_buffer_info[bufnr('')].suggestion_loclist = [] call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x')) Assert g:ale_handle_loclist_called -Execute(Non-empty then empty semantic errors should be handled): +Execute(Non-empty then empt suggestion messages should be handled): let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x') call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', '')) Assert g:ale_handle_loclist_called -Execute(Non-empty then non-empty semantic errors should be handled): +Execute(Non-empty then non-empty suggestion messages should be handled): let g:ale_buffer_info[bufnr('')].suggestion_loclist = CreateLoclist('x') call ale#lsp_linter#HandleLSPResponse(1, CreateError('suggestionDiag', 'x')) -- cgit v1.2.3 From 81d16823a7ff5972d2a352831053f3cd6922b6c3 Mon Sep 17 00:00:00 2001 From: Dalius Dobravolskas Date: Sun, 25 Oct 2020 21:58:22 +0200 Subject: Settings to control suggestions. --- autoload/ale/lsp_linter.vim | 1 + doc/ale.txt | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/autoload/ale/lsp_linter.vim b/autoload/ale/lsp_linter.vim index 6c286f9c..628dde78 100644 --- a/autoload/ale/lsp_linter.vim +++ b/autoload/ale/lsp_linter.vim @@ -159,6 +159,7 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort call s:HandleTSServerDiagnostics(a:response, 'syntax') elseif get(a:response, 'type', '') is# 'event' \&& get(a:response, 'event', '') is# 'suggestionDiag' + \&& get(g:, 'ale_lsp_suggestions', '1') == 1 call s:HandleTSServerDiagnostics(a:response, 'suggestion') endif endfunction diff --git a/doc/ale.txt b/doc/ale.txt index 20baf355..3b72cac7 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -1677,6 +1677,15 @@ g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity* `'disabled'` - Doesn't display any information at all. +g:ale_lsp_suggestions *g:ale_lsp_suggestions* + + Type: |Number| + Default: 1 + + This variable defines if suggestions must be collected from LSP or tsserver + and shown. + + g:ale_lsp_root *g:ale_lsp_root* *b:ale_lsp_root* -- 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(+) 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 7d8275daf57269df0fb8f32f421344bea6364cb5 Mon Sep 17 00:00:00 2001 From: Gonzalo Quero Date: Wed, 2 Sep 2020 13:39:32 +0100 Subject: chore: Add Elixir Credo tests --- test/test_elixir_credo.vader | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 test/test_elixir_credo.vader diff --git a/test/test_elixir_credo.vader b/test/test_elixir_credo.vader new file mode 100644 index 00000000..db956683 --- /dev/null +++ b/test/test_elixir_credo.vader @@ -0,0 +1,33 @@ +Before: + call ale#test#SetDirectory('/testplugin/test') + + runtime ale_linters/elixir/credo.vim + +After: + call ale#test#RestoreDirectory() + call ale#linter#Reset() + let g:ale_elixir_credo_strict = 0 + let g:ale_elixir_credo_config_file = '' + +Execute(credo runs the right command): + call ale#test#SetFilename('elixir-test-files/testfile.ex') + + AssertEqual + \ ale_linters#elixir#credo#GetCommand(bufnr('')), + \ 'cd ''.'' && mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s' + +Execute(credo runs the right command with the strict flag): + let g:ale_elixir_credo_strict = 1 + call ale#test#SetFilename('elixir-test-files/testfile.ex') + + AssertEqual + \ ale_linters#elixir#credo#GetCommand(bufnr('')), + \ 'cd ''.'' && mix help credo && mix credo --strict --format=flycheck --read-from-stdin %s' + +Execute(credo runs the right command with a custom config file): + let g:ale_elixir_credo_config_file = '/home/user/custom_credo.exs' + call ale#test#SetFilename('elixir-test-files/testfile.ex') + + AssertEqual + \ ale_linters#elixir#credo#GetCommand(bufnr('')), + \ 'cd ''.'' && mix help credo && mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s' -- cgit v1.2.3 From 05d5cc49881bfef6cfcdf1f6bcf5771d9a8a4b93 Mon Sep 17 00:00:00 2001 From: Gonzalo Quero Date: Wed, 2 Sep 2020 13:39:51 +0100 Subject: chore: Document config_file variable --- doc/ale-elixir.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/ale-elixir.txt b/doc/ale-elixir.txt index de9daacf..a4e5c2c6 100644 --- a/doc/ale-elixir.txt +++ b/doc/ale-elixir.txt @@ -85,5 +85,12 @@ g:ale_elixir_credo_strict *g:ale_elixir_credo_strict* Tells credo to run in strict mode or suggest mode. Set variable to 1 to enable --strict mode. +g:ale_elixir_credo_config_file g:ale_elixir_credo_config_file + + Type: String + Default: '' + + Tells credo to use a custom configuration file. + =============================================================================== vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: -- cgit v1.2.3 From 491ceacb64f7be6c4e36fd6586af22adfd6a309e Mon Sep 17 00:00:00 2001 From: Gonzalo Quero Date: Wed, 2 Sep 2020 14:31:11 +0100 Subject: fix: Use proper CdPath function in test --- test/test_elixir_credo.vader | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/test_elixir_credo.vader b/test/test_elixir_credo.vader index db956683..78d3e0a6 100644 --- a/test/test_elixir_credo.vader +++ b/test/test_elixir_credo.vader @@ -2,19 +2,21 @@ Before: call ale#test#SetDirectory('/testplugin/test') runtime ale_linters/elixir/credo.vim + let g:test_command_start = ale#path#CdString('.') . 'mix help credo && ' After: call ale#test#RestoreDirectory() call ale#linter#Reset() let g:ale_elixir_credo_strict = 0 let g:ale_elixir_credo_config_file = '' + let g:test_command_start = '' Execute(credo runs the right command): call ale#test#SetFilename('elixir-test-files/testfile.ex') AssertEqual \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ 'cd ''.'' && mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s' + \ g:test_command_start . 'mix credo suggest --format=flycheck --read-from-stdin %s' Execute(credo runs the right command with the strict flag): let g:ale_elixir_credo_strict = 1 @@ -22,7 +24,7 @@ Execute(credo runs the right command with the strict flag): AssertEqual \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ 'cd ''.'' && mix help credo && mix credo --strict --format=flycheck --read-from-stdin %s' + \ g:test_command_start . 'mix credo --strict --format=flycheck --read-from-stdin %s' Execute(credo runs the right command with a custom config file): let g:ale_elixir_credo_config_file = '/home/user/custom_credo.exs' @@ -30,4 +32,4 @@ Execute(credo runs the right command with a custom config file): AssertEqual \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ 'cd ''.'' && mix help credo && mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s' + \ g:test_command_start . 'mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s' -- 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 ++--- test/command_callback/test_elixir_credo.vader | 7 ++++++ test/test_elixir_credo.vader | 35 --------------------------- 3 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 test/test_elixir_credo.vader 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 diff --git a/test/command_callback/test_elixir_credo.vader b/test/command_callback/test_elixir_credo.vader index 3eb88846..b14444c6 100644 --- a/test/command_callback/test_elixir_credo.vader +++ b/test/command_callback/test_elixir_credo.vader @@ -38,3 +38,10 @@ Execute(Builds credo command with suggest mode when set to 0): AssertLinter 'mix', \ ale#path#CdString(ale#path#Simplify(g:dir . '/elixir_paths/mix_project')) \ . 'mix help credo && mix credo suggest --format=flycheck --read-from-stdin %s' + +Execute(Builds credo command with a custom config file): + let g:ale_elixir_credo_config_file = '/home/user/custom_credo.exs' + + AssertLinter 'mix', + \ ale#path#CdString(ale#path#Simplify(g:dir . '/elixir_paths/mix_project')) + \ . 'mix help credo && mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s' diff --git a/test/test_elixir_credo.vader b/test/test_elixir_credo.vader deleted file mode 100644 index 78d3e0a6..00000000 --- a/test/test_elixir_credo.vader +++ /dev/null @@ -1,35 +0,0 @@ -Before: - call ale#test#SetDirectory('/testplugin/test') - - runtime ale_linters/elixir/credo.vim - let g:test_command_start = ale#path#CdString('.') . 'mix help credo && ' - -After: - call ale#test#RestoreDirectory() - call ale#linter#Reset() - let g:ale_elixir_credo_strict = 0 - let g:ale_elixir_credo_config_file = '' - let g:test_command_start = '' - -Execute(credo runs the right command): - call ale#test#SetFilename('elixir-test-files/testfile.ex') - - AssertEqual - \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ g:test_command_start . 'mix credo suggest --format=flycheck --read-from-stdin %s' - -Execute(credo runs the right command with the strict flag): - let g:ale_elixir_credo_strict = 1 - call ale#test#SetFilename('elixir-test-files/testfile.ex') - - AssertEqual - \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ g:test_command_start . 'mix credo --strict --format=flycheck --read-from-stdin %s' - -Execute(credo runs the right command with a custom config file): - let g:ale_elixir_credo_config_file = '/home/user/custom_credo.exs' - call ale#test#SetFilename('elixir-test-files/testfile.ex') - - AssertEqual - \ ale_linters#elixir#credo#GetCommand(bufnr('')), - \ g:test_command_start . 'mix credo suggest --config-file /home/user/custom_credo.exs --format=flycheck --read-from-stdin %s' -- 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 ++++++++++++++++- doc/ale-dafny.txt | 16 ++++++++++++++++ doc/ale.txt | 2 ++ 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 doc/ale-dafny.txt 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, \ }) diff --git a/doc/ale-dafny.txt b/doc/ale-dafny.txt new file mode 100644 index 00000000..005170ad --- /dev/null +++ b/doc/ale-dafny.txt @@ -0,0 +1,16 @@ +=============================================================================== +ALE Dafny Integration *ale-dafny-options* + + +=============================================================================== +dafny *ale-dafny-dafny* + +g:ale_dafny_dafny_timelimit *g:ale_dafny_dafny_timelimit* + *b:ale_dafny_dafny_timelimit* + Type: |Number| + Default: `10` + + This variable sets the `/timeLimit` used for dafny. + + + vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale.txt b/doc/ale.txt index 6ef137c1..06fe9ee8 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2571,6 +2571,8 @@ documented in additional help files. dfmt..................................|ale-d-dfmt| dls...................................|ale-d-dls| uncrustify............................|ale-d-uncrustify| + dafny...................................|ale-dafny-options| + dafny.................................|ale-dafny-dafny| dart....................................|ale-dart-options| dartanalyzer..........................|ale-dart-dartanalyzer| dartfmt...............................|ale-dart-dartfmt| -- cgit v1.2.3 From 303b89a6b4ace2ee41818499b958a2f486e8864c Mon Sep 17 00:00:00 2001 From: "D. Ben Knoble" Date: Mon, 30 Nov 2020 13:40:57 -0500 Subject: add tests --- test/handler/test_dafny_handler.vader | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/handler/test_dafny_handler.vader b/test/handler/test_dafny_handler.vader index 674f691d..75567414 100644 --- a/test/handler/test_dafny_handler.vader +++ b/test/handler/test_dafny_handler.vader @@ -20,9 +20,17 @@ Execute(The Dafny handler should parse output correctly): \ 'lnum': 678, \ 'text': 'This is the precondition that might not hold.', \ 'type': 'W' - \ } + \ }, + \ { + \ 'bufnr': 0, + \ 'col': 45, + \ 'lnum': 123, + \ 'text': "Verification of 'Impl$$_22_Proof.__default.PutKeepsMapsFull' timed out after 2 seconds", + \ 'type': 'E' + \ }, \ ], \ ale_linters#dafny#dafny#Handle(0, [ \ 'File.dfy(123,45): Error BP5002: A precondition for this call might not hold.', - \ 'File.dfy(678,90): Related location: This is the precondition that might not hold.' + \ 'File.dfy(678,90): Related location: This is the precondition that might not hold.', + \ "File.dfy(123,45): Verification of 'Impl$$_22_Proof.__default.PutKeepsMapsFull' timed out after 2 seconds", \ ]) -- 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 ++-- test/command_callback/test_julia_languageserver_callbacks.vader | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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', { diff --git a/test/command_callback/test_julia_languageserver_callbacks.vader b/test/command_callback/test_julia_languageserver_callbacks.vader index 3bc46e3d..75b858e5 100644 --- a/test/command_callback/test_julia_languageserver_callbacks.vader +++ b/test/command_callback/test_julia_languageserver_callbacks.vader @@ -11,16 +11,16 @@ After: Execute(The default executable path should be correct): AssertLinter 'julia', \ ale#Escape('julia') . - \' --startup-file=no --history-file=no -e ' . - \ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);') + \'--project=@. --startup-file=no --history-file=no -e ' . + \ ale#Escape('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);') Execute(The executable should be configurable): let g:ale_julia_executable = 'julia-new' AssertLinter 'julia-new', \ ale#Escape('julia-new') . - \' --startup-file=no --history-file=no -e ' . - \ ale#Escape('using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);') + \'--project=@. --startup-file=no --history-file=no -e ' . + \ ale#Escape('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);') Execute(The project root should be detected correctly): AssertLSPProject '' -- 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(-) 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 From 6043eeb25ad9019aa1322912de1081fa8a0fa299 Mon Sep 17 00:00:00 2001 From: Andrea Conti Date: Sat, 12 Dec 2020 00:41:05 +0100 Subject: Fix test space bug --- test/command_callback/test_julia_languageserver_callbacks.vader | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/command_callback/test_julia_languageserver_callbacks.vader b/test/command_callback/test_julia_languageserver_callbacks.vader index 75b858e5..96df81f1 100644 --- a/test/command_callback/test_julia_languageserver_callbacks.vader +++ b/test/command_callback/test_julia_languageserver_callbacks.vader @@ -11,7 +11,7 @@ After: Execute(The default executable path should be correct): AssertLinter 'julia', \ ale#Escape('julia') . - \'--project=@. --startup-file=no --history-file=no -e ' . + \' --project=@. --startup-file=no --history-file=no -e ' . \ ale#Escape('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);') Execute(The executable should be configurable): @@ -19,7 +19,7 @@ Execute(The executable should be configurable): AssertLinter 'julia-new', \ ale#Escape('julia-new') . - \'--project=@. --startup-file=no --history-file=no -e ' . + \' --project=@. --startup-file=no --history-file=no -e ' . \ ale#Escape('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);') Execute(The project root should be detected correctly): -- cgit v1.2.3 From 02255dd967cd127d4910bf489a655009fa66ba14 Mon Sep 17 00:00:00 2001 From: Manoel Brunnen Date: Mon, 21 Dec 2020 14:59:08 +0100 Subject: Add tests for -imacros C flag --- test/test_c_flag_parsing.vader | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test_c_flag_parsing.vader b/test/test_c_flag_parsing.vader index 99722b17..8b02f2b9 100644 --- a/test/test_c_flag_parsing.vader +++ b/test/test_c_flag_parsing.vader @@ -482,6 +482,7 @@ Execute(We should include several important flags): \ . ' -idirafter ' . ale#Escape(ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/incafter')) \ . ' -iframework ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/incframework')) \ . ' -include ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/foo bar')) + \ . ' -imacros ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/incmacros')) \ . ' -Dmacro="value"' \ . ' -DGoal=9' \ . ' -D macro2' @@ -511,6 +512,8 @@ Execute(We should include several important flags): \ 'incframework', \ '-include', \ '''foo bar''', + \ '-imacros', + \ 'incmacros', \ '-Dmacro="value"', \ '-DGoal=9', \ '-D', @@ -559,6 +562,7 @@ Execute(We should quote the flags we need to quote): \ . ' -idirafter ' . ale#Escape(ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/incafter')) \ . ' -iframework ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/incframework')) \ . ' -include ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/foo bar')) + \ . ' -imacros ' . ale#Escape(ale#path#Simplify(g:dir . '/test_c_projects/makefile_project/incmacros')) \ . ' ' . ale#Escape('-Dmacro="value"') \ . ' -DGoal=9' \ . ' -D macro2' @@ -591,6 +595,8 @@ Execute(We should quote the flags we need to quote): \ 'incframework', \ '-include', \ '''foo bar''', + \ '-imacros', + \ 'incmacros', \ '-Dmacro="value"', \ '-DGoal=9', \ '-D', -- cgit v1.2.3