summaryrefslogtreecommitdiff
path: root/ale_linters/c/cquery.vim
diff options
context:
space:
mode:
authorkodemeister <kodemeister@outlook.com>2018-08-07 01:33:25 +0600
committerkodemeister <kodemeister@outlook.com>2018-08-07 01:39:04 +0600
commit212e3b0b2f36937eac126a7718d6997963b12c68 (patch)
tree65b23d7e35d1ba682fcc6776aee049b10b231ab6 /ale_linters/c/cquery.vim
parent5f5540c574deead932a7785468899d1d0a8540ce (diff)
downloadale-212e3b0b2f36937eac126a7718d6997963b12c68.zip
Use .cquery file to detect the project root
Diffstat (limited to 'ale_linters/c/cquery.vim')
-rw-r--r--ale_linters/c/cquery.vim3
1 files changed, 3 insertions, 0 deletions
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