Install C/C++ IntelliSense and CMake Tools plug-in for C++ project.
Open file – preference – settings – IntelliSenseEngine, set the intelliSense engine as Tag Parser.
Edit .vscode\c_cpp_properties.json
for the workspaceFolder to include all files that we need.
Restart VS Code to see the effect.
You have to make sure the CMake setting is correct before the above actions.