From e633dc11b2227822d7e365ea4e84304b13da5f6c Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Tue, 18 Jul 2023 12:17:35 +0200 Subject: [PATCH] vim: add cmd to generate compiledb from AOSP logs --- .vim/plugin/cscope_plus.vim | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.vim/plugin/cscope_plus.vim b/.vim/plugin/cscope_plus.vim index d06af90..4db6f97 100644 --- a/.vim/plugin/cscope_plus.vim +++ b/.vim/plugin/cscope_plus.vim @@ -72,6 +72,15 @@ if has("cscope") call GetCscopeDb(path) endfunction command! GenerateCscopeDb :call GenerateCscopeDb() + " Open out/verbose.log.gz then run this cmd. It should produce a compile_commands.json. This is for case when SOONG variable + " Does not work (see + " https://android.googlesource.com/platform/build/soong/+/HEAD/docs/compdb.md) + function! GenerateCompileDbFromAOSP() + let @a="" + %s/\[\d*\/\d*\] \/bin\/bash -c "\(.*\)"/\=setreg('A', submatch(1), 'V')/gn + call system("compiledb ", @a) + endfunction + command! GenerateCompileDbFromAOSP :call GenerateCompileDbFromAOSP() endif " Let autotags find all cscodepeDb " LoadLocalCscopeDb