mirror of https://github.com/dense-analysis/ale
Use .cquery file to detect the project root
This commit is contained in:
parent
5f5540c574
commit
212e3b0b2f
|
@ -6,6 +6,9 @@ call ale#Set('c_cquery_cache_directory', expand('~/.cache/cquery'))
|
|||
|
||||
function! ale_linters#c#cquery#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
||||
if empty(l:project_root)
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, '.cquery')
|
||||
endif
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endfunction
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@ call ale#Set('cpp_cquery_cache_directory', expand('~/.cache/cquery'))
|
|||
|
||||
function! ale_linters#cpp#cquery#GetProjectRoot(buffer) abort
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, 'compile_commands.json')
|
||||
|
||||
if empty(l:project_root)
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, '.cquery')
|
||||
endif
|
||||
return !empty(l:project_root) ? fnamemodify(l:project_root, ':h') : ''
|
||||
endfunction
|
||||
|
||||
|
|
Loading…
Reference in New Issue