summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-09-28 09:02:00 +0100
committerGitHub <noreply@github.com>2018-09-28 09:02:00 +0100
commita26b3319a1f37c82be8098b6eae4e6f2985a31eb (patch)
tree309edf6f0218f5728b3ef28c7a0ed100fe8ca45f /autoload
parentfd0467f9927d0bf5ee88b157c1978c3b69509460 (diff)
parent8891b7c349328120e5ec3f8022399f884a67e088 (diff)
downloadale-a26b3319a1f37c82be8098b6eae4e6f2985a31eb.zip
Merge pull request #1950 from yejingchen/ccls
Add ccls support for C/C++/ObjC
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/ccls.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/autoload/ale/handlers/ccls.vim b/autoload/ale/handlers/ccls.vim
new file mode 100644
index 00000000..29dd6aed
--- /dev/null
+++ b/autoload/ale/handlers/ccls.vim
@@ -0,0 +1,17 @@
+scriptencoding utf-8
+" Author: Ye Jingchen <ye.jingchen@gmail.com>
+" Description: Utilities for ccls
+
+function! ale#handlers#ccls#GetProjectRoot(buffer) abort
+ let l:project_root = ale#path#FindNearestFile(a:buffer, '.ccls-root')
+
+ if empty(l:project_root)
+ let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
+ endif
+
+ if empty(l:project_root)
+ let l:project_root = ale#path#FindNearestFile(a:buffer, '.ccls')
+ endif
+
+ return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
+endfunction