mirror of
1
0
Fork 0
ultimate-vim/sources_non_forked/ale/autoload/ale/handlers/ccls.vim

20 lines
563 B
VimL
Raw Normal View History

2018-09-30 16:58:57 -04:00
scriptencoding utf-8
" Author: Ye Jingchen <ye.jingchen@gmail.com>
" Description: Utilities for ccls
function! ale#handlers#ccls#GetProjectRoot(buffer) abort
2019-08-22 11:36:17 -04:00
" Try to find ccls configuration files first.
let l:config = ale#path#FindNearestFile(a:buffer, '.ccls-root')
2018-09-30 16:58:57 -04:00
2019-08-22 11:36:17 -04:00
if empty(l:config)
let l:config = ale#path#FindNearestFile(a:buffer, '.ccls')
2018-09-30 16:58:57 -04:00
endif
2019-08-22 11:36:17 -04:00
if !empty(l:config)
return fnamemodify(l:config, ':h')
2018-09-30 16:58:57 -04:00
endif
2019-08-22 11:36:17 -04:00
" Fall back on default project root detection.
return ale#c#FindProjectRoot(a:buffer)
2018-09-30 16:58:57 -04:00
endfunction