summaryrefslogtreecommitdiff
path: root/ale_linters/scala/sbtserver.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/scala/sbtserver.vim')
-rw-r--r--ale_linters/scala/sbtserver.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/ale_linters/scala/sbtserver.vim b/ale_linters/scala/sbtserver.vim
index d75c38ca..694241d7 100644
--- a/ale_linters/scala/sbtserver.vim
+++ b/ale_linters/scala/sbtserver.vim
@@ -6,15 +6,19 @@ call ale#Set('scala_sbtserver_project_root', '')
function! ale_linters#scala#sbtserver#GetProjectRoot(buffer) abort
let l:project_root = ale#Var(a:buffer, 'scala_sbtserver_project_root')
+
if l:project_root is? ''
let l:project_root = ale#path#FindNearestFile(a:buffer, 'build.sbt')
+
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
endif
+
return l:project_root
endfunction
function! ale_linters#scala#sbtserver#GetAddress(buffer) abort
let l:address = ale#Var(a:buffer, 'scala_sbtserver_address')
+
return l:address
endfunction