summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2020-04-18 13:15:32 +0200
committerTomas Janousek <tomi@nomi.cz>2020-04-18 13:57:57 +0200
commit4fbfcc9dec06feae5643df3b7b153b2329f7c1da (patch)
tree8c6dbeb09304002f6ffa791031624e99d05c219d /autoload
parent82f734a7c286d8705c9a6e2879b4173fe18a6356 (diff)
downloadale-4fbfcc9dec06feae5643df3b7b153b2329f7c1da.zip
ccls: Detect build dir and set compilationDatabaseDirectory
Fixes #2621
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/ccls.vim7
1 files changed, 7 insertions, 0 deletions
diff --git a/autoload/ale/handlers/ccls.vim b/autoload/ale/handlers/ccls.vim
index 1e2aa318..290f5852 100644
--- a/autoload/ale/handlers/ccls.vim
+++ b/autoload/ale/handlers/ccls.vim
@@ -17,3 +17,10 @@ function! ale#handlers#ccls#GetProjectRoot(buffer) abort
" Fall back on default project root detection.
return ale#c#FindProjectRoot(a:buffer)
endfunction
+
+function! ale#handlers#ccls#GetInitOpts(buffer, init_options_var) abort
+ let l:build_dir = ale#c#GetBuildDirectory(a:buffer)
+ let l:init_options = empty(l:build_dir) ? {} : {'compilationDatabaseDirectory': l:build_dir}
+
+ return extend(l:init_options, ale#Var(a:buffer, a:init_options_var))
+endfunction