lsp ccls 代码候选框 导致 ccls异常退出,error code 116

  • 问题描述 在编写代码时,应当要跳出代码候选框时,导致ccls退出,退出code多数为116. 函数跳转,变量跳转等功能正常。

LSP :: ccls has exited (exited abnormally with code 116)

  • 环境 win10 msys2 llvm10.0.0 emacs26.3 doom-emacs
  • 更多描述
  1. 之前在mingw-w64 llvm9.0.1上编译的ccls,使用正常。周末更新了llvm(10.0.0)和doom-emacs后原来编译的ccls不能正常启动,mingw-w64重新编译ccls,可以正常启动,但发现了上述问题。
  2. 为了确认是否是doom-emacs更新导致,我切回doom-emacs之前使用正常的版本。问题依然存在。
  3. 尝试拉取llvm-project分支master,然后用visual studio编译后(v11.0.0),再编译ccls,问题同样存在。

我的配置

emacs 28.0.50 上也有同样的问题。

开启了lsp-log-io,也没有提示任何有用的错误信息。不知道在什么情况下会和company有冲突,导致ccls退出。有大神可以给个调试排查的方向,和方法吗?

ccls什么版本?最近clang更新到10了,ccls也需要更新一下

  • ccls: c5acf62
  • 编译环境:msys2 mingw64 上 llvm10
  • 之前在llvm9上编译使用正常,升级llvm10,重新编译ccls后,就出现了这个问题。 函数跳转,变量跳转等功能都正常。就是补全跳出时,ccls就退出了。
  • define include 等宏书写时,补全功能正常,ccls也不会退出。

能给个复现的最小代码以及配置吗?

c5acf620ccls 当前的 HEAD,我也在这个 commit 下重新 rebuild 了一下。直接修改 lsp-clients-clangd-executableccls,使用的是lsp-mode-20200427.1612。用最小的helloworld没法复现这个问题

试试看,这段代码。

同样没复现。大概率是 GitHub - emacs-lsp/emacs-ccls: Emacs client for ccls, a C/C++ language server 的问题。

尝试一下直接用lsp-mode自带的lsp-clangd作为客户端试一下。

(setq lsp-clients-clangd-executable "/path/to/ccls")
  • ignore emacs-ccls,试了lsp-clangd,同样的问题。
  • 我的编译过程
# cmake -H. -BRelease -G Ninja -DCMAKE_CXX_FLAGS=-D__STDC_FORMAT_MACROS
-- The CXX compiler identification is GNU 9.3.0
-- Check for working CXX compiler: C:/msys/mingw64/bin/c++.exe
-- Check for working CXX compiler: C:/msys/mingw64/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Setting build type to 'Release' as none was specified.
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- RapidJSON found. Headers: /mingw64/include
fatal: No names found, cannot describe anything.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/dev/ccls/Release
# ninja -C Release
ninja: Entering directory `Release'
ninja: error: '/mingw64/lib/libz3.dll.a', needed by 'ccls.exe', missing and no known rule to make it

其中error的路径,我改为了绝对路径,才编译成功。不知道和这个有没有关系。

ccls -v=2 -log-file=/tmp/ccls.log

看下log

20:37:09                  pipeline.cc:552 V(2) receive RequestMessage: 45 initialize
20:37:09                initialize.cc:274 I initialize in directory D:/dev/test with uri file:///d%3A/dev/test
20:37:09                initialize.cc:297 I initializationOptions: {"compilationDatabaseCommand":"","compilationDatabaseDirectory":"","cache":{"directory":".ccls-cache","format":"binary","hierarchicalPath":false,"retainInMemory":2},"capabilities":{"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"}","moreTriggerCharacter":[]},"foldingRangeProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"clang":{"excludeArgs":["-falign-jumps=1","-falign-loops=1","-fconserve-stack","-fmerge-constants","-fno-code-hoisting","-fno-schedule-insns","-fno-var-tracking-assignments","-fsched-pressure","-mhard-float","-mindirect-branch-register","-mindirect-branch=thunk-inline","-mpreferred-stack-boundary=2","-mpreferred-stack-boundary=3","-mpreferred-stack-boundary=4","-mrecord-mcount","-mindirect-branch=thunk-extern","-mno-fp-ret-in-387","-mskip-rax-setup","--param=allow-store-data-races=0","-Wa arch/x86/kernel/macros.s","-Wa -"],"extraArgs":["--gcc-toolchain=/usr"],"pathMappings":[],"resourceDir":""},"client":{"diagnosticsRelatedInformation":true,"hierarchicalDocumentSymbolSupport":true,"linkSupport":true,"snippetSupport":true},"codeLens":{"localVariables":true},"completion":{"caseSensitivity":2,"detailedLabel":true,"dropOldRequests":true,"duplicateOptional":true,"filterAndSort":true,"include":{"blacklist":["^/usr/(local/)?include/c\\+\\+/[0-9\\.]+/(bits|tr1|tr2|profile|ext|debug)/","^/usr/(local/)?include/c\\+\\+/v1/"],"maxPathSize":30,"suffixWhitelist":[".h",".hpp",".hh",".inc"],"whitelist":[]},"maxNum":100,"placeholder":true},"diagnostics":{"blacklist":[],"onChange":1000,"onOpen":0,"onSave":0,"spellChecking":true,"whitelist":[]},"highlight":{"largeFileSize":2097152,"lsRanges":false,"blacklist":[],"whitelist":[]},"index":{"blacklist":[],"comments":2,"initialNoLinkage":false,"initialBlacklist":[],"initialWhitelist":[],"maxInitializerLines":5,"multiVersion":0,"multiVersionBlacklist":[],"multiVersionWhitelist":[],"name":{"suppressUnwrittenScope":false},"onChange":false,"parametersInDeclarations":false,"threads":0,"trackDependency":1,"whitelist":[]},"request":{"timeout":5000},"session":{"maxNum":10},"workspaceSymbol":{"caseSensitivity":1,"maxNum":1000,"sort":true},"xref":{"maxNum":2000}}
20:37:09                initialize.cc:329 I use -resource-dir=C:\msys\mingw64\lib\clang\10.0.0
20:37:09                  pipeline.cc:817 V(2) respond to RequestMessage: 45
20:37:09                initialize.cc:362 I workspace folder: D:/dev/test/
20:37:09                initialize.cc:387 I start 8 indexers
20:37:09                initialize.cc:395 I dispatch initial index requests
20:37:09                  pipeline.cc:474 I loaded project. Refresh semantic highlight for all working file.
20:37:09                  pipeline.cc:554 V(2) receive NotificationMessage initialized
20:37:09                  pipeline.cc:554 V(2) receive NotificationMessage textDocument/didOpen
20:37:09              sema_manager.cc:736 I create session for D:/dev/test/main.c
  clang D:/dev/test/main.c --gcc-toolchain=/usr -working-directory=D:/dev/test/
20:37:09                  pipeline.cc:290 I load cache for D:/dev/test/main.c
20:37:09                  pipeline.cc:788 V(2) NotificationMessage: $ccls/publishSkippedRanges
20:37:09                  pipeline.cc:788 V(2) NotificationMessage: $ccls/publishSemanticHighlight
20:37:09                  pipeline.cc:552 V(2) receive RequestMessage: 46 textDocument/codeLens
20:37:09                  pipeline.cc:817 V(2) respond to RequestMessage: 46
20:37:09                  pipeline.cc:788 V(2) NotificationMessage: textDocument/publishDiagnostics
20:37:10                  pipeline.cc:552 V(2) receive RequestMessage: 47 textDocument/codeLens
20:37:10                  pipeline.cc:817 V(2) respond to RequestMessage: 47
20:37:13                  pipeline.cc:554 V(2) receive NotificationMessage textDocument/didChange
20:37:13                  pipeline.cc:552 V(2) receive RequestMessage: 48 textDocument/completion
20:37:13                  pipeline.cc:817 V(2) respond to RequestMessage: 48

如上。

没看出来有啥问题,能不能再加上最后的 stacktrace

  • lsp-log
Command "D:/dev/ccls/Release/ccls --log-file=d:/dev/ccls/Release/ccls.log -v=2" is present on the path.
Command "clangd" is present on the path.
Found the following clients for d:/dev/test/main.c: (server-id ccls, priority 0), (server-id clangd, priority -1)
The following clients were selected based on priority: (server-id ccls, priority 0)
Command "D:/dev/ccls/Release/ccls --log-file=d:/dev/ccls/Release/ccls.log -v=2" is present on the path.
Command "clangd" is present on the path.
Found the following clients for d:/dev/test/main.c: (server-id ccls, priority 0), (server-id clangd, priority -1)
The following clients were selected based on priority: (server-id ccls, priority 0)
  • lsp-log: ccls
    [Trace - 09:21:15     ] Sending request 'initialize - (1)'.
    Params: {
      "processId": null,
      "rootPath": "d:/dev/test",
      "clientInfo": {
        "name": "emacs",
        "version": "GNU Emacs 27.0.91 (build 1, x86_64-w64-mingw32)\n of 2020-04-20"
      },
      "rootUri": "file:///d%3A/dev/test",
      "capabilities": {
        "workspace": {
          "workspaceEdit": {
            "documentChanges": true,
            "resourceOperations": [
              "create",
              "rename",
              "delete"
            ]
          },
          "applyEdit": true,
          "symbol": {
            "symbolKind": {
              "valueSet": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20,
                21,
                22,
                23,
                24,
                25,
                26
              ]
            }
          },
          "executeCommand": {
            "dynamicRegistration": false
          },
          "workspaceFolders": true,
          "configuration": true
        },
        "textDocument": {
          "declaration": {
            "linkSupport": true
          },
          "definition": {
            "linkSupport": true
          },
          "implementation": {
            "linkSupport": true
          },
          "typeDefinition": {
            "linkSupport": true
          },
          "synchronization": {
            "willSave": true,
            "didSave": true,
            "willSaveWaitUntil": true
          },
          "documentSymbol": {
            "symbolKind": {
              "valueSet": [
                1,
                2,
                3,
                4,
                5,
                6,
                7,
                8,
                9,
                10,
                11,
                12,
                13,
                14,
                15,
                16,
                17,
                18,
                19,
                20,
                21,
                22,
                23,
                24,
                25,
                26
              ]
            },
            "hierarchicalDocumentSymbolSupport": true
          },
          "formatting": {
            "dynamicRegistration": true
          },
          "rangeFormatting": {
            "dynamicRegistration": true
          },
          "rename": {
            "dynamicRegistration": true,
            "prepareSupport": true
          },
          "semanticHighlightingCapabilities": {
            "semanticHighlighting": false
          },
          "codeAction": {
            "dynamicRegistration": true,
            "isPreferredSupport": true,
            "codeActionLiteralSupport": {
              "codeActionKind": {
                "valueSet": [
                  "",
                  "quickfix",
                  "refactor",
                  "refactor.extract",
                  "refactor.inline",
                  "refactor.rewrite",
                  "source",
                  "source.organizeImports"
                ]
              }
            }
          },
          "completion": {
            "completionItem": {
              "snippetSupport": true,
              "documentationFormat": [
                "markdown"
              ]
            },
            "contextSupport": true
          },
          "signatureHelp": {
            "signatureInformation": {
              "parameterInformation": {
                "labelOffsetSupport": true
              }
            }
          },
          "documentLink": {
            "dynamicRegistration": true,
            "tooltipSupport": true
          },
          "hover": {
            "contentFormat": [
              "markdown",
              "plaintext"
            ]
          },
          "foldingRange": null,
          "callHierarchy": {
            "dynamicRegistration": false
          },
          "publishDiagnostics": {
            "relatedInformation": true,
            "tagSupport": {
              "valueSet": [
                1,
                2
              ]
            },
            "versionSupport": true
          }
        },
        "window": {
          "workDoneProgress": true
        }
      },
      "initializationOptions": {
        "clang": {
          "excludeArgs": [
            "-falign-jumps=1",
            "-falign-loops=1",
            "-fconserve-stack",
            "-fmerge-constants",
            "-fno-code-hoisting",
            "-fno-schedule-insns",
            "-fno-var-tracking-assignments",
            "-fsched-pressure",
            "-mhard-float",
            "-mindirect-branch-register",
            "-mindirect-branch=thunk-inline",
            "-mpreferred-stack-boundary=2",
            "-mpreferred-stack-boundary=3",
            "-mpreferred-stack-boundary=4",
            "-mrecord-mcount",
            "-mindirect-branch=thunk-extern",
            "-mno-fp-ret-in-387",
            "-mskip-rax-setup",
            "--param=allow-store-data-races=0",
            "-Wa arch/x86/kernel/macros.s",
            "-Wa -"
          ],
          "extraArgs": [
            "--gcc-toolchain=/usr"
          ],
          "pathMappings": []
        },
        "completion": {
          "include": {
            "blacklist": [
              "^/usr/(local/)?include/c\\+\\+/[0-9\\.]+/(bits|tr1|tr2|profile|ext|debug)/",
              "^/usr/(local/)?include/c\\+\\+/v1/"
            ]
          }
        },
        "index": {
          "initialBlacklist": [],
          "parametersInDeclarations": false,
          "trackDependency": 1
        }
      },
      "workDoneToken": "1"
    }


    [Trace - 09:21:15     ] Received response 'initialize - (1)' in 129ms.
    Result: {
      "serverInfo": {
        "version": "<unknown>",
        "name": "ccls"
      },
      "capabilities": {
        "workspace": {
          "workspaceFolders": {
            "changeNotifications": true,
            "supported": true
          }
        },
        "executeCommandProvider": {
          "commands": [
            "ccls.xref"
          ]
        },
        "foldingRangeProvider": true,
        "documentLinkProvider": {
          "resolveProvider": true
        },
        "renameProvider": true,
        "documentOnTypeFormattingProvider": {
          "moreTriggerCharacter": [],
          "firstTriggerCharacter": "}"
        },
        "documentRangeFormattingProvider": true,
        "documentFormattingProvider": true,
        "codeLensProvider": {
          "resolveProvider": null
        },
        "codeActionProvider": {
          "codeActionKinds": [
            "quickfix"
          ]
        },
        "workspaceSymbolProvider": true,
        "documentSymbolProvider": true,
        "documentHighlightProvider": true,
        "referencesProvider": true,
        "typeDefinitionProvider": true,
        "implementationProvider": true,
        "definitionProvider": true,
        "declarationProvider": true,
        "signatureHelpProvider": {
          "triggerCharacters": [
            "(",
            ","
          ]
        },
        "completionProvider": {
          "triggerCharacters": [
            ".",
            ":",
            ">",
            "#",
            "<",
            "\"",
            "/"
          ],
          "resolveProvider": null
        },
        "hoverProvider": true,
        "textDocumentSync": {
          "save": {
            "includeText": null
          },
          "willSaveWaitUntil": null,
          "willSave": null,
          "change": 2,
          "openClose": true
        }
      }
    }


    [Trace - 09:21:15     ] Sending notification 'initialized'.
    Params: {
    }


    [Trace - 09:21:15     ] Sending notification 'textDocument/didOpen'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c",
        "languageId": "c",
        "version": 0,
        "text": "\n/* enum { a } c; */\nenum {\n  a\n} c;\n\nint main(void) {}\n"
      }
    }


    [Trace - 09:21:15     ] Sending request 'textDocument/codeLens - (2)'.
    Params: {
      "textDocument": {
        "uri": "file:///d:/dev/test/main.c"
      }
    }


    [Trace - 09:21:15     ] Received notification '$ccls/publishSkippedRanges'.
    Params: {
      "skippedRanges": [],
      "uri": "file:///D%3A/dev/test/main.c"
    }


    [Trace - 09:21:15     ] Received notification '$ccls/publishSemanticHighlight'.
    Params: {
      "symbols": [
        {
          "lsRanges": [],
          "ranges": [
            {
              "R": 31,
              "L": 30
            }
          ],
          "storage": 0,
          "kind": 22,
          "parentKind": 1,
          "id": 1
        },
        {
          "lsRanges": [],
          "ranges": [
            {
              "R": 35,
              "L": 34
            }
          ],
          "storage": 0,
          "kind": 13,
          "parentKind": 1,
          "id": 0
        },
        {
          "lsRanges": [],
          "ranges": [
            {
              "R": 46,
              "L": 42
            }
          ],
          "storage": 0,
          "kind": 12,
          "parentKind": 1,
          "id": 0
        },
        {
          "lsRanges": [],
          "ranges": [
            {
              "R": 25,
              "L": 21
            }
          ],
          "storage": 0,
          "kind": 10,
          "parentKind": 1,
          "id": 0
        }
      ],
      "uri": "file:///D%3A/dev/test/main.c"
    }


    [Trace - 09:21:15     ] Received response 'textDocument/codeLens - (2)' in 12ms.
    Result: [
      {
        "command": {
          "arguments": [
            "{\"usr\":7924728095432766067,\"kind\":3,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 8,
            "line": 6
          },
          "start": {
            "character": 4,
            "line": 6
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":10707872682701726438,\"kind\":2,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 4,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":10707872682701726438,\"kind\":2,\"field\":\"instances\"}"
          ],
          "command": "ccls.xref",
          "title": "1 var"
        },
        "range": {
          "end": {
            "character": 4,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":1181535984751995892,\"kind\":4,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 3,
            "line": 4
          },
          "start": {
            "character": 2,
            "line": 4
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":4067220408588889318,\"kind\":4,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 3,
            "line": 3
          },
          "start": {
            "character": 2,
            "line": 3
          }
        }
      }
    ]


    [Trace - 09:21:15     ] Received notification 'textDocument/publishDiagnostics'.
    Params: {
      "diagnostics": [],
      "uri": "file:///D%3A/dev/test/main.c"
    }


    [Trace - 09:21:16     ] Sending request 'textDocument/codeLens - (3)'.
    Params: {
      "textDocument": {
        "uri": "file:///d:/dev/test/main.c"
      }
    }


    [Trace - 09:21:16     ] Received response 'textDocument/codeLens - (3)' in 1ms.
    Result: [
      {
        "command": {
          "arguments": [
            "{\"usr\":7924728095432766067,\"kind\":3,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 8,
            "line": 6
          },
          "start": {
            "character": 4,
            "line": 6
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":10707872682701726438,\"kind\":2,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 4,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":10707872682701726438,\"kind\":2,\"field\":\"instances\"}"
          ],
          "command": "ccls.xref",
          "title": "1 var"
        },
        "range": {
          "end": {
            "character": 4,
            "line": 2
          },
          "start": {
            "character": 0,
            "line": 2
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":1181535984751995892,\"kind\":4,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 3,
            "line": 4
          },
          "start": {
            "character": 2,
            "line": 4
          }
        }
      },
      {
        "command": {
          "arguments": [
            "{\"usr\":4067220408588889318,\"kind\":4,\"field\":\"uses\"}"
          ],
          "command": "ccls.xref",
          "title": "0 ref"
        },
        "range": {
          "end": {
            "character": 3,
            "line": 3
          },
          "start": {
            "character": 2,
            "line": 3
          }
        }
      }
    ]


    [Trace - 09:21:17     ] Sending request 'textDocument/documentHighlight - (4)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 0
      }
    }


    [Trace - 09:21:17     ] Received response 'textDocument/documentHighlight - (4)' in 0ms.
    Result: []


    [Trace - 09:21:17     ] Sending request 'textDocument/hover - (5)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 0
      }
    }


    [Trace - 09:21:17     ] Received response 'textDocument/hover - (5)' in 1ms.
    Result: {
      "contents": []
    }


    [Trace - 09:21:17     ] Sending request 'textDocument/documentHighlight - (6)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 1
      }
    }


    [Trace - 09:21:17     ] Received response 'textDocument/documentHighlight - (6)' in 1ms.
    Result: []


    [Trace - 09:21:18     ] Sending request 'textDocument/hover - (7)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 1
      }
    }


    [Trace - 09:21:18     ] Received response 'textDocument/hover - (7)' in 3ms.
    Result: {
      "contents": []
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (8)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 8
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (9)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 9
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (10)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 10
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (11)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 11
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (12)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 12
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (13)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 13
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (14)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 14
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (15)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 15
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (16)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 16
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (17)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 17
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (18)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 18
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (19)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 19
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (20)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 20
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (21)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 21
    }


    [Trace - 09:21:19     ] Sending request 'textDocument/documentHighlight - (22)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Received response 'nil - (8)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (9)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (10)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (11)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (12)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (13)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (14)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (15)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (16)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (17)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (18)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (19)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (20)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'nil - (21)' in 0ms.
    Result: []


    [Trace - 09:21:19     ] Received response 'textDocument/documentHighlight - (22)' in 4ms.
    Result: []


    [Trace - 09:21:19     ] Sending request 'textDocument/hover - (23)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:19     ] Received response 'textDocument/hover - (23)' in 3ms.
    Result: {
      "contents": []
    }


    [Trace - 09:21:22     ] Sending request 'textDocument/documentHighlight - (24)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 16
      }
    }


    [Trace - 09:21:22     ] Received response 'textDocument/documentHighlight - (24)' in 0ms.
    Result: []


    [Trace - 09:21:23     ] Sending notification 'textDocument/didChange'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c",
        "version": 1
      },
      "contentChanges": [
        {
          "range": {
            "start": {
              "line": 6,
              "character": 16
            },
            "end": {
              "line": 6,
              "character": 16
            }
          },
          "rangeLength": 0,
          "text": "l"
        }
      ]
    }


    [Trace - 09:21:23     ] Sending request 'textDocument/documentHighlight - (25)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 17
      }
    }


    [Trace - 09:21:23     ] Sending notification '$/cancelRequest'.
    Params: {
      "id": 25
    }


    [Trace - 09:21:23     ] Sending request 'textDocument/documentHighlight - (26)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 17
      }
    }


    [Trace - 09:21:23     ] Received response 'nil - (25)' in 0ms.
    Result: []


    [Trace - 09:21:23     ] Received response 'textDocument/documentHighlight - (26)' in 23ms.
    Result: []


    [Trace - 09:21:24     ] Sending notification 'textDocument/didChange'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c",
        "version": 2
      },
      "contentChanges": [
        {
          "range": {
            "start": {
              "line": 6,
              "character": 17
            },
            "end": {
              "line": 6,
              "character": 17
            }
          },
          "rangeLength": 0,
          "text": "a"
        }
      ]
    }


    [Trace - 09:21:24     ] Sending request 'textDocument/completion - (27)'.
    Params: {
      "textDocument": {
        "uri": "file:///d%3A/dev/test/main.c"
      },
      "position": {
        "line": 6,
        "character": 18
      },
      "context": {
        "triggerKind": 1
      }
    }


    [Trace - 09:21:24     ] Received response 'textDocument/completion - (27)' in 6ms.
    Result: {
      "items": [
        {
          "textEdit": {
            "newText": "volatile",
            "range": {
              "end": {
                "character": 18,
                "line": 6
              },
              "start": {
                "character": 16,
                "line": 6
              }
            }
          },
          "insertTextFormat": 1,
          "sortText": "   !",
          "detail": "",
          "kind": 14,
          "label": "volatile"
        },
        {
          "textEdit": {
            "newText": "float",
            "range": {
              "end": {
                "character": 18,
                "line": 6
              },
              "start": {
                "character": 16,
                "line": 6
              }
            }
          },
          "insertTextFormat": 1,
          "sortText": "   \"",
          "detail": "",
          "kind": 14,
          "label": "float"
        }
      ],
      "isIncomplete": null
    }

大佬这个解决方案是什么啊? 我的也不断退出…

更新到最新的 ccls 还是有问题吗?

不行, Windows 10 msys64 llvm-10. 我也没能力debug, 退回clangd了

MaskRay的回复 因为这个问题,我已经用cland了,稳定。就没有再去验证ccls。

总感觉是自己编译的问题,不知大佬有没有win 10编译好的 ccls可以下载? 我的也老是退出. 实在不行我只能去用gvim 的youcompleteme了 :rofl: