18 lines
563 B
VimL
18 lines
563 B
VimL
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
|