Skip to content

Instantly share code, notes, and snippets.

@xim
Last active July 11, 2025 13:15
Show Gist options
  • Save xim/ca4951715d15591a5a5f11937c0a219e to your computer and use it in GitHub Desktop.
Save xim/ca4951715d15591a5a5f11937c0a219e to your computer and use it in GitHub Desktop.
repro-clangd-stop
[
{
"command": "c++ -o test test.cpp",
"directory": "/home/xim/p/repro-clangd-stop",
"file": "test.cpp"
}
]
[START][2025-07-11 15:13:55] LSP logging initiated
[INFO][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:658 "Starting RPC client" { cmd = { "clangd" }, extra = {} }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 1, jsonrpc = "2.0", method = "initialize", params = { capabilities = { general = { positionEncodings = { "utf-8", "utf-16", "utf-32" } }, textDocument = { callHierarchy = { dynamicRegistration = false }, codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = true, isPreferredSupport = true, resolveSupport = { properties = { "edit", "command" } } }, codeLens = { dynamicRegistration = false, resolveSupport = { properties = { "command" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, resolveSupport = { properties = { "additionalTextEdits", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionItemKind = { 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 } }, completionList = { itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false }, declaration = { linkSupport = true }, definition = { dynamicRegistration = true, linkSupport = true }, diagnostic = { dynamicRegistration = false }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, 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 } } }, foldingRange = { dynamicRegistration = false, foldingRange = { collapsedText = true }, lineFoldingOnly = true }, formatting = { dynamicRegistration = true }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = true }, implementation = { linkSupport = true }, inlayHint = { dynamicRegistration = true, resolveSupport = { properties = { "textEdits", "tooltip", "location", "command" } } }, publishDiagnostics = { dataSupport = true, relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, rangeFormatting = { dynamicRegistration = true, rangesSupport = true }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = true, prepareSupport = true }, semanticTokens = { augmentsSyntaxTokens = true, dynamicRegistration = false, formats = { "relative" }, multilineTokenSupport = false, overlappingTokenSupport = true, requests = { full = { delta = true }, range = false }, serverCancelSupport = false, tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = true, willSaveWaitUntil = true }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = true }, showMessage = { messageActionItem = { additionalPropertiesSupport = true } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, didChangeConfiguration = { dynamicRegistration = false }, didChangeWatchedFiles = { dynamicRegistration = false, relativePatternSupport = true }, inlayHint = { refreshSupport = true }, semanticTokens = { refreshSupport = true }, symbol = { dynamicRegistration = false, 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 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, clientInfo = { name = "Neovim", version = "0.11.2+v0.11.2" }, processId = 218140, rootPath = "/home/xim/p/repro-clangd-stop/.git", rootUri = "file:///home/xim/p/repro-clangd-stop/.git", trace = "off", workDoneToken = "1", workspaceFolders = { { name = "/home/xim/p/repro-clangd-stop/.git", uri = "file:///home/xim/p/repro-clangd-stop/.git" } } } }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.562] Ubuntu clangd version 19.1.1 (1ubuntu1~24.04.2)\nI[15:13:55.562] Features: linux+grpc\nI[15:13:55.562] PID: 218142\nI[15:13:55.562] Working directory: /home/xim/p/repro-clangd-stop\nI[15:13:55.562] argv[0]: /usr/bin/clangd-19\nI[15:13:55.562] Starting LSP over stdin/stdout\nI[15:13:55.562] <-- initialize(1)\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.564] --> reply:initialize(1) 1 ms\n"
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 1, jsonrpc = "2.0", result = { capabilities = { astProvider = true, callHierarchyProvider = true, clangdInlayHintsProvider = true, codeActionProvider = { codeActionKinds = { "quickfix", "refactor", "info" } }, compilationDatabase = { automaticReload = true }, completionProvider = { resolveProvider = false, triggerCharacters = { ".", "<", ">", ":", '"', "/", "*" } }, declarationProvider = true, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentLinkProvider = { resolveProvider = false }, documentOnTypeFormattingProvider = { firstTriggerCharacter = "\n", moreTriggerCharacter = {} }, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = { "clangd.applyFix", "clangd.applyRename", "clangd.applyTweak" } }, foldingRangeProvider = true, hoverProvider = true, implementationProvider = true, inactiveRegionsProvider = true, inlayHintProvider = true, memoryUsageProvider = true, referencesProvider = true, renameProvider = { prepareProvider = true }, selectionRangeProvider = true, semanticTokensProvider = { full = { delta = true }, legend = { tokenModifiers = { "declaration", "definition", "deprecated", "deduced", "readonly", "static", "abstract", "virtual", "dependentName", "defaultLibrary", "usedAsMutableReference", "usedAsMutablePointer", "constructorOrDestructor", "userDefined", "functionScope", "classScope", "fileScope", "globalScope" }, tokenTypes = { "variable", "variable", "parameter", "function", "method", "function", "property", "variable", "class", "interface", "enum", "enumMember", "type", "type", "unknown", "namespace", "typeParameter", "concept", "type", "macro", "modifier", "operator", "bracket", "label", "comment" } }, range = false }, signatureHelpProvider = { triggerCharacters = { "(", ")", "{", "}", "<", ">", "," } }, standardTypeHierarchyProvider = true, textDocumentSync = { change = 2, openClose = true, save = true }, typeDefinitionProvider = true, typeHierarchyProvider = true, workspaceSymbolProvider = true }, serverInfo = { name = "clangd", version = "Ubuntu clangd version 19.1.1 (1ubuntu1~24.04.2) linux+grpc x86_64-pc-linux-gnu" } } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "initialized", params = vim.empty_dict() }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didOpen", params = { textDocument = { languageId = "cpp", text = "int main(int, char *[]) {\n int i = 1;\n return i;\n}\n", uri = "file:///home/xim/p/repro-clangd-stop/test.cpp", version = 0 } } }
[INFO][2025-07-11 15:13:55] ...m/lsp/client.lua:578 "LSP[bugged-ls]" "server_capabilities" { server_capabilities = { astProvider = true, callHierarchyProvider = true, clangdInlayHintsProvider = true, codeActionProvider = { codeActionKinds = { "quickfix", "refactor", "info" } }, compilationDatabase = { automaticReload = true }, completionProvider = { resolveProvider = false, triggerCharacters = { ".", "<", ">", ":", '"', "/", "*" } }, declarationProvider = true, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentLinkProvider = { resolveProvider = false }, documentOnTypeFormattingProvider = { firstTriggerCharacter = "\n", moreTriggerCharacter = {} }, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = { "clangd.applyFix", "clangd.applyRename", "clangd.applyTweak" } }, foldingRangeProvider = true, hoverProvider = true, implementationProvider = true, inactiveRegionsProvider = true, inlayHintProvider = true, memoryUsageProvider = true, referencesProvider = true, renameProvider = { prepareProvider = true }, selectionRangeProvider = true, semanticTokensProvider = { full = { delta = true }, legend = { tokenModifiers = { "declaration", "definition", "deprecated", "deduced", "readonly", "static", "abstract", "virtual", "dependentName", "defaultLibrary", "usedAsMutableReference", "usedAsMutablePointer", "constructorOrDestructor", "userDefined", "functionScope", "classScope", "fileScope", "globalScope" }, tokenTypes = { "variable", "variable", "parameter", "function", "method", "function", "property", "variable", "class", "interface", "enum", "enumMember", "type", "type", "unknown", "namespace", "typeParameter", "concept", "type", "macro", "modifier", "operator", "bracket", "label", "comment" } }, range = false }, signatureHelpProvider = { triggerCharacters = { "(", ")", "{", "}", "<", ">", "," } }, standardTypeHierarchyProvider = true, textDocumentSync = { change = 2, openClose = true, save = true }, typeDefinitionProvider = true, typeHierarchyProvider = true, workspaceSymbolProvider = true } }
[DEBUG][2025-07-11 15:13:55] ...m/lsp/client.lua:673 "LSP[bugged-ls]" "client.request" 1 "textDocument/semanticTokens/full" { textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } <function 1> 1
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 2, jsonrpc = "2.0", method = "textDocument/semanticTokens/full", params = { textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.566] <-- initialized\nI[15:13:55.566] <-- textDocument/didOpen\nI[15:13:55.567] <-- textDocument/semanticTokens/full(2)\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.567] Loaded compilation database from /home/xim/p/repro-clangd-stop/compile_commands.json\nI[15:13:55.567] ASTWorker building file /home/xim/p/repro-clangd-stop/test.cpp version 0 with command \n[/home/xim/p/repro-clangd-stop]\n/usr/bin/c++ --driver-mode=g++ -o test -resource-dir=/usr/lib/llvm-19/lib/clang/19 -- /home/xim/p/repro-clangd-stop/test.cpp\nI[15:13:55.567] --> window/workDoneProgress/create(0)\nI[15:13:55.567] Enqueueing 1 commands for indexing\nI[15:13:55.569] Indexed test.cpp (1 symbols, 1 refs, 1 files)\n"
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 0, jsonrpc = "2.0", method = "window/workDoneProgress/create", params = { token = "backgroundIndexProgress" } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:407 "server_request: callback result" { result = vim.NIL, status = true }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 0, jsonrpc = "2.0", result = vim.NIL }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.570] <-- reply(0)\nI[15:13:55.570] --> $/progress\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.570] --> $/progress\nI[15:13:55.570] --> $/progress\n"
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = "backgroundIndexProgress", value = { kind = "begin", percentage = 0, title = "indexing" } } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = "backgroundIndexProgress", value = { kind = "report", message = "1/2", percentage = 50 } } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "$/progress", params = { token = "backgroundIndexProgress", value = { kind = "end" } } }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.573] Built preamble of size 238580 for file /home/xim/p/repro-clangd-stop/test.cpp version 0 in 0.00 seconds\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.573] --> workspace/semanticTokens/refresh(1)\n"
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 1, jsonrpc = "2.0", method = "workspace/semanticTokens/refresh" }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "$/cancelRequest", params = { id = 2 } }
[DEBUG][2025-07-11 15:13:55] ...m/lsp/client.lua:673 "LSP[bugged-ls]" "client.request" 1 "textDocument/semanticTokens/full" { textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } <function 1> 1
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 3, jsonrpc = "2.0", method = "textDocument/semanticTokens/full", params = { textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:407 "server_request: callback result" { result = vim.NIL, status = true }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 1, jsonrpc = "2.0", result = vim.NIL }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.573] <-- $/cancelRequest\nI[15:13:55.573] <-- textDocument/semanticTokens/full(3)\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.573] <-- reply(1)\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.573] Indexing c++17 standard library in the context of /home/xim/p/repro-clangd-stop/test.cpp\n"
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.579] --> textDocument/publishDiagnostics\n"
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { jsonrpc = "2.0", method = "textDocument/publishDiagnostics", params = { diagnostics = {}, uri = "file:///home/xim/p/repro-clangd-stop/test.cpp", version = 0 } }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { error = { code = -32800, message = "Request cancelled" }, id = 2, jsonrpc = "2.0" }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:454 "Received cancellation ack" { error = { code = -32800, message = "Request cancelled" }, id = 2, jsonrpc = "2.0" }
[DEBUG][2025-07-11 15:13:55] .../vim/lsp/rpc.lua:391 "rpc.receive" { id = 3, jsonrpc = "2.0", result = { data = { 0, 4, 4, 3, 131075, 1, 8, 1, 1, 16387, 1, 11, 1, 1, 16384 }, resultId = "1" } }
[ERROR][2025-07-11 15:13:55] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:55.579] --> reply:textDocument/semanticTokens/full(2) 12 ms, error: Task was cancelled.\nI[15:13:55.579] --> reply:textDocument/semanticTokens/full(3) 5 ms\n"
[ERROR][2025-07-11 15:13:56] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:13:56.186] Indexed c++17 standard library (incomplete due to errors): 14136 symbols, 1812 filtered\n"
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 13, line = 1 }, start = { character = 12, line = 1 } }, rangeLength = 1, text = "" }, { range = { ["end"] = { character = 12, line = 1 }, start = { character = 11, line = 1 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp", version = 5 } } }
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.152] <-- textDocument/didChange\n"
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.203] ASTWorker building file /home/xim/p/repro-clangd-stop/test.cpp version 5 with command \n[/home/xim/p/repro-clangd-stop]\n/usr/bin/c++ --driver-mode=g++ -o test -resource-dir=/usr/lib/llvm-19/lib/clang/19 -- /home/xim/p/repro-clangd-stop/test.cpp\n"
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 11, line = 1 }, start = { character = 10, line = 1 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp", version = 6 } } }
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.302] <-- textDocument/didChange\n"
[DEBUG][2025-07-11 15:14:00] ...m/lsp/client.lua:673 "LSP[bugged-ls]" "client.request" 1 "textDocument/semanticTokens/full/delta" { previousResultId = "1", textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } <function 1> 1
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 4, jsonrpc = "2.0", method = "textDocument/semanticTokens/full/delta", params = { previousResultId = "1", textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } }
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.374] <-- textDocument/semanticTokens/full/delta(4)\n"
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didChange", params = { contentChanges = { { range = { ["end"] = { character = 10, line = 1 }, start = { character = 9, line = 1 } }, rangeLength = 1, text = "" } }, textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp", version = 7 } } }
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.452] <-- textDocument/didChange\n"
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "$/cancelRequest", params = { id = 4 } }
[DEBUG][2025-07-11 15:14:00] ...m/lsp/client.lua:673 "LSP[bugged-ls]" "client.request" 1 "textDocument/semanticTokens/full/delta" { previousResultId = "1", textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } <function 1> 1
[DEBUG][2025-07-11 15:14:00] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 5, jsonrpc = "2.0", method = "textDocument/semanticTokens/full/delta", params = { previousResultId = "1", textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } }
[ERROR][2025-07-11 15:14:00] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:00.546] <-- $/cancelRequest\nI[15:14:00.546] <-- textDocument/semanticTokens/full/delta(5)\n"
[DEBUG][2025-07-11 15:14:02] .../vim/lsp/rpc.lua:277 "rpc.send" { jsonrpc = "2.0", method = "textDocument/didSave", params = { textDocument = { uri = "file:///home/xim/p/repro-clangd-stop/test.cpp" } } }
[ERROR][2025-07-11 15:14:02] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:02.291] <-- textDocument/didSave\n"
[ERROR][2025-07-11 15:14:02] ...p/_transport.lua:36 "rpc" "clangd" "stderr" "I[15:14:02.291] File version went from 7 to 7\n"
[INFO][2025-07-11 15:14:04] .../lua/vim/lsp.lua:1192 "exit_handler" { { _is_stopping = false, _log_prefix = "LSP[bugged-ls]", _on_attach_cbs = {}, _on_exit_cbs = { <function 1> }, _on_init_cbs = {}, _trace = "off", attached_buffers = { true }, cancel_request = <function 2>, capabilities = { general = { positionEncodings = { "utf-8", "utf-16", "utf-32" } }, textDocument = { callHierarchy = { dynamicRegistration = false }, codeAction = { codeActionLiteralSupport = { codeActionKind = { valueSet = { "", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" } } }, dataSupport = true, dynamicRegistration = true, isPreferredSupport = true, resolveSupport = { properties = { "edit", "command" } } }, codeLens = { dynamicRegistration = false, resolveSupport = { properties = { "command" } } }, completion = { completionItem = { commitCharactersSupport = false, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, preselectSupport = false, resolveSupport = { properties = { "additionalTextEdits", "command" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } }, completionItemKind = { 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 } }, completionList = { itemDefaults = { "editRange", "insertTextFormat", "insertTextMode", "data" } }, contextSupport = true, dynamicRegistration = false }, declaration = { linkSupport = true }, definition = { dynamicRegistration = true, linkSupport = true }, diagnostic = { dynamicRegistration = false }, documentHighlight = { dynamicRegistration = false }, documentSymbol = { dynamicRegistration = false, hierarchicalDocumentSymbolSupport = true, 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 } } }, foldingRange = { dynamicRegistration = false, foldingRange = { collapsedText = true }, lineFoldingOnly = true }, formatting = { dynamicRegistration = true }, hover = { contentFormat = { "markdown", "plaintext" }, dynamicRegistration = true }, implementation = { linkSupport = true }, inlayHint = { dynamicRegistration = true, resolveSupport = { properties = { "textEdits", "tooltip", "location", "command" } } }, publishDiagnostics = { dataSupport = true, relatedInformation = true, tagSupport = { valueSet = { 1, 2 } } }, rangeFormatting = { dynamicRegistration = true, rangesSupport = true }, references = { dynamicRegistration = false }, rename = { dynamicRegistration = true, prepareSupport = true }, semanticTokens = { augmentsSyntaxTokens = true, dynamicRegistration = false, formats = { "relative" }, multilineTokenSupport = false, overlappingTokenSupport = true, requests = { full = { delta = true }, range = false }, serverCancelSupport = false, tokenModifiers = { "declaration", "definition", "readonly", "static", "deprecated", "abstract", "async", "modification", "documentation", "defaultLibrary" }, tokenTypes = { "namespace", "type", "class", "enum", "interface", "struct", "typeParameter", "parameter", "variable", "property", "enumMember", "event", "function", "method", "macro", "keyword", "modifier", "comment", "string", "number", "regexp", "operator", "decorator" } }, signatureHelp = { dynamicRegistration = false, signatureInformation = { activeParameterSupport = true, documentationFormat = { "markdown", "plaintext" }, parameterInformation = { labelOffsetSupport = true } } }, synchronization = { didSave = true, dynamicRegistration = false, willSave = true, willSaveWaitUntil = true }, typeDefinition = { linkSupport = true } }, window = { showDocument = { support = true }, showMessage = { messageActionItem = { additionalPropertiesSupport = true } }, workDoneProgress = true }, workspace = { applyEdit = true, configuration = true, didChangeConfiguration = { dynamicRegistration = false }, didChangeWatchedFiles = { dynamicRegistration = false, relativePatternSupport = true }, inlayHint = { refreshSupport = true }, semanticTokens = { refreshSupport = true }, symbol = { dynamicRegistration = false, 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 } } }, workspaceEdit = { resourceOperations = { "rename", "create", "delete" } }, workspaceFolders = true } }, commands = {}, config = { cmd = { "clangd" }, name = "bugged-ls", root_dir = "/home/xim/p/repro-clangd-stop/.git", settings = <1>vim.empty_dict() }, dynamic_capabilities = { capabilities = <2>{}, client_id = 1, get = <function 3>, register = <function 4>, supports = <function 5>, supports_registration = <function 6>, unregister = <function 7> }, flags = {}, get_language_id = <function 8>, handlers = {}, id = 1, initialized = true, is_stopped = <function 9>, messages = { messages = {}, name = "bugged-ls", progress = {}, status = {} }, name = "bugged-ls", notify = <function 10>, offset_encoding = "utf-16", on_attach = <function 11>, progress = { _idx_read = 0, _idx_write = 4, _items = { { token = "backgroundIndexProgress", value = { kind = "begin", percentage = 0, title = "indexing" } }, { token = "backgroundIndexProgress", value = { kind = "report", message = "1/2", percentage = 50, title = "indexing" } }, { token = "backgroundIndexProgress", value = { kind = "end", title = "indexing" } }, [0] = { token = "backgroundIndexProgress" } }, _size = 51, pending = {}, <metatable> = { __call = <function 12>, __index = { clear = <function 13>, peek = <function 14>, pop = <function 15>, push = <function 16> } } }, registrations = <table 2>, request = <function 17>, request_sync = <function 18>, requests = { [4] = { bufnr = 1, method = "textDocument/semanticTokens/full/delta", type = "cancel" }, [5] = { bufnr = 1, method = "textDocument/semanticTokens/full/delta", type = "pending" } }, root_dir = "/home/xim/p/repro-clangd-stop/.git", rpc = { is_closing = <function 19>, notify = <function 20>, request = <function 21>, terminate = <function 22> }, server_capabilities = { astProvider = true, callHierarchyProvider = true, clangdInlayHintsProvider = true, codeActionProvider = { codeActionKinds = { "quickfix", "refactor", "info" } }, compilationDatabase = { automaticReload = true }, completionProvider = { resolveProvider = false, triggerCharacters = { ".", "<", ">", ":", '"', "/", "*" } }, declarationProvider = true, definitionProvider = true, documentFormattingProvider = true, documentHighlightProvider = true, documentLinkProvider = { resolveProvider = false }, documentOnTypeFormattingProvider = { firstTriggerCharacter = "\n", moreTriggerCharacter = {} }, documentRangeFormattingProvider = true, documentSymbolProvider = true, executeCommandProvider = { commands = { "clangd.applyFix", "clangd.applyRename", "clangd.applyTweak" } }, foldingRangeProvider = true, hoverProvider = true, implementationProvider = true, inactiveRegionsProvider = true, inlayHintProvider = true, memoryUsageProvider = true, referencesProvider = true, renameProvider = { prepareProvider = true }, selectionRangeProvider = true, semanticTokensProvider = { full = { delta = true }, legend = { tokenModifiers = { "declaration", "definition", "deprecated", "deduced", "readonly", "static", "abstract", "virtual", "dependentName", "defaultLibrary", "usedAsMutableReference", "usedAsMutablePointer", "constructorOrDestructor", "userDefined", "functionScope", "classScope", "fileScope", "globalScope" }, tokenTypes = { "variable", "variable", "parameter", "function", "method", "function", "property", "variable", "class", "interface", "enum", "enumMember", "type", "type", "unknown", "namespace", "typeParameter", "concept", "type", "macro", "modifier", "operator", "bracket", "label", "comment" } }, range = false }, signatureHelpProvider = { triggerCharacters = { "(", ")", "{", "}", "<", ">", "," } }, standardTypeHierarchyProvider = true, textDocumentSync = { change = 2, openClose = true, save = true }, typeDefinitionProvider = true, typeHierarchyProvider = true, workspaceSymbolProvider = true }, server_info = { name = "clangd", version = "Ubuntu clangd version 19.1.1 (1ubuntu1~24.04.2) linux+grpc x86_64-pc-linux-gnu" }, settings = <table 1>, stop = <function 23>, supports_method = <function 24>, workspace_folders = { { name = "/home/xim/p/repro-clangd-stop/.git", uri = "file:///home/xim/p/repro-clangd-stop/.git" } }, <metatable> = <3>{ __index = <table 3>, _add_workspace_folder = <function 25>, _get_language_id = <function 26>, _get_registration = <function 27>, _get_registration_options = <function 28>, _notification = <function 29>, _on_error = <function 30>, _on_exit = <function 31>, _process_request = <function 32>, _register = <function 33>, _register_dynamic = <function 34>, _remove_workspace_folder = <function 35>, _resolve_handler = <function 36>, _run_callbacks = <function 37>, _server_request = <function 38>, _supports_registration = <function 39>, _text_document_did_open_handler = <function 40>, _unregister = <function 41>, _unregister_dynamic = <function 42>, cancel_request = <function 43>, create = <function 44>, exec_cmd = <function 45>, initialize = <function 46>, is_stopped = <function 47>, notify = <function 48>, on_attach = <function 49>, request = <function 50>, request_sync = <function 51>, stop = <function 52>, supports_method = <function 53>, write_error = <function 54> } } }
[DEBUG][2025-07-11 15:14:04] .../vim/lsp/rpc.lua:277 "rpc.send" { id = 6, jsonrpc = "2.0", method = "shutdown" }
.PHONY: clean all
all: test
test: test.cpp
g++ $^ -Wall -o $@
clean:
rm -f test
vim.lsp.set_log_level("debug")
local pattern = 'cpp'
local cmd = {'clangd'}
local root_markers = {'.git'}
local settings = vim.empty_dict()
vim.api.nvim_create_autocmd('FileType', {
pattern = pattern,
callback = function(args)
local match = vim.fs.find(root_markers, { path = args.file, upward = true })[1]
local root_dir = match and vim.fn.fnamemodify(match, ':p:h') or nil
vim.lsp.start({
name = 'bugged-ls',
cmd = cmd,
root_dir = root_dir,
settings = settings
})
end
})
int main(int, char *[]) {
int i;
return i;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment