coc-settings中设置自定义头文件路径

  • 具体方案例如

      {
      "suggest.noselect": true,
      "languageserver": {
          "ccls": {
              "command": "ccls",
              "filetypes": ["cc", "c", "cpp", "cuda"],
              "rootPatterns": [".tasks", ".git/", "build/"],
              "initializationOptions": {
                  "compilationDatabaseDirectory": "build",
                  "client": {
                      "snippetSupport": true
                  },
                  "cache": {
                      "directory": "/tmp/ccls"
                  },
                  "highlight": {
                      "lsRanges": true
                  },
                  "clang": {
                    "extraArgs": [
                      "-I",
                      "/opt/ros/noetic/include/"
                    ]
                  }
              }
          }
      }
    }
    

添加“clang”部分,就可以实现ros下代码补全功能

posted @ 2023-04-15 18:48  绍荣  阅读(72)  评论(0编辑  收藏  举报