Set CMAKE_EXPORT_COMPILE_COMMANDS to TRUE in init_project.
CMAKE_EXPORT_COMPILE_COMMANDS
TRUE
init_project
This fixes #1 (closed) .