mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-16 23:14:27 +08:00
Move ccls functions to autoload/ale/handler
Tests are kept as-is.
This commit is contained in:
17
autoload/ale/handlers/ccls.vim
Normal file
17
autoload/ale/handlers/ccls.vim
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user