diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-08-28 22:53:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-28 22:53:11 +0100 |
commit | d4ce201cc298cc9b0556111fef39f6ffa7b3fd59 (patch) | |
tree | 3127e11b029091436f7ff3403212acb63fd98238 /autoload | |
parent | 09e43ab16bc8fe7d5ddc72e904b05682587fd335 (diff) | |
parent | 261c29c3d09607a7a4fb38a62603950e71b7635c (diff) | |
download | ale-d4ce201cc298cc9b0556111fef39f6ffa7b3fd59.zip |
Merge pull request #1849 from hsanson/1848-add-support-for-java-lsp
Add vscode-java-language-server linter
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/java.vim | 20 |
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 |