vscode配置

1. c_cpp_properties.json文件

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/opt/ros/melodic/include"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json",
            "configurationProvider": "ms-vscode.cmake-tools"
        }
    ],
    "version": 4
}

2. 编译指令,该指令会在.../build/目录下生成compile_commands.json文件
catkin_make  -DCMAKE_EXPORT_COMPILE_COMMANDS=1

原文地址:https://www.cnblogs.com/cj2014/p/14548847.html