diff options
author | Ye Jingchen <ye.jingchen@gmail.com> | 2018-09-28 03:26:57 +0800 |
---|---|---|
committer | Ye Jingchen <ye.jingchen@gmail.com> | 2018-09-28 03:26:57 +0800 |
commit | 8891b7c349328120e5ec3f8022399f884a67e088 (patch) | |
tree | bf8e5144032fc0465fbb8db0ccf10ed78e395bd0 /autoload | |
parent | 17676f6a6d5ba2ab47c717f7c47b04d8fc23299b (diff) | |
download | ale-8891b7c349328120e5ec3f8022399f884a67e088.zip |
Move ccls functions to autoload/ale/handler
Tests are kept as-is.
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/handlers/ccls.vim | 17 |
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 |