summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/fortran/language_server.vim6
-rw-r--r--doc/ale-fortran.txt19
-rw-r--r--doc/ale.txt1
-rw-r--r--test/command_callback/test_fortran_fortls_callback.vader18
4 files changed, 43 insertions, 1 deletions
diff --git a/ale_linters/fortran/language_server.vim b/ale_linters/fortran/language_server.vim
index c0dd51bf..fd763fcf 100644
--- a/ale_linters/fortran/language_server.vim
+++ b/ale_linters/fortran/language_server.vim
@@ -8,6 +8,10 @@ function! ale_linters#fortran#language_server#GetExecutable(buffer) abort
return ale#Var(a:buffer, 'fortran_language_server_executable')
endfunction
+function! ale_linters#fortran#language_server#GetCommand(buffer) abort
+ return ale#Escape(ale_linters#fortran#language_server#GetExecutable(a:buffer))
+endfunction
+
function! ale_linters#fortran#language_server#GetProjectRoot(buffer) abort
let l:fortls_file = ale#path#FindNearestFile(a:buffer, '.fortls')
@@ -18,6 +22,6 @@ call ale#linter#Define('fortran', {
\ 'name': 'language_server',
\ 'lsp': 'stdio',
\ 'executable_callback': 'ale_linters#fortran#language_server#GetExecutable',
-\ 'command_callback': 'ale_linters#fortran#language_server#GetExecutable',
+\ 'command_callback': 'ale_linters#fortran#language_server#GetCommand',
\ 'project_root_callback': 'ale_linters#fortran#language_server#GetProjectRoot',
\})
diff --git a/doc/ale-fortran.txt b/doc/ale-fortran.txt
index ed6bc724..c9b7e8e2 100644
--- a/doc/ale-fortran.txt
+++ b/doc/ale-fortran.txt
@@ -33,4 +33,23 @@ g:ale_fortran_gcc_use_free_form *g:ale_fortran_gcc_use_free_form*
===============================================================================
+language_server *ale-fortran-language-server*
+
+g:ale_fortran_language_server_executable *g:ale_fortran_language_server_executable*
+ *b:ale_fortran_language_server_executable*
+ Type: |String|
+ Default: `'fortls'`
+
+ This variable can be changed to modify the executable used for the Fortran
+ Language Server.
+
+g:ale_fortran_language_server_use_global *g:ale_fortran_language_server_use_global*
+ *b:ale_fortran_language_server_use_global*
+ Type: |Number|
+ Default: `get(g:, 'ale_use_global_executables', 0)`
+
+ See |ale-integrations-local-executables|
+
+
+===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
diff --git a/doc/ale.txt b/doc/ale.txt
index 2862057b..068ee16d 100644
--- a/doc/ale.txt
+++ b/doc/ale.txt
@@ -76,6 +76,7 @@ CONTENTS *ale-contents*
fish..................................|ale-fish-options|
fortran...............................|ale-fortran-options|
gcc.................................|ale-fortran-gcc|
+ language_server.....................|ale-fortran-language-server|
fountain..............................|ale-fountain-options|
fusionscript..........................|ale-fuse-options|
fusion-lint.........................|ale-fuse-fusionlint|
diff --git a/test/command_callback/test_fortran_fortls_callback.vader b/test/command_callback/test_fortran_fortls_callback.vader
new file mode 100644
index 00000000..3be7ff4f
--- /dev/null
+++ b/test/command_callback/test_fortran_fortls_callback.vader
@@ -0,0 +1,18 @@
+Before:
+ call ale#assert#SetUpLinterTest('fortran', 'language_server')
+
+After:
+ call ale#assert#TearDownLinterTest()
+
+Execute(The default executable path should be correct):
+ AssertLinter 'fortls', ale#Escape('fortls')
+
+Execute(The project root should be detected correctly):
+ AssertLSPProject ''
+
+ call ale#test#SetFilename('fortran-fortls-project/test.F90')
+
+ AssertLSPProject ale#path#Simplify(g:dir . '/fortran-fortls-project')
+
+Execute(The language should be correct):
+ AssertLSPLanguage 'fortran'