Hello all! I recently wrote a script that is able to generate a compile_commands.json file from frc projects.
What is a compilation database/compile_commands.json?
Many C++ IDEs and editor plugins use clang (as in the compiler) tools to generate autocomplete based on user projects. These tools often take in a compile_commands.json file which is essentially a list of source files in the project and the command to compile these source files. My script takes in the output of gradleRIO builds and generates a compile_commands.json.What does this mean?
This means that you can use any IDE or editor that has support/a plugin for c++ autocomplete using clangd.For example:
- CLion - you have to open the compile_commands.json as a project
- Vim - using you-complete-me
- VsCode - you can get better autocompletion in vsocde compared to the frc plugin by using the clangd plugin
- Any other editor that supports clang completion - see this