From 212e3b0b2f36937eac126a7718d6997963b12c68 Mon Sep 17 00:00:00 2001 From: kodemeister Date: Tue, 7 Aug 2018 01:33:25 +0600 Subject: Use .cquery file to detect the project root --- ale_linters/c/cquery.vim | 3 +++ ale_linters/cpp/cquery.vim | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ale_linters/c/cquery.vim b/ale_linters/c/cquery.vim index 7daf9f76..225fda57 100644 --- a/ale_linters/c/cquery.vim +++ b/ale_linters/c/cquery.vim @@ -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 diff --git a/ale_linters/cpp/cquery.vim b/ale_linters/cpp/cquery.vim index 39eebce3..7318da40 100644 --- a/ale_linters/cpp/cquery.vim +++ b/ale_linters/cpp/cquery.vim @@ -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 -- cgit v1.2.3