summaryrefslogtreecommitdiff
path: root/ale_linters/c
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2018-08-10 18:23:55 +0100
committerGitHub <noreply@github.com>2018-08-10 18:23:55 +0100
commita56e801567907c683987858dc9a7a913c2d0cec4 (patch)
tree20788a884162a77516b9d17f382eeea6a289405c /ale_linters/c
parente9086dd55c84d95147e6132a319e694440637f9c (diff)
parent0702e4699e3af612737a0a7a9e6c61726f1c9237 (diff)
downloadale-a56e801567907c683987858dc9a7a913c2d0cec4.zip
Merge pull request #1793 from kodemeister/cquery
Use .cquery file to detect the project root
Diffstat (limited to 'ale_linters/c')
-rw-r--r--ale_linters/c/cquery.vim5
1 files changed, 5 insertions, 0 deletions
diff --git a/ale_linters/c/cquery.vim b/ale_linters/c/cquery.vim
index 7daf9f76..a20782a2 100644
--- a/ale_linters/c/cquery.vim
+++ b/ale_linters/c/cquery.vim
@@ -6,6 +6,11 @@ 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