summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorHoracio Sanson <horacio@allm.net>2018-08-24 16:20:44 +0900
committerHoracio Sanson <horacio@allm.net>2018-08-24 16:28:15 +0900
commit3afff5a24c088988cd93529e62185f0dcc80da45 (patch)
tree15cdc1b3100e7b5faf7e3873f85e3ff6809b0fe3 /autoload
parent707b539969df55d9372135d8b15771693699d5ac (diff)
downloadale-3afff5a24c088988cd93529e62185f0dcc80da45.zip
Add vscode-java-language-server linter
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/java.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/autoload/ale/java.vim b/autoload/ale/java.vim
new file mode 100644
index 00000000..b7fd10bd
--- /dev/null
+++ b/autoload/ale/java.vim
@@ -0,0 +1,20 @@
+" Author: Horacio Sanson https://github.com/hsanson
+" Description: Functions for integrating with Java tools
+
+" Find the nearest dir contining a gradle or pom file and asume it
+" the root of a java app.
+function! ale#java#FindProjectRoot(buffer) abort
+ let l:gradle_root = ale#gradle#FindProjectRoot(a:buffer)
+
+ if !empty(l:gradle_root)
+ return l:gradle_root
+ endif
+
+ let l:maven_pom_file = ale#path#FindNearestFile(a:buffer, 'pom.xml')
+
+ if !empty(l:maven_pom_file)
+ return fnamemodify(l:maven_pom_file, ':h')
+ endif
+
+ return ''
+endfunction