vim coc ccls

coc setting

C:\Users\xxx\vimfiles\coc-settings.json

指定 compile_commands.json 在工程的根目录下的build目录

"compilationDatabaseDirectory":"build",
{
  "languageserver": {
    "ccls": {
      "command": "ccls",
      "filetypes": ["c", "cpp","hpp","h", "cuda", "objc", "objcpp"],
      "rootPatterns": [".ccls",".git/"],
      "initializationOptions": {
        "compilationDatabaseDirectory":"build",
        "cache": {
          "directory": ".ccls-cache"
        },
        "client": {
          "snippetSupport": true
        }
      }
    }
  }
}

ccls setting

在工程的根目录创建文件
.ccls

内容

%compile_commands.json

%h -x
%h c++-header

%hpp
posted @ 2023-03-09 14:45  fndefbwefsowpvqfx  阅读(86)  评论(0编辑  收藏  举报