summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
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