From 87a0227d01df14c9de7d3469b54cb73a98511ae2 Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 09:43:55 +0200 Subject: added support for Ada Language Server --- ale_linters/ada/adalsp.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ale_linters/ada/adalsp.vim diff --git a/ale_linters/ada/adalsp.vim b/ale_linters/ada/adalsp.vim new file mode 100644 index 00000000..10c4be07 --- /dev/null +++ b/ale_linters/ada/adalsp.vim @@ -0,0 +1,16 @@ +" Author: Bartek Jasicki http://github.com/thindil +" Description: Support for Ada Language Server + +call ale#Set('ada_lsp_executable', 'ada_language_server') + +function! ale_linters#ada#adalsp#GetRootDirectory(buffer) abort + return fnamemodify(bufname(a:buffer), ':p:h') +endfunction + +call ale#linter#Define('ada', { +\ 'name': 'adalsp', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'ada_lsp_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#ada#adalsp#GetRootDirectory'), +\}) -- cgit v1.2.3 From 489b7d64e4a22492e94a18fe5a05703735e63afc Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 09:55:05 +0200 Subject: updated documentation --- doc/ale-ada.txt | 11 +++++++++++ doc/ale-supported-languages-and-tools.txt | 1 + doc/ale.txt | 1 + supported-tools.md | 1 + 4 files changed, 14 insertions(+) diff --git a/doc/ale-ada.txt b/doc/ale-ada.txt index 2ac30c0a..c439d88a 100644 --- a/doc/ale-ada.txt +++ b/doc/ale-ada.txt @@ -32,5 +32,16 @@ g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options* This variable can be set to pass extra options to the gnatpp fixer. +=============================================================================== +Ada Language Server *ale-ada-lsp* + +g:ale_ada_lsp_executable *g:ale_ada_lsp_executable* + *b:ale_ada_lsp_executable* + Type: |String| + Default: `'ada_language_server'` + + This variable can be changed to use a different executable for Ada Language + Server. + =============================================================================== vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index a5b7c35e..626ce260 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -15,6 +15,7 @@ Notes: * Ada * `gcc` * `gnatpp` + * `ada_language_server` * Ansible * `ansible-lint` * API Blueprint diff --git a/doc/ale.txt b/doc/ale.txt index c6e48043..96d9e603 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2106,6 +2106,7 @@ documented in additional help files. ada.....................................|ale-ada-options| gcc...................................|ale-ada-gcc| gnatpp................................|ale-ada-gnatpp| + ada_language_server...................|ale-ada-lsp| ansible.................................|ale-ansible-options| ansible-lint..........................|ale-ansible-ansible-lint| asciidoc................................|ale-asciidoc-options| diff --git a/supported-tools.md b/supported-tools.md index e392f282..8a74b26e 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -24,6 +24,7 @@ formatting. * Ada * [gcc](https://gcc.gnu.org) * [gnatpp](https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/gnat_utility_programs.html#the-gnat-pretty-printer-gnatpp) :floppy_disk: + * [ada_language_server](https://github.com/AdaCore/ada_language_server) * Ansible * [ansible-lint](https://github.com/willthames/ansible-lint) * API Blueprint -- cgit v1.2.3 From 38e0e3feefad4e5974224a05cfa612c52bd8e358 Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 10:08:36 +0200 Subject: added adalsp test --- test/command_callback/test_adalsp_command_callbacks.vader | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/command_callback/test_adalsp_command_callbacks.vader diff --git a/test/command_callback/test_adalsp_command_callbacks.vader b/test/command_callback/test_adalsp_command_callbacks.vader new file mode 100644 index 00000000..73cbf296 --- /dev/null +++ b/test/command_callback/test_adalsp_command_callbacks.vader @@ -0,0 +1,12 @@ +Before: + call ale#assert#SetUpLinterTest('ada', 'adalsp') + +After: + call ale#assert#TearDownLinterTest() + +Execute(It does not set Ada sources by default): + AssertLinter 'adalsp', ale#Escape('adalsp') + +Execute(Sets adalsp executable): + let g:ale_ada_adalsp_executable = '/path/to /Ada' + AssertLinter 'adalsp', ale#Escape('adalsp') . ' ' . ale#Escape('/path/to /Ada') -- cgit v1.2.3 From c74cc931404ba94ccb71a6db2f54d78ba922aaab Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 10:35:54 +0200 Subject: fixed test --- test/command_callback/test_adalsp_command_callbacks.vader | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/command_callback/test_adalsp_command_callbacks.vader b/test/command_callback/test_adalsp_command_callbacks.vader index 73cbf296..e02ade30 100644 --- a/test/command_callback/test_adalsp_command_callbacks.vader +++ b/test/command_callback/test_adalsp_command_callbacks.vader @@ -4,9 +4,6 @@ Before: After: call ale#assert#TearDownLinterTest() -Execute(It does not set Ada sources by default): - AssertLinter 'adalsp', ale#Escape('adalsp') - Execute(Sets adalsp executable): - let g:ale_ada_adalsp_executable = '/path/to /Ada' - AssertLinter 'adalsp', ale#Escape('adalsp') . ' ' . ale#Escape('/path/to /Ada') + let g:ale_ada_lsp_executable = '/path/to /Ada' + AssertLinter 'adalsp', ale#Escape('/path/to /Ada') -- cgit v1.2.3 From 321a3892a73b39bab4b1833b1473a6e0b46dc9fd Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 10:41:19 +0200 Subject: fixed test again (this time for sure) --- test/command_callback/test_adalsp_command_callbacks.vader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command_callback/test_adalsp_command_callbacks.vader b/test/command_callback/test_adalsp_command_callbacks.vader index e02ade30..92c6dfb0 100644 --- a/test/command_callback/test_adalsp_command_callbacks.vader +++ b/test/command_callback/test_adalsp_command_callbacks.vader @@ -6,4 +6,4 @@ After: Execute(Sets adalsp executable): let g:ale_ada_lsp_executable = '/path/to /Ada' - AssertLinter 'adalsp', ale#Escape('/path/to /Ada') + AssertLinter ale#Escape('/path/to /Ada'), ale#Escape('/path/to /Ada') -- cgit v1.2.3 From c30869617f6c829378d1931dc5ddf102924f5650 Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 10:48:50 +0200 Subject: another fix for test --- test/command_callback/test_adalsp_command_callbacks.vader | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/command_callback/test_adalsp_command_callbacks.vader b/test/command_callback/test_adalsp_command_callbacks.vader index 92c6dfb0..e635acb3 100644 --- a/test/command_callback/test_adalsp_command_callbacks.vader +++ b/test/command_callback/test_adalsp_command_callbacks.vader @@ -6,4 +6,4 @@ After: Execute(Sets adalsp executable): let g:ale_ada_lsp_executable = '/path/to /Ada' - AssertLinter ale#Escape('/path/to /Ada'), ale#Escape('/path/to /Ada') + AssertLinter '/path/to /Ada', ale#Escape('/path/to /Ada') -- cgit v1.2.3 From 5cbf7007ff18d100e5fb081297b6330dd75bdabf Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 11:00:49 +0200 Subject: fixed documentation --- doc/ale-ada.txt | 2 +- doc/ale-supported-languages-and-tools.txt | 2 +- doc/ale.txt | 2 +- supported-tools.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ale-ada.txt b/doc/ale-ada.txt index c439d88a..325bbea8 100644 --- a/doc/ale-ada.txt +++ b/doc/ale-ada.txt @@ -33,7 +33,7 @@ g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options* =============================================================================== -Ada Language Server *ale-ada-lsp* +Ada Language Server *ale-ada-ada_language_server* g:ale_ada_lsp_executable *g:ale_ada_lsp_executable* *b:ale_ada_lsp_executable* diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index 626ce260..a9bd47d0 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -13,9 +13,9 @@ Notes: `!!` These linters check only files on disk. See |ale-lint-file-linters| * Ada + * `ada_language_server` * `gcc` * `gnatpp` - * `ada_language_server` * Ansible * `ansible-lint` * API Blueprint diff --git a/doc/ale.txt b/doc/ale.txt index 96d9e603..f275266b 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2106,7 +2106,7 @@ documented in additional help files. ada.....................................|ale-ada-options| gcc...................................|ale-ada-gcc| gnatpp................................|ale-ada-gnatpp| - ada_language_server...................|ale-ada-lsp| + ada_language_server...................|ale-ada-ada_language_server| ansible.................................|ale-ansible-options| ansible-lint..........................|ale-ansible-ansible-lint| asciidoc................................|ale-asciidoc-options| diff --git a/supported-tools.md b/supported-tools.md index 8a74b26e..b28685bd 100644 --- a/supported-tools.md +++ b/supported-tools.md @@ -22,9 +22,9 @@ formatting. --- * Ada + * [ada_language_server](https://github.com/AdaCore/ada_language_server) * [gcc](https://gcc.gnu.org) * [gnatpp](https://docs.adacore.com/gnat_ugn-docs/html/gnat_ugn/gnat_ugn/gnat_utility_programs.html#the-gnat-pretty-printer-gnatpp) :floppy_disk: - * [ada_language_server](https://github.com/AdaCore/ada_language_server) * Ansible * [ansible-lint](https://github.com/willthames/ansible-lint) * API Blueprint -- cgit v1.2.3 From 6d5d3fa4dd1cc18a5b90c587502ad37323df08a3 Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 11 Oct 2019 11:10:02 +0200 Subject: fixed documentation headers --- doc/ale-ada.txt | 4 ++-- doc/ale.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ale-ada.txt b/doc/ale-ada.txt index 325bbea8..4ffce5b7 100644 --- a/doc/ale-ada.txt +++ b/doc/ale-ada.txt @@ -33,9 +33,9 @@ g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options* =============================================================================== -Ada Language Server *ale-ada-ada_language_server* +ada-language-server *ale-ada-language-server* -g:ale_ada_lsp_executable *g:ale_ada_lsp_executable* +g:ale_ada_lsp_executable *g:ale_ada_lsp_executable* *b:ale_ada_lsp_executable* Type: |String| Default: `'ada_language_server'` diff --git a/doc/ale.txt b/doc/ale.txt index f275266b..c6c9418a 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -2106,7 +2106,7 @@ documented in additional help files. ada.....................................|ale-ada-options| gcc...................................|ale-ada-gcc| gnatpp................................|ale-ada-gnatpp| - ada_language_server...................|ale-ada-ada_language_server| + ada-language-server...................|ale-ada-language-server| ansible.................................|ale-ansible-options| ansible-lint..........................|ale-ansible-ansible-lint| asciidoc................................|ale-asciidoc-options| -- cgit v1.2.3 From 2f181658e6e40798c74e2f58067ab3aeffab8224 Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Fri, 18 Oct 2019 18:26:08 +0200 Subject: rename command variable to *_adals_* instead of *_lsp_* and whole name to adals instead of adalsp --- ale_linters/ada/adals.vim | 16 ++++++++++++++++ ale_linters/ada/adalsp.vim | 16 ---------------- doc/ale-ada.txt | 4 ++-- test/command_callback/test_adals_command_callbacks.vader | 9 +++++++++ .../command_callback/test_adalsp_command_callbacks.vader | 9 --------- 5 files changed, 27 insertions(+), 27 deletions(-) create mode 100644 ale_linters/ada/adals.vim delete mode 100644 ale_linters/ada/adalsp.vim create mode 100644 test/command_callback/test_adals_command_callbacks.vader delete mode 100644 test/command_callback/test_adalsp_command_callbacks.vader diff --git a/ale_linters/ada/adals.vim b/ale_linters/ada/adals.vim new file mode 100644 index 00000000..354156f0 --- /dev/null +++ b/ale_linters/ada/adals.vim @@ -0,0 +1,16 @@ +" Author: Bartek Jasicki http://github.com/thindil +" Description: Support for Ada Language Server + +call ale#Set('ada_adals_executable', 'ada_language_server') + +function! ale_linters#ada#adals#GetRootDirectory(buffer) abort + return fnamemodify(bufname(a:buffer), ':p:h') +endfunction + +call ale#linter#Define('ada', { +\ 'name': 'adals', +\ 'lsp': 'stdio', +\ 'executable': {b -> ale#Var(b, 'ada_adals_executable')}, +\ 'command': '%e', +\ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'), +\}) diff --git a/ale_linters/ada/adalsp.vim b/ale_linters/ada/adalsp.vim deleted file mode 100644 index 10c4be07..00000000 --- a/ale_linters/ada/adalsp.vim +++ /dev/null @@ -1,16 +0,0 @@ -" Author: Bartek Jasicki http://github.com/thindil -" Description: Support for Ada Language Server - -call ale#Set('ada_lsp_executable', 'ada_language_server') - -function! ale_linters#ada#adalsp#GetRootDirectory(buffer) abort - return fnamemodify(bufname(a:buffer), ':p:h') -endfunction - -call ale#linter#Define('ada', { -\ 'name': 'adalsp', -\ 'lsp': 'stdio', -\ 'executable': {b -> ale#Var(b, 'ada_lsp_executable')}, -\ 'command': '%e', -\ 'project_root': function('ale_linters#ada#adalsp#GetRootDirectory'), -\}) diff --git a/doc/ale-ada.txt b/doc/ale-ada.txt index 4ffce5b7..1a31c804 100644 --- a/doc/ale-ada.txt +++ b/doc/ale-ada.txt @@ -35,8 +35,8 @@ g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options* =============================================================================== ada-language-server *ale-ada-language-server* -g:ale_ada_lsp_executable *g:ale_ada_lsp_executable* - *b:ale_ada_lsp_executable* +g:ale_ada_adals_executable *g:ale_ada_adals_executable* + *b:ale_ada_adals_executable* Type: |String| Default: `'ada_language_server'` diff --git a/test/command_callback/test_adals_command_callbacks.vader b/test/command_callback/test_adals_command_callbacks.vader new file mode 100644 index 00000000..0b1f6006 --- /dev/null +++ b/test/command_callback/test_adals_command_callbacks.vader @@ -0,0 +1,9 @@ +Before: + call ale#assert#SetUpLinterTest('ada', 'adals') + +After: + call ale#assert#TearDownLinterTest() + +Execute(Sets adals executable): + let g:ale_ada_adals_executable = '/path/to /Ada' + AssertLinter '/path/to /Ada', ale#Escape('/path/to /Ada') diff --git a/test/command_callback/test_adalsp_command_callbacks.vader b/test/command_callback/test_adalsp_command_callbacks.vader deleted file mode 100644 index e635acb3..00000000 --- a/test/command_callback/test_adalsp_command_callbacks.vader +++ /dev/null @@ -1,9 +0,0 @@ -Before: - call ale#assert#SetUpLinterTest('ada', 'adalsp') - -After: - call ale#assert#TearDownLinterTest() - -Execute(Sets adalsp executable): - let g:ale_ada_lsp_executable = '/path/to /Ada' - AssertLinter '/path/to /Ada', ale#Escape('/path/to /Ada') -- cgit v1.2.3 From 3c80c67633484c9bf3fd957b8985eee6f23a1a9e Mon Sep 17 00:00:00 2001 From: Bartek Jasicki <thindil@laeran.pl> Date: Tue, 5 Nov 2019 17:58:53 +0100 Subject: Update ale_linters/ada/adals.vim Co-Authored-By: timlag1305 <timlag1305@gmail.com> --- ale_linters/ada/adals.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ale_linters/ada/adals.vim b/ale_linters/ada/adals.vim index 354156f0..e4f86b83 100644 --- a/ale_linters/ada/adals.vim +++ b/ale_linters/ada/adals.vim @@ -2,6 +2,15 @@ " Description: Support for Ada Language Server call ale#Set('ada_adals_executable', 'ada_language_server') +call ale#Set('ada_adals_project, 'default.gpr') +call ale#Set('ada_adals_encoding', 'utf-8') + +function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort + return { + \ 'ada.projectFile': ale#Var(a:buffer, 'ada_adals_project'), + \ 'ada.defaultCharset': ale#Var(a:buffer, 'ada_adals_encoding') + \} +endfunction function! ale_linters#ada#adals#GetRootDirectory(buffer) abort return fnamemodify(bufname(a:buffer), ':p:h') -- cgit v1.2.3 From 09209dc54b166542d1251dc19f567e455c22efdb Mon Sep 17 00:00:00 2001 From: Bartek Jasicki <thindil@laeran.pl> Date: Tue, 5 Nov 2019 17:59:17 +0100 Subject: Update ale_linters/ada/adals.vim Co-Authored-By: timlag1305 <timlag1305@gmail.com> --- ale_linters/ada/adals.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/ale_linters/ada/adals.vim b/ale_linters/ada/adals.vim index e4f86b83..a710a639 100644 --- a/ale_linters/ada/adals.vim +++ b/ale_linters/ada/adals.vim @@ -22,4 +22,5 @@ call ale#linter#Define('ada', { \ 'executable': {b -> ale#Var(b, 'ada_adals_executable')}, \ 'command': '%e', \ 'project_root': function('ale_linters#ada#adals#GetRootDirectory'), +\ 'lsp_config': function('ale_linters#ada#adals#GetAdaLSConfig') \}) -- cgit v1.2.3 From f63fd23f2e70631a24e9914fee17871f720586cd Mon Sep 17 00:00:00 2001 From: Bartek Jasicki <thindil@laeran.pl> Date: Tue, 5 Nov 2019 17:59:51 +0100 Subject: Update doc/ale-ada.txt Co-Authored-By: timlag1305 <timlag1305@gmail.com> --- doc/ale-ada.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/doc/ale-ada.txt b/doc/ale-ada.txt index 1a31c804..0fc55a9c 100644 --- a/doc/ale-ada.txt +++ b/doc/ale-ada.txt @@ -43,5 +43,24 @@ g:ale_ada_adals_executable *g:ale_ada_adals_executable* This variable can be changed to use a different executable for Ada Language Server. + +g:ale_ada_adals_project *g:ale_ada_adals_project* + *b:ale_ada_adals_project* + Type: |String| + Default: `'default.gpr'` + +This variable can be changed to use a different GPR file for +Ada Language Server. + + +g:ale_ada_adals_encoding *g:ale_ada_adals_encoding* + *b:ale_ada_adals_encoding* + Type: |String| + Default: `'utf-8'` + +This variable can be changed to use a different file encoding for +Ada Language Server. + + =============================================================================== vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: -- cgit v1.2.3 From b454e4314301ad5bdf159f849dc6f30bb377d8f2 Mon Sep 17 00:00:00 2001 From: Bartek Jasicki <thindil@laeran.pl> Date: Tue, 5 Nov 2019 18:00:16 +0100 Subject: Update test/command_callback/test_adals_command_callbacks.vader Co-Authored-By: timlag1305 <timlag1305@gmail.com> --- test/command_callback/test_adals_command_callbacks.vader | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/command_callback/test_adals_command_callbacks.vader b/test/command_callback/test_adals_command_callbacks.vader index 0b1f6006..5a04594e 100644 --- a/test/command_callback/test_adals_command_callbacks.vader +++ b/test/command_callback/test_adals_command_callbacks.vader @@ -7,3 +7,11 @@ After: Execute(Sets adals executable): let g:ale_ada_adals_executable = '/path/to /Ada' AssertLinter '/path/to /Ada', ale#Escape('/path/to /Ada') + +Execute(Sets adals encoding): + let b:ale_ada_adals_encoding = 'iso-8859-1' + AssertLSPConfig {'ada.defaultCharset': 'iso-8859-1', 'ada.projectFile': 'default.gpr'} + +Execute(Sets adals project): + let g:ale_ada_adals_project = 'myproject.gpr' + AssertLSPConfig {'ada.defaultCharset': 'utf-8', 'ada.projectFile': 'myproject.gpr'} -- cgit v1.2.3 From b8d69cb0d57fc25fdb8cd821bda99a34487016da Mon Sep 17 00:00:00 2001 From: Bartek thindil Jasicki <thindil@laeran.pl> Date: Tue, 5 Nov 2019 18:59:13 +0100 Subject: fixed typo --- ale_linters/ada/adals.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ale_linters/ada/adals.vim b/ale_linters/ada/adals.vim index a710a639..9a41e1df 100644 --- a/ale_linters/ada/adals.vim +++ b/ale_linters/ada/adals.vim @@ -2,7 +2,7 @@ " Description: Support for Ada Language Server call ale#Set('ada_adals_executable', 'ada_language_server') -call ale#Set('ada_adals_project, 'default.gpr') +call ale#Set('ada_adals_project', 'default.gpr') call ale#Set('ada_adals_encoding', 'utf-8') function! ale_linters#ada#adals#GetAdaLSConfig(buffer) abort -- cgit v1.2.3