Setup VSCode
While working with native code, i.e. C, C++ and RustLang, VS Code is the best IDE, but how to setup intelisense.
We can generate Compbd file from AOSP and include it in our project to proper intellisense.
Steps:
Pre: Generate desired AOSP image beforehand.
Now generate Compdb
file using these commands.
Compdb (compile_commands.json) Generator
Soong can generate compdb files. This is intended for use with editing tools such as YouCompleteMe and other libclang based completers.
compdb file generation is enabled via environment variable:
One can make soong generate a symlink to the compdb file using an environment variable:
You can then trigger an empty build:
Note that if you build using mm or other limited makes with these environment variables set the compdb will only include files in included modules.
Or simply run
Then open the C/C++ Configuration (ui)
, go to advanced and set the compile_commands.json
path to
Rescan intellisense
Reset the intellisense database, restart VSCode, and enjoy near-instant intellisense for any C/C++ source file in all of AOSP.
Last updated