clangd
clangd copied to clipboard
Jumping to definition in Windows jumps to header file
I am using clangd 14.0 on Windows with VS Code and vim-lsp. If I have the following files, if I use F12 (VS Code) or LspDefinition (vim-lsp) on func2 in src1.c before opening src2.c, it jumps to src2.h. After opening src2.c, the same operation will jump to src2.c.
If I do the same thing with clangd 14.0 on Ubuntu 22.04, it jumps to src2.c even before opening src2.c.
src1.c
#include "src1.h"
#include "src2.h"
void func1(void) { func2(); }
src1.h
extern void func(void);
src2.c
#include "src2.h"
void func2(void) { }
src2.h
extern void func2(void);
compile_commands.json
[
{
"directory": "c:/src",
"arguments": [ "gcc", "src1.c", "-c", "-o", "src1.o"],
"file": "src1.c"
},
{
"directory": "c:/src",
"arguments": [ "gcc", "src2.c", "-c", "-o", "src2.o"],
"file": "src2.c"
}
]
Logs
2022/05/05 10:14:30:["s:on_text_document_did_close()",1]
2022/05/05 10:14:31:["lsp#register_server","server registered","clangd"]
2022/05/05 10:14:31:["s:on_text_document_did_open()",2,"c","C:/vim/vim82","file:///C:/src/src1.c"]
2022/05/05 10:14:31:["Starting server","clangd",["C:\\Program Files\\LLVM\\bin\\clangd.exe","--log=verbose","--background-index"]]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":1,"server_name":"clangd"},"message":"started lsp server successfully"}}]
2022/05/05 10:14:31:["--->",1,"clangd",{"method":"initialize","params":{"rootUri":"file:///C:/vim/vim82","initializationOptions":null,"capabilities":{"workspace":{"workspaceFolders":false,"configuration":true,"applyEdit":true},"window":{"workDoneProgress":false},"textDocument":{"semanticHighlightingCapabilities":{"semanticHighlighting":false},"codeAction":{"isPreferredSupport":true,"disabledSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"completion":{"completionItem":{"snippetSupport":false,"resolveSupport":{"properties":["additionalTextEdits"]},"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false,"completionItemKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]}},"formatting":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"rangeFormatting":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false,"linkSupport":true},"references":{"dynamicRegistration":false},"typeHierarchy":false,"foldingRange":{"rangeLimit":5000,"dynamicRegistration":false,"lineFoldingOnly":true},"documentSymbol":{"symbolKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]},"dynamicRegistration":false,"labelSupport":false,"hierarchicalDocumentSymbolSupport":false},"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":false,"willSaveWaitUntil":false,"willSave":false,"didSave":true},"documentHighlight":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"definition":{"dynamicRegistration":false,"linkSupport":true}}},"rootPath":"C:\\vim\\vim82","clientInfo":{"name":"vim-lsp"},"processId":52776,"trace":"off"}}]
2022/05/05 10:14:31:["s:on_text_document_did_open()",2,"c","C:/vim/vim82","file:///C:/src/src1.c"]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"server already started"}}]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"waiting for lsp server to initialize"}}]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","I[10:14:31.409] clangd version 14.0.0\r\nI[10:14:31.411] Features: windows\r\nI[10:14:31.411] PID: 51804\r\nI[10:14:31.411] Working directory: C:\\vim\\vim82\r\nI[10:14:31.411] argv[0]: C:\\Program Files\\LLVM\\bin\\clangd.exe\r\nI[10:14:31.411] argv[1]: --log=verbose\r\nI[10:14:31.411] argv[2]: --background-index\r\n"]
2022/05/05 10:14:31:["<---",1,"clangd",{"response":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"documentHighlightProvider":true,"astProvider":true,"typeDefinitionProvider":true,"workspaceSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"compilationDatabase":{"automaticReload":true},"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"textDocumentSync":{"save":true,"change":2,"openClose":true},"implementationProvider":true,"memoryUsageProvider":true,"documentLinkProvider":{"resolveProvider":false},"declarationProvider":true,"documentOnTypeFormattingProvider":{"moreTriggerCharacter":[],"firstTriggerCharacter":"\n"},"clangdInlayHintsProvider":true,"definitionProvider":true,"documentRangeFormattingProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"],"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"]},"range":false},"typeHierarchyProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"renameProvider":true,"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]}},"serverInfo":{"version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc","name":"clangd"}}},"request":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"rootUri":"file:///C:/vim/vim82","initializationOptions":null,"capabilities":{"workspace":{"workspaceFolders":false,"configuration":true,"applyEdit":true},"window":{"workDoneProgress":false},"textDocument":{"semanticHighlightingCapabilities":{"semanticHighlighting":false},"codeAction":{"isPreferredSupport":true,"disabledSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"completion":{"completionItem":{"snippetSupport":false,"resolveSupport":{"properties":["additionalTextEdits"]},"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false,"completionItemKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]}},"formatting":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"rangeFormatting":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false,"linkSupport":true},"references":{"dynamicRegistration":false},"typeHierarchy":false,"foldingRange":{"rangeLimit":5000,"dynamicRegistration":false,"lineFoldingOnly":true},"documentSymbol":{"symbolKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]},"dynamicRegistration":false,"labelSupport":false,"hierarchicalDocumentSymbolSupport":false},"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":false,"willSaveWaitUntil":false,"willSave":false,"didSave":true},"documentHighlight":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"definition":{"dynamicRegistration":false,"linkSupport":true}}},"rootPath":"C:\\vim\\vim82","clientInfo":{"name":"vim-lsp"},"processId":52776,"trace":"off"}}}]
2022/05/05 10:14:31:["--->",1,"clangd",{"method":"initialized","params":{}}]
2022/05/05 10:14:31:["--->",1,"clangd",{"method":"workspace/didChangeConfiguration","params":{"settings":{}}}]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:31:["s:update_file_content()",2]
2022/05/05 10:14:31:["--->",1,"clangd",{"method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C:/src/src1.c","version":1,"languageId":"c","text":"#include \"src1.h\"\n#include \"src2.h\"\nvoid func1(void) { func2(); }\n"}}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","filetype":"c","server_name":"clangd"},"message":"textDocument/open sent"}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"already opened"}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","V[10:14:31.433] User config file is C:\\Users\\xxxx\\AppData\\Local\\clangd\\config.yaml\r\nI[10:14:31.433] Starting LSP over stdin/stdout\r\nV[10:14:31.433] <<< {\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"capabilities\":{\"textDocument\":{\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}},\"disabledSupport\":true,\"dynamicRegistration\":false,\"isPreferredSupport\":true},\"codeLens\":{\"dynamicRegistration\":false},\"completion\":{\"completionItem\":{\"documentationFormat\":[\"markdown\",\"plaintext\"],\"resolveSupport\":{\"properties\":[\"additionalTextEdits\"]},\"snippetSupport\":false},\"completionItemKind\":{\"valueSet\":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]},\"dynamicRegistration\":false},\"declaration\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"definition\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"documentHighlight\":{\"dynamicRegistration\":false},\"documentSymbol\":{\"dynamicRegistration\":false,\"hierarchicalDocumentSymbolSupport\":false,\"labelSupport\":false,\"symbolKind\":{\"valueSet\":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]}},\"foldingRange\":{\"dynamicRegistration\":false,\"lineFoldingOnly\":true,\"rangeLimit\":5000},\"formatting\":{\"dynamicRegistration\":false},\"hover\":{\"contentFormat\":[\"markdown\",\"plaintext\"],\"dynamicRegistration\":false},\"implementation\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"publishDiagnostics\":{\"relatedInformation\":true},\"rangeFormatting\":{\"dynamicRegistration\":false},\"references\":{\"dynamicRegistration\":false},\"semanticHighlightingCapabilities\":{\"semanticHighlighting\":false},\"synchronization\":{\"didSave\":true,\"dynamicRegistration\":false,\"willSave\":false,\"willSaveWaitUntil\":false},\"typeDefinition\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"typeHierarchy\":false},\"window\":{\"workDoneProgress\":false},\"workspace\":{\"applyEdit\":true,\"configuration\":true,\"workspaceFolders\":false}},\"clientInfo\":{\"name\":\"vim-lsp\"},\"initializationOptions\":null,\"processId\":52776,\"rootPath\":\"C:\\\\vim\\\\vim82\",\"rootUri\":\"file:///C:/vim/vim82\",\"trace\":\"off\"}}\r\n\r\nI[10:14:31.433] <-- initialize(1)\r\nI[10:14:31.437] --> reply:initialize(1) 3 ms\r\nV[10:14:31.437] >>> {\"id\":1,\"jsonrpc\":\"2.0\",\"result\":{\"capabilities\":{\"astProvider\":true,\"callHierarchyProvider\":true,\"clangdInlayHintsProvider\":true,\"codeActionProvider\":{\"codeActionKinds\":[\"quickfix\",\"refactor\",\"info\"]},\"compilationDatabase\":{\"automaticReload\":true},\"completionProvider\":{\"allCommitCharacters\":[\" \",\"\\t\",\"(\",\")\",\"[\",\"]\",\"{\",\"}\",\"<\",\">\",\":\",\";\",\",\",\"+\",\"-\",\"/\",\"*\",\"%\",\"^\",\"&\",\"#\",\"?\",\".\",\"=\",\"\\\"\",\"'\",\"|\"],\"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.applyTweak\"]},\"hoverProvider\":true,\"implementationProvider\":true,\"memoryUsageProvider\":true,\"referencesProvider\":true,\"renameProvider\":true,\"selectionRangeProvider\":true,\"semanticTokensProvider\":{\"full\":{\"delta\":true},\"legend\":{\"tokenModifiers\":[\"declaration\",\"deprecated\",\"deduced\",\"readonly\",\"static\",\"abstract\",\"virtual\",\"dependentName\",\"defaultLibrary\",\"usedAsMutableReference\",\"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\",\"comment\"]},\"range\":false},\"signatureHelpProvider\":{\"triggerCharacters\":[\"(\",\")\",\"{\",\"}\",\"<\",\">\",\",\"]},\"textDocumentSync\":{\"change\":2,\"openClose\":true,\"save\":true},\"typeDefinitionProvider\":true,\"typeHierarchyProvider\":true,\"workspaceSymbolProvider\":true},\"serverInfo\":{\"name\":\"clangd\",\"version\":\"clangd version 14.0.0 windows x86_64-pc-windows-msvc\"}}}\r\n\r\n"]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","V[10:14:31.459] <<< {\"jsonrpc\":\"2.0\",\"method\":\"initialized\",\"params\":{}}\r\n\r\nI[10:14:31.459] <-- initialized\r\nV[10:14:31.466] <<< {\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":{}}}\r\n\r\nI[10:14:31.466] <-- workspace/didChangeConfiguration\r\nV[10:14:31.505] <<< {\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didOpen\",\"params\":{\"textDocument\":{\"languageId\":\"c\",\"text\":\"#include \\\"src1.h\\\"\\n#include \\\"src2.h\\\"\\nvoid func1(void) { func2(); }\\n\",\"uri\":\"file:///C:/src/src1.c\",\"version\":1}}}\r\n\r\nI[10:14:31.505] <-- textDocument/didOpen\r\nI[10:14:31.508] Loaded compilation database from C:\\src\\compile_commands.json\r\nV[10:14:31.508] Broadcasting compilation database from C:\\src\r\nI[10:14:31.508] ASTWorker building file C:\\src\\src1.c version 1 with command \r\n[c:/src]\r\n\"C:\\\\Program Files\\\\LLVM\\\\bin\\\\gcc\" -c -o src1.o \"-resource-dir=C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\" -- \"C:\\\\src\\\\src1.c\"\r\nI[10:14:31.509] Enqueueing 2 commands for indexing\r\nV[10:14:31.511] BackgroundIndex: building version 1 after loading index from disk\r\nV[10:14:31.511] BackgroundIndex: serving version 1 (23528 bytes)\r\nV[10:14:31.536] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src1.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -fcoverage-compilation-dir=c:/src -resource-dir \"C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\" -internal-isystem \"C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\atlmfc\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\Include\\\\10.0.10240.0\\\\ucrt\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\shared\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\um\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\winrt\" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c \"C:\\\\src\\\\src1.c\"\r\nV[10:14:31.536] Building first preamble for C:\\src\\src1.c version 1\r\nV[10:14:31.568] indexed preamble AST for C:\\src\\src1.c version 1:\r\n symbol slab: 2 symbols, 4688 bytes\r\n ref slab: 0 symbols, 0 refs, 136 bytes\r\n relations slab: 0 relations, 24 bytes\r\nV[10:14:31.568] Build dynamic index for header symbols with estimated memory usage of 12696 bytes\r\nV[10:14:31.570] Built preamble of size 220844 for file C:\\src\\src1.c version 1\r\n"]
2022/05/05 10:14:31:["<---",1,"clangd",{"response":{"method":"textDocument/publishDiagnostics","jsonrpc":"2.0","params":{"diagnostics":[],"uri":"file:///C:/src/src1.c","version":1}}}]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","V[10:14:31.598] indexed file AST for C:\\src\\src1.c version 1:\r\n symbol slab: 1 symbols, 4456 bytes\r\n ref slab: 2 symbols, 2 refs, 4280 bytes\r\n relations slab: 0 relations, 24 bytes\r\nV[10:14:31.598] Build dynamic index for main-file symbols with estimated memory usage of 11592 bytes\r\nI[10:14:31.598] --> textDocument/publishDiagnostics\r\nV[10:14:31.598] >>> {\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[],\"uri\":\"file:///C:/src/src1.c\",\"version\":1}}\r\n\r\n"]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"server already started"}}]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"documentHighlightProvider":true,"astProvider":true,"typeDefinitionProvider":true,"workspaceSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"compilationDatabase":{"automaticReload":true},"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"textDocumentSync":{"save":true,"change":2,"openClose":true},"implementationProvider":true,"memoryUsageProvider":true,"documentLinkProvider":{"resolveProvider":false},"declarationProvider":true,"documentOnTypeFormattingProvider":{"moreTriggerCharacter":[],"firstTriggerCharacter":"\n"},"clangdInlayHintsProvider":true,"definitionProvider":true,"documentRangeFormattingProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"],"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"]},"range":false},"typeHierarchyProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"renameProvider":true,"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]}},"serverInfo":{"version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc","name":"clangd"}}},"server_name":"clangd"},"message":"lsp server already initialized"}}]
2022/05/05 10:14:31:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"already opened"}}]
2022/05/05 10:14:31:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:31:["--->",1,"clangd",{"method":"textDocument/documentHighlight","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///C:/src/src1.c"},"position":{"character":20,"line":2}}}]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","V[10:14:31.722] <<< {\"id\":2,\"jsonrpc\":\"2.0\",\"method\":\"textDocument/documentHighlight\",\"params\":{\"position\":{\"character\":20,\"line\":2},\"textDocument\":{\"uri\":\"file:///C:/src/src1.c\"}}}\r\n\r\nI[10:14:31.722] <-- textDocument/documentHighlight(2)\r\nV[10:14:31.722] ASTWorker running Highlights on version 1 of C:\\src\\src1.c\r\n"]
2022/05/05 10:14:31:["<---",1,"clangd",{"response":{"id":2,"jsonrpc":"2.0","result":[{"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}},"kind":1}]},"request":{"id":2,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/src/src1.c"},"position":{"character":20,"line":2}}}}]
2022/05/05 10:14:31:["<---(stderr)",1,"clangd","I[10:14:31.722] --> reply:textDocument/documentHighlight(2) 0 ms\r\nV[10:14:31.722] >>> {\"id\":2,\"jsonrpc\":\"2.0\",\"result\":[{\"kind\":1,\"range\":{\"end\":{\"character\":24,\"line\":2},\"start\":{\"character\":19,\"line\":2}}}]}\r\n\r\n"]
2022/05/05 10:14:35:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"server already started"}}]
2022/05/05 10:14:35:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"documentHighlightProvider":true,"astProvider":true,"typeDefinitionProvider":true,"workspaceSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"compilationDatabase":{"automaticReload":true},"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"textDocumentSync":{"save":true,"change":2,"openClose":true},"implementationProvider":true,"memoryUsageProvider":true,"documentLinkProvider":{"resolveProvider":false},"declarationProvider":true,"documentOnTypeFormattingProvider":{"moreTriggerCharacter":[],"firstTriggerCharacter":"\n"},"clangdInlayHintsProvider":true,"definitionProvider":true,"documentRangeFormattingProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"],"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"]},"range":false},"typeHierarchyProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"renameProvider":true,"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]}},"serverInfo":{"version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc","name":"clangd"}}},"server_name":"clangd"},"message":"lsp server already initialized"}}]
2022/05/05 10:14:35:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:35:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"already opened"}}]
2022/05/05 10:14:35:[{"response":{"data":{"path":"file:///C:/src/src1.c","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:35:["--->",1,"clangd",{"method":"textDocument/definition","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///C:/src/src1.c"},"position":{"character":20,"line":2}}}]
2022/05/05 10:14:35:["<---",1,"clangd",{"response":{"id":3,"jsonrpc":"2.0","result":[{"uri":"file:///C:/src/src2.h","range":{"end":{"character":17,"line":0},"start":{"character":12,"line":0}}}]},"request":{"id":3,"jsonrpc":"2.0","method":"textDocument/definition","params":{"textDocument":{"uri":"file:///C:/src/src1.c"},"position":{"character":20,"line":2}}}}]
2022/05/05 10:14:35:["s:on_text_document_did_close()",2]
2022/05/05 10:14:35:["lsp#register_server","server already registered","clangd"]
2022/05/05 10:14:35:["lsp#register_server","server registered","clangd"]
2022/05/05 10:14:35:["s:on_text_document_did_open()",23,"cpp","C:/src","file:///C:/src/src2.h"]
2022/05/05 10:14:35:["Starting server","clangd",["C:\\Program Files\\LLVM\\bin\\clangd.exe","--log=verbose","--background-index"]]
2022/05/05 10:14:35:[{"response":{"data":{"__data__":"vim-lsp","lsp_id":2,"server_name":"clangd"},"message":"started lsp server successfully"}}]
2022/05/05 10:14:35:["--->",2,"clangd",{"method":"initialize","params":{"rootUri":"file:///C:/src","initializationOptions":null,"capabilities":{"workspace":{"workspaceFolders":false,"configuration":true,"applyEdit":true},"window":{"workDoneProgress":false},"textDocument":{"semanticHighlightingCapabilities":{"semanticHighlighting":false},"codeAction":{"isPreferredSupport":true,"disabledSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"completion":{"completionItem":{"snippetSupport":false,"resolveSupport":{"properties":["additionalTextEdits"]},"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false,"completionItemKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]}},"formatting":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"rangeFormatting":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false,"linkSupport":true},"references":{"dynamicRegistration":false},"typeHierarchy":false,"foldingRange":{"rangeLimit":5000,"dynamicRegistration":false,"lineFoldingOnly":true},"documentSymbol":{"symbolKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]},"dynamicRegistration":false,"labelSupport":false,"hierarchicalDocumentSymbolSupport":false},"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":false,"willSaveWaitUntil":false,"willSave":false,"didSave":true},"documentHighlight":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"definition":{"dynamicRegistration":false,"linkSupport":true}}},"rootPath":"C:\\src","clientInfo":{"name":"vim-lsp"},"processId":52776,"trace":"off"}}]
2022/05/05 10:14:36:["s:on_text_document_did_open()",23,"cpp","C:/src","file:///C:/src/src2.h"]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"server already started"}}]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"waiting for lsp server to initialize"}}]
2022/05/05 10:14:36:["<---(stderr)",1,"clangd","V[10:14:35.681] <<< {\"id\":3,\"jsonrpc\":\"2.0\",\"method\":\"textDocument/definition\",\"params\":{\"position\":{\"character\":20,\"line\":2},\"textDocument\":{\"uri\":\"file:///C:/src/src1.c\"}}}\r\n\r\nI[10:14:35.681] <-- textDocument/definition(3)\r\nV[10:14:35.681] ASTWorker running Definitions on version 1 of C:\\src\\src1.c\r\nI[10:14:35.682] --> reply:textDocument/definition(3) 0 ms\r\nV[10:14:35.682] >>> {\"id\":3,\"jsonrpc\":\"2.0\",\"result\":[{\"range\":{\"end\":{\"character\":17,\"line\":0},\"start\":{\"character\":12,\"line\":0}},\"uri\":\"file:///C:/src/src2.h\"}]}\r\n\r\n"]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","I[10:14:36.148] clangd version 14.0.0\r\nI[10:14:36.151] Features: windows\r\nI[10:14:36.151] PID: 51712\r\nI[10:14:36.151] Working directory: C:\\src\r\nI[10:14:36.151] argv[0]: C:\\Program Files\\LLVM\\bin\\clangd.exe\r\nI[10:14:36.151] argv[1]: --log=verbose\r\nI[10:14:36.151] argv[2]: --background-index\r\n"]
2022/05/05 10:14:36:["<---",2,"clangd",{"response":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"documentHighlightProvider":true,"astProvider":true,"typeDefinitionProvider":true,"workspaceSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"compilationDatabase":{"automaticReload":true},"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"textDocumentSync":{"save":true,"change":2,"openClose":true},"implementationProvider":true,"memoryUsageProvider":true,"documentLinkProvider":{"resolveProvider":false},"declarationProvider":true,"documentOnTypeFormattingProvider":{"moreTriggerCharacter":[],"firstTriggerCharacter":"\n"},"clangdInlayHintsProvider":true,"definitionProvider":true,"documentRangeFormattingProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"],"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"]},"range":false},"typeHierarchyProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"renameProvider":true,"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]}},"serverInfo":{"version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc","name":"clangd"}}},"request":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"rootUri":"file:///C:/src","initializationOptions":null,"capabilities":{"workspace":{"workspaceFolders":false,"configuration":true,"applyEdit":true},"window":{"workDoneProgress":false},"textDocument":{"semanticHighlightingCapabilities":{"semanticHighlighting":false},"codeAction":{"isPreferredSupport":true,"disabledSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dynamicRegistration":false},"completion":{"completionItem":{"snippetSupport":false,"resolveSupport":{"properties":["additionalTextEdits"]},"documentationFormat":["markdown","plaintext"]},"dynamicRegistration":false,"completionItemKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]}},"formatting":{"dynamicRegistration":false},"codeLens":{"dynamicRegistration":false},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"rangeFormatting":{"dynamicRegistration":false},"declaration":{"dynamicRegistration":false,"linkSupport":true},"references":{"dynamicRegistration":false},"typeHierarchy":false,"foldingRange":{"rangeLimit":5000,"dynamicRegistration":false,"lineFoldingOnly":true},"documentSymbol":{"symbolKind":{"valueSet":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]},"dynamicRegistration":false,"labelSupport":false,"hierarchicalDocumentSymbolSupport":false},"publishDiagnostics":{"relatedInformation":true},"synchronization":{"dynamicRegistration":false,"willSaveWaitUntil":false,"willSave":false,"didSave":true},"documentHighlight":{"dynamicRegistration":false},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"definition":{"dynamicRegistration":false,"linkSupport":true}}},"rootPath":"C:\\src","clientInfo":{"name":"vim-lsp"},"processId":52776,"trace":"off"}}}]
2022/05/05 10:14:36:["--->",2,"clangd",{"method":"initialized","params":{}}]
2022/05/05 10:14:36:["--->",2,"clangd",{"method":"workspace/didChangeConfiguration","params":{"settings":{}}}]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:36:["s:update_file_content()",23]
2022/05/05 10:14:36:["--->",2,"clangd",{"method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///C:/src/src2.h","version":1,"languageId":"cpp","text":"extern void func2(void);\n"}}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","filetype":"cpp","server_name":"clangd"},"message":"textDocument/open sent"}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","server_name":"clangd"},"message":"already opened"}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","V[10:14:36.172] User config file is C:\\Users\\xxxx\\AppData\\Local\\clangd\\config.yaml\r\nI[10:14:36.172] Starting LSP over stdin/stdout\r\nV[10:14:36.172] <<< {\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"initialize\",\"params\":{\"capabilities\":{\"textDocument\":{\"codeAction\":{\"codeActionLiteralSupport\":{\"codeActionKind\":{\"valueSet\":[\"\",\"quickfix\",\"refactor\",\"refactor.extract\",\"refactor.inline\",\"refactor.rewrite\",\"source\",\"source.organizeImports\"]}},\"disabledSupport\":true,\"dynamicRegistration\":false,\"isPreferredSupport\":true},\"codeLens\":{\"dynamicRegistration\":false},\"completion\":{\"completionItem\":{\"documentationFormat\":[\"markdown\",\"plaintext\"],\"resolveSupport\":{\"properties\":[\"additionalTextEdits\"]},\"snippetSupport\":false},\"completionItemKind\":{\"valueSet\":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,1,2,3,4,5,6,7,8,9]},\"dynamicRegistration\":false},\"declaration\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"definition\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"documentHighlight\":{\"dynamicRegistration\":false},\"documentSymbol\":{\"dynamicRegistration\":false,\"hierarchicalDocumentSymbolSupport\":false,\"labelSupport\":false,\"symbolKind\":{\"valueSet\":[10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,1,2,3,4,5,6,7,8,9]}},\"foldingRange\":{\"dynamicRegistration\":false,\"lineFoldingOnly\":true,\"rangeLimit\":5000},\"formatting\":{\"dynamicRegistration\":false},\"hover\":{\"contentFormat\":[\"markdown\",\"plaintext\"],\"dynamicRegistration\":false},\"implementation\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"publishDiagnostics\":{\"relatedInformation\":true},\"rangeFormatting\":{\"dynamicRegistration\":false},\"references\":{\"dynamicRegistration\":false},\"semanticHighlightingCapabilities\":{\"semanticHighlighting\":false},\"synchronization\":{\"didSave\":true,\"dynamicRegistration\":false,\"willSave\":false,\"willSaveWaitUntil\":false},\"typeDefinition\":{\"dynamicRegistration\":false,\"linkSupport\":true},\"typeHierarchy\":false},\"window\":{\"workDoneProgress\":false},\"workspace\":{\"applyEdit\":true,\"configuration\":true,\"workspaceFolders\":false}},\"clientInfo\":{\"name\":\"vim-lsp\"},\"initializationOptions\":null,\"processId\":52776,\"rootPath\":\"C:\\\\src\",\"rootUri\":\"file:///C:/src\",\"trace\":\"off\"}}\r\n\r\nI[10:14:36.172] <-- initialize(1)\r\nI[10:14:36.176] --> reply:initialize(1) 3 ms\r\nV[10:14:36.176] >>> {\"id\":1,\"jsonrpc\":\"2.0\",\"result\":{\"capabilities\":{\"astProvider\":true,\"callHierarchyProvider\":true,\"clangdInlayHintsProvider\":true,\"codeActionProvider\":{\"codeActionKinds\":[\"quickfix\",\"refactor\",\"info\"]},\"compilationDatabase\":{\"automaticReload\":true},\"completionProvider\":{\"allCommitCharacters\":[\" \",\"\\t\",\"(\",\")\",\"[\",\"]\",\"{\",\"}\",\"<\",\">\",\":\",\";\",\",\",\"+\",\"-\",\"/\",\"*\",\"%\",\"^\",\"&\",\"#\",\"?\",\".\",\"=\",\"\\\"\",\"'\",\"|\"],\"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.applyTweak\"]},\"hoverProvider\":true,\"implementationProvider\":true,\"memoryUsageProvider\":true,\"referencesProvider\":true,\"renameProvider\":true,\"selectionRangeProvider\":true,\"semanticTokensProvider\":{\"full\":{\"delta\":true},\"legend\":{\"tokenModifiers\":[\"declaration\",\"deprecated\",\"deduced\",\"readonly\",\"static\",\"abstract\",\"virtual\",\"dependentName\",\"defaultLibrary\",\"usedAsMutableReference\",\"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\",\"comment\"]},\"range\":false},\"signatureHelpProvider\":{\"triggerCharacters\":[\"(\",\")\",\"{\",\"}\",\"<\",\">\",\",\"]},\"textDocumentSync\":{\"change\":2,\"openClose\":true,\"save\":true},\"typeDefinitionProvider\":true,\"typeHierarchyProvider\":true,\"workspaceSymbolProvider\":true},\"serverInfo\":{\"name\":\"clangd\",\"version\":\"clangd version 14.0.0 windows x86_64-pc-windows-msvc\"}}}\r\n\r\n"]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","V[10:14:36.197] <<< {\"jsonrpc\":\"2.0\",\"method\":\"initialized\",\"params\":{}}\r\n\r\nI[10:14:36.197] <-- initialized\r\nV[10:14:36.203] <<< {\"jsonrpc\":\"2.0\",\"method\":\"workspace/didChangeConfiguration\",\"params\":{\"settings\":{}}}\r\n\r\nI[10:14:36.203] <-- workspace/didChangeConfiguration\r\nV[10:14:36.224] <<< {\"jsonrpc\":\"2.0\",\"method\":\"textDocument/didOpen\",\"params\":{\"textDocument\":{\"languageId\":\"cpp\",\"text\":\"extern void func2(void);\\n\",\"uri\":\"file:///C:/src/src2.h\",\"version\":1}}}\r\n\r\nI[10:14:36.225] <-- textDocument/didOpen\r\nI[10:14:36.229] Loaded compilation database from C:\\src\\compile_commands.json\r\nV[10:14:36.229] Broadcasting compilation database from C:\\src\r\nI[10:14:36.229] ASTWorker building file C:\\src\\src2.h version 1 with command inferred from src2.c\r\n[c:/src]\r\n\"C:\\\\Program Files\\\\LLVM\\\\bin\\\\gcc\" -c -x c-header \"-resource-dir=C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\" -- \"C:\\\\src\\\\src2.h\"\r\nI[10:14:36.231] Enqueueing 2 commands for indexing\r\nV[10:14:36.233] BackgroundIndex: building version 1 after loading index from disk\r\nV[10:14:36.233] BackgroundIndex: serving version 1 (23528 bytes)\r\nV[10:14:36.260] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src2.h -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -fcoverage-compilation-dir=c:/src -resource-dir \"C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\" -internal-isystem \"C:\\\\Program Files\\\\LLVM\\\\lib\\\\clang\\\\14.0.0\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Microsoft Visual Studio 14.0\\\\VC\\\\atlmfc\\\\include\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\Include\\\\10.0.10240.0\\\\ucrt\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\shared\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\um\" -internal-isystem \"C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\Include\\\\winrt\" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c-header \"C:\\\\src\\\\src2.h\"\r\nV[10:14:36.260] Building first preamble for C:\\src\\src2.h version 1\r\nV[10:14:36.285] indexed preamble AST for C:\\src\\src2.h version 1:\r\n symbol slab: 0 symbols, 128 bytes\r\n ref slab: 0 symbols, 0 refs, 136 bytes\r\n relations slab: 0 relations, 24 bytes\r\nV[10:14:36.287] Built preamble of size 220320 for file C:\\src\\src2.h version 1\r\n"]
2022/05/05 10:14:36:["<---",2,"clangd",{"response":{"method":"textDocument/publishDiagnostics","jsonrpc":"2.0","params":{"diagnostics":[],"uri":"file:///C:/src/src2.h","version":1}}}]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","V[10:14:36.316] indexed file AST for C:\\src\\src2.h version 1:\r\n symbol slab: 1 symbols, 4456 bytes\r\n ref slab: 1 symbols, 1 refs, 4256 bytes\r\n relations slab: 0 relations, 24 bytes\r\nV[10:14:36.316] Build dynamic index for main-file symbols with estimated memory usage of 11536 bytes\r\nI[10:14:36.316] --> textDocument/publishDiagnostics\r\nV[10:14:36.316] >>> {\"jsonrpc\":\"2.0\",\"method\":\"textDocument/publishDiagnostics\",\"params\":{\"diagnostics\":[],\"uri\":\"file:///C:/src/src2.h\",\"version\":1}}\r\n\r\n"]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"server already started"}}]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","init_result":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyTweak"]},"documentHighlightProvider":true,"astProvider":true,"typeDefinitionProvider":true,"workspaceSymbolProvider":true,"referencesProvider":true,"hoverProvider":true,"selectionRangeProvider":true,"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"compilationDatabase":{"automaticReload":true},"callHierarchyProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"textDocumentSync":{"save":true,"change":2,"openClose":true},"implementationProvider":true,"memoryUsageProvider":true,"documentLinkProvider":{"resolveProvider":false},"declarationProvider":true,"documentOnTypeFormattingProvider":{"moreTriggerCharacter":[],"firstTriggerCharacter":"\n"},"clangdInlayHintsProvider":true,"definitionProvider":true,"documentRangeFormattingProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","comment"],"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","functionScope","classScope","fileScope","globalScope"]},"range":false},"typeHierarchyProvider":true,"documentFormattingProvider":true,"documentSymbolProvider":true,"renameProvider":true,"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]}},"serverInfo":{"version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc","name":"clangd"}}},"server_name":"clangd"},"message":"lsp server already initialized"}}]
2022/05/05 10:14:36:[{"response":{"data":{"__data__":"vim-lsp","server_name":"clangd"},"message":"configuration sent"}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","server_name":"clangd"},"message":"already opened"}}]
2022/05/05 10:14:36:[{"response":{"data":{"path":"file:///C:/src/src2.h","__data__":"vim-lsp","server_name":"clangd"},"message":"not dirty"}}]
2022/05/05 10:14:36:["--->",2,"clangd",{"method":"textDocument/documentHighlight","on_notification":"---funcref---","params":{"textDocument":{"uri":"file:///C:/src/src2.h"},"position":{"character":12,"line":0}}}]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","V[10:14:36.453] <<< {\"id\":2,\"jsonrpc\":\"2.0\",\"method\":\"textDocument/documentHighlight\",\"params\":{\"position\":{\"character\":12,\"line\":0},\"textDocument\":{\"uri\":\"file:///C:/src/src2.h\"}}}\r\n\r\nI[10:14:36.453] <-- textDocument/documentHighlight(2)\r\n"]
2022/05/05 10:14:36:["<---",2,"clangd",{"response":{"id":2,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":12,"line":0}},"kind":1}]},"request":{"id":2,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"textDocument":{"uri":"file:///C:/src/src2.h"},"position":{"character":12,"line":0}}}}]
2022/05/05 10:14:36:["<---(stderr)",2,"clangd","V[10:14:36.453] ASTWorker running Highlights on version 1 of C:\\src\\src2.h\r\nI[10:14:36.453] --> reply:textDocument/documentHighlight(2) 0 ms\r\nV[10:14:36.453] >>> {\"id\":2,\"jsonrpc\":\"2.0\",\"result\":[{\"kind\":1,\"range\":{\"end\":{\"character\":17,\"line\":0},\"start\":{\"character\":12,\"line\":0}}}]}\r\n\r\n"]
System information
clangd version 14.0.0 Features: windows Platform: x86_64-pc-windows-msvc
Ubuntu clangd version 14.0.0-1ubuntu1 Features: linux+grpc Platform: x86_64-pc-linux-gnu
Could you provide logs from vscode please (choose "clangd" in the dropdown in the Output view)? The formatting of these logs makes them very hard to read.
Thanks for the advice. Here is the log when src2.h was opened in Windows by jumping to the func2 definition before opening src2.c.
I[17:40:56.097] clangd version 14.0.0
I[17:40:56.099] Features: windows
I[17:40:56.099] PID: 31872
I[17:40:56.099] Working directory: c:\src
I[17:40:56.099] argv[0]: C:\Program Files\LLVM\bin\clangd.EXE
I[17:40:56.099] argv[1]: --log=verbose
V[17:40:56.123] User config file is C:\Users\xxxxx\AppData\Local\clangd\config.yaml
I[17:40:56.123] Starting LSP over stdin/stdout
V[17:40:56.123] <<< {"id":0,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"markdown":{"parser":"marked","version":"1.1.0"},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]}},"textDocument":{"callHierarchy":{"dynamicRegistration":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"dynamicRegistration":true,"honorsChangeAnnotations":false,"isPreferredSupport":true,"resolveSupport":{"properties":["edit"]}},"codeLens":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"completion":{"completionItem":{"commitCharactersSupport":true,"deprecatedSupport":true,"documentationFormat":["markdown","plaintext"],"insertReplaceSupport":true,"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true,"preselectSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"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]},"contextSupport":true,"dynamicRegistration":true,"editsNearCursor":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"documentHighlight":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"documentSymbol":{"dynamicRegistration":true,"hierarchicalDocumentSymbolSupport":true,"labelSupport":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]},"tagSupport":{"valueSet":[1]}},"foldingRange":{"dynamicRegistration":true,"lineFoldingOnly":true,"rangeLimit":5000},"formatting":{"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"linkedEditingRange":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"dataSupport":true,"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":false},"rangeFormatting":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"honorsChangeAnnotations":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1},"selectionRange":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"formats":["relative"],"multilineTokenSupport":false,"overlappingTokenSupport":false,"requests":{"full":{"delta":true},"range":true},"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"]},"signatureHelp":{"contextSupport":true,"dynamicRegistration":true,"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"synchronization":{"didSave":true,"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true}},"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true},"workspace":{"applyEdit":true,"codeLens":{"refreshSupport":true},"configuration":true,"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"fileOperations":{"didCreate":true,"didDelete":true,"didRename":true,"dynamicRegistration":true,"willCreate":true,"willDelete":true,"willRename":true},"semanticTokens":{"refreshSupport":true},"symbol":{"dynamicRegistration":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]},"tagSupport":{"valueSet":[1]}},"workspaceEdit":{"changeAnnotationSupport":{"groupsOnLabel":true},"documentChanges":true,"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.67.0"},"initializationOptions":{"clangdFileStatus":true,"fallbackFlags":[]},"locale":"ja","processId":27448,"rootPath":"c:\\src","rootUri":"file:///c%3A/src","trace":"off","workspaceFolders":[{"name":"src","uri":"file:///c%3A/src"}]}}
I[17:40:56.124] <-- initialize(0)
I[17:40:56.128] --> reply:initialize(0) 4 ms
V[17:40:56.128] >>> {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"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.applyTweak"]},"hoverProvider":true,"implementationProvider":true,"memoryUsageProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","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","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc"}}}
V[17:40:56.134] <<< {"jsonrpc":"2.0","method":"initialized","params":{}}
I[17:40:56.134] <-- initialized
V[17:40:56.159] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"c","text":"#include \"src1.h\"\n#include \"src2.h\"\nvoid func1(void) { func2(); }\n","uri":"file:///c%3A/src/src1.c","version":1}}}
I[17:40:56.159] <-- textDocument/didOpen
V[17:40:56.159] <<< {"id":1,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":20,"line":2},"start":{"character":20,"line":2}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.159] <-- textDocument/codeAction(1)
V[17:40:56.159] <<< {"id":2,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.159] <-- textDocument/documentLink(2)
V[17:40:56.159] <<< {"id":3,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.159] <-- clangd/inlayHints(3)
I[17:40:56.163] Loaded compilation database from c:\src\compile_commands.json
V[17:40:56.163] Broadcasting compilation database from c:\src
I[17:40:56.163] ASTWorker building file c:\src\src1.c version 1 with command
[c:/src]
"C:\\Program Files\\LLVM\\bin\\gcc" -c -o src1.o "-resource-dir=C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -- "c:\\src\\src1.c"
I[17:40:56.163] --> window/workDoneProgress/create(0)
V[17:40:56.163] >>> {"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
I[17:40:56.163] Enqueueing 2 commands for indexing
V[17:40:56.166] Failed to load shard: c:\src\src1.c
V[17:40:56.166] Failed to load shard: c:\src\src2.c
V[17:40:56.176] Indexing src1.c (digest:=BDD48FCEEC748CF6)
V[17:40:56.176] Indexing src2.c (digest:=520AEE45A2019BAE)
V[17:40:56.200] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src1.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -fcoverage-compilation-dir=c:/src -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\winrt" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c "c:\\src\\src1.c"
I[17:40:56.200] --> textDocument/clangd.fileStatus
V[17:40:56.200] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///c:/src/src1.c"}}
V[17:40:56.200] Building first preamble for c:\src\src1.c version 1
I[17:40:56.212] Indexed src2.c (1 symbols, 2 refs, 2 files)
I[17:40:56.213] Indexed src1.c (3 symbols, 4 refs, 3 files)
V[17:40:56.238] indexed preamble AST for c:\src\src1.c version 1:
symbol slab: 2 symbols, 4688 bytes
ref slab: 0 symbols, 0 refs, 136 bytes
relations slab: 0 relations, 24 bytes
V[17:40:56.238] Build dynamic index for header symbols with estimated memory usage of 12696 bytes
V[17:40:56.241] Built preamble of size 220844 for file c:\src\src1.c version 1
I[17:40:56.241] --> workspace/semanticTokens/refresh(1)
I[17:40:56.242] --> textDocument/clangd.fileStatus
V[17:40:56.242] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
V[17:40:56.242] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///c:/src/src1.c"}}
V[17:40:56.250] BackgroundIndex: building version 1 when background indexer is idle
V[17:40:56.250] BackgroundIndex: serving version 1 (23528 bytes)
V[17:40:56.286] indexed file AST for c:\src\src1.c version 1:
symbol slab: 1 symbols, 4456 bytes
ref slab: 2 symbols, 2 refs, 4280 bytes
relations slab: 0 relations, 24 bytes
V[17:40:56.287] Build dynamic index for main-file symbols with estimated memory usage of 11592 bytes
I[17:40:56.287] --> textDocument/publishDiagnostics
V[17:40:56.287] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c:/src/src1.c","version":1}}
V[17:40:56.287] ASTWorker running EnumerateTweaks on version 1 of c:\src\src1.c
I[17:40:56.287] --> reply:textDocument/codeAction(1) 127 ms
V[17:40:56.287] >>> {"id":1,"jsonrpc":"2.0","result":[]}
V[17:40:56.287] ASTWorker running DocumentLinks on version 1 of c:\src\src1.c
I[17:40:56.287] --> reply:textDocument/documentLink(2) 127 ms
V[17:40:56.287] >>> {"id":2,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src1.h"},{"range":{"end":{"character":17,"line":1},"start":{"character":9,"line":1}},"target":"file:///C:/src/src2.h"}]}
V[17:40:56.287] ASTWorker running InlayHints on version 1 of c:\src\src1.c
I[17:40:56.287] --> reply:clangd/inlayHints(3) 127 ms
V[17:40:56.287] >>> {"id":3,"jsonrpc":"2.0","result":[]}
I[17:40:56.287] --> textDocument/clangd.fileStatus
V[17:40:56.287] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:56.321] <<< {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":2}}
I[17:40:56.321] <-- $/cancelRequest
V[17:40:56.330] <<< {"id":4,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.330] <-- textDocument/documentLink(4)
V[17:40:56.330] ASTWorker running DocumentLinks on version 1 of c:\src\src1.c
I[17:40:56.330] --> reply:textDocument/documentLink(4) 0 ms
V[17:40:56.330] >>> {"id":4,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src1.h"},{"range":{"end":{"character":17,"line":1},"start":{"character":9,"line":1}},"target":"file:///C:/src/src2.h"}]}
I[17:40:56.330] --> textDocument/clangd.fileStatus
V[17:40:56.330] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:56.332] <<< {"id":0,"jsonrpc":"2.0","result":null}
I[17:40:56.332] <-- reply(0)
I[17:40:56.332] --> $/progress
V[17:40:56.332] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}
I[17:40:56.332] --> $/progress
V[17:40:56.332] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
V[17:40:56.334] <<< {"id":1,"jsonrpc":"2.0","result":null}
I[17:40:56.334] <-- reply(1)
V[17:40:56.375] <<< {"id":5,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.375] <-- textDocument/semanticTokens/full(5)
V[17:40:56.375] ASTWorker running SemanticHighlights on version 1 of c:\src\src1.c
I[17:40:56.375] --> reply:textDocument/semanticTokens/full(5) 0 ms
V[17:40:56.375] >>> {"id":5,"jsonrpc":"2.0","result":{"data":[2,5,5,3,8193,0,14,5,3,8192],"resultId":"1"}}
I[17:40:56.375] --> textDocument/clangd.fileStatus
V[17:40:56.375] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:56.407] <<< {"id":6,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:56.407] <-- textDocument/documentLink(6)
V[17:40:56.407] ASTWorker running DocumentLinks on version 1 of c:\src\src1.c
I[17:40:56.407] --> reply:textDocument/documentLink(6) 0 ms
V[17:40:56.407] >>> {"id":6,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src1.h"},{"range":{"end":{"character":17,"line":1},"start":{"character":9,"line":1}},"target":"file:///C:/src/src2.h"}]}
I[17:40:56.407] --> textDocument/clangd.fileStatus
V[17:40:56.407] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:57.292] <<< {"id":7,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":20,"line":2},"start":{"character":20,"line":2}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:57.292] <-- textDocument/codeAction(7)
V[17:40:57.292] ASTWorker running EnumerateTweaks on version 1 of c:\src\src1.c
I[17:40:57.292] --> reply:textDocument/codeAction(7) 0 ms
V[17:40:57.292] >>> {"id":7,"jsonrpc":"2.0","result":[]}
I[17:40:57.292] --> textDocument/clangd.fileStatus
V[17:40:57.292] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:57.292] <<< {"id":8,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:40:57.292] <-- textDocument/documentSymbol(8)
V[17:40:57.293] ASTWorker running DocumentSymbols on version 1 of c:\src\src1.c
I[17:40:57.293] --> reply:textDocument/documentSymbol(8) 0 ms
V[17:40:57.293] >>> {"id":8,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func1","range":{"end":{"character":29,"line":2},"start":{"character":0,"line":2}},"selectionRange":{"end":{"character":10,"line":2},"start":{"character":5,"line":2}}}]}
I[17:40:57.293] --> textDocument/clangd.fileStatus
V[17:40:57.293] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:40:58.960] <<< {"jsonrpc":"2.0","method":"$/setTrace","params":{"value":"off"}}
I[17:40:58.960] <-- $/setTrace
I[17:40:58.960] unhandled notification $/setTrace
V[17:41:00.406] <<< {"jsonrpc":"2.0","method":"$/setTrace","params":{"value":"off"}}
I[17:41:00.406] <-- $/setTrace
I[17:41:00.406] unhandled notification $/setTrace
V[17:41:04.805] <<< {"id":9,"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:04.805] <-- textDocument/hover(9)
V[17:41:04.810] ASTWorker running Hover on version 1 of c:\src\src1.c
I[17:41:04.814] --> reply:textDocument/hover(9) 8 ms
V[17:41:04.814] >>> {"id":9,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"### function `func2` \n\n---\n→ `void` \n\n---\n```cpp\nextern void func2()\n```"},"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}}}}
I[17:41:04.814] --> textDocument/clangd.fileStatus
V[17:41:04.814] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:05.014] <<< {"id":10,"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:05.014] <-- textDocument/hover(10)
V[17:41:05.015] ASTWorker running Hover on version 1 of c:\src\src1.c
I[17:41:05.020] --> reply:textDocument/hover(10) 5 ms
V[17:41:05.020] >>> {"id":10,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"### function `func2` \n\n---\n→ `void` \n\n---\n```cpp\nextern void func2()\n```"},"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}}}}
I[17:41:05.020] --> textDocument/clangd.fileStatus
V[17:41:05.020] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:05.292] <<< {"id":11,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":21,"line":2},"start":{"character":21,"line":2}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:05.292] <-- textDocument/codeAction(11)
V[17:41:05.292] ASTWorker running EnumerateTweaks on version 1 of c:\src\src1.c
I[17:41:05.292] --> reply:textDocument/codeAction(11) 0 ms
V[17:41:05.292] >>> {"id":11,"jsonrpc":"2.0","result":[]}
I[17:41:05.292] --> textDocument/clangd.fileStatus
V[17:41:05.292] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:05.556] <<< {"id":12,"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:05.556] <-- textDocument/hover(12)
V[17:41:05.556] ASTWorker running Hover on version 1 of c:\src\src1.c
I[17:41:05.560] --> reply:textDocument/hover(12) 4 ms
V[17:41:05.560] >>> {"id":12,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"### function `func2` \n\n---\n→ `void` \n\n---\n```cpp\nextern void func2()\n```"},"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}}}}
I[17:41:05.560] --> textDocument/clangd.fileStatus
V[17:41:05.560] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:09.722] <<< {"id":13,"jsonrpc":"2.0","method":"textDocument/definition","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:09.722] <-- textDocument/definition(13)
V[17:41:09.722] ASTWorker running Definitions on version 1 of c:\src\src1.c
I[17:41:09.723] --> reply:textDocument/definition(13) 0 ms
V[17:41:09.723] >>> {"id":13,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":12,"line":0}},"uri":"file:///C:/src/src2.h"}]}
I[17:41:09.723] --> textDocument/clangd.fileStatus
V[17:41:09.723] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:09.852] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"cpp","text":"extern void func2(void);\n","uri":"file:///c%3A/src/src2.h","version":1}}}
I[17:41:09.852] <-- textDocument/didOpen
V[17:41:09.853] <<< {"id":14,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.853] <-- textDocument/codeAction(14)
V[17:41:09.853] <<< {"id":15,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.853] <-- textDocument/documentSymbol(15)
V[17:41:09.853] <<< {"id":16,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":0,"line":0},"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.853] <-- textDocument/documentHighlight(16)
V[17:41:09.853] <<< {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":16}}
I[17:41:09.853] <-- $/cancelRequest
V[17:41:09.853] <<< {"id":17,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.853] <-- textDocument/semanticTokens/full(17)
V[17:41:09.854] <<< {"id":18,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.854] <-- textDocument/documentLink(18)
V[17:41:09.854] <<< {"id":19,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":1},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.854] <-- clangd/inlayHints(19)
V[17:41:09.854] <<< {"id":20,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":12,"line":0},"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:09.854] <-- textDocument/documentHighlight(20)
I[17:41:09.858] ASTWorker building file c:\src\src2.h version 1 with command inferred from src2.c
[c:/src]
"C:\\Program Files\\LLVM\\bin\\gcc" -c -x c-header "-resource-dir=C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -- "c:\\src\\src2.h"
V[17:41:09.881] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src2.h -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -fcoverage-compilation-dir=c:/src -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\winrt" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c-header "c:\\src\\src2.h"
I[17:41:09.881] --> textDocument/clangd.fileStatus
V[17:41:09.881] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///c:/src/src2.h"}}
V[17:41:09.881] Building first preamble for c:\src\src2.h version 1
V[17:41:09.904] indexed preamble AST for c:\src\src2.h version 1:
symbol slab: 0 symbols, 128 bytes
ref slab: 0 symbols, 0 refs, 136 bytes
relations slab: 0 relations, 24 bytes
V[17:41:09.907] Built preamble of size 220320 for file c:\src\src2.h version 1
I[17:41:09.907] --> workspace/semanticTokens/refresh(2)
I[17:41:09.907] --> textDocument/clangd.fileStatus
V[17:41:09.907] >>> {"id":2,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
V[17:41:09.907] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///c:/src/src2.h"}}
V[17:41:09.908] <<< {"id":2,"jsonrpc":"2.0","result":null}
I[17:41:09.908] <-- reply(2)
V[17:41:09.915] <<< {"id":21,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full/delta","params":{"previousResultId":"1","textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:09.915] <-- textDocument/semanticTokens/full/delta(21)
V[17:41:09.915] ASTWorker running SemanticHighlights on version 1 of c:\src\src1.c
I[17:41:09.915] --> reply:textDocument/semanticTokens/full/delta(21) 0 ms
V[17:41:09.915] >>> {"id":21,"jsonrpc":"2.0","result":{"edits":[],"resultId":"2"}}
I[17:41:09.915] --> textDocument/clangd.fileStatus
V[17:41:09.915] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:09.945] indexed file AST for c:\src\src2.h version 1:
symbol slab: 1 symbols, 4456 bytes
ref slab: 1 symbols, 1 refs, 4256 bytes
relations slab: 0 relations, 24 bytes
V[17:41:09.945] Build dynamic index for main-file symbols with estimated memory usage of 20568 bytes
I[17:41:09.945] --> textDocument/publishDiagnostics
V[17:41:09.945] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c:/src/src2.h","version":1}}
V[17:41:09.945] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:textDocument/codeAction(14) 92 ms
V[17:41:09.945] >>> {"id":14,"jsonrpc":"2.0","result":[]}
V[17:41:09.945] ASTWorker running DocumentSymbols on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:textDocument/documentSymbol(15) 92 ms
V[17:41:09.945] >>> {"id":15,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func2","range":{"end":{"character":23,"line":0},"start":{"character":0,"line":0}},"selectionRange":{"end":{"character":17,"line":0},"start":{"character":12,"line":0}}}]}
I[17:41:09.945] --> reply:textDocument/documentHighlight(16) 92 ms, error: Task was cancelled.
V[17:41:09.945] >>> {"error":{"code":-32800,"message":"Request cancelled"},"id":16,"jsonrpc":"2.0"}
V[17:41:09.945] ASTWorker running SemanticHighlights on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:textDocument/semanticTokens/full(17) 91 ms
V[17:41:09.945] >>> {"id":17,"jsonrpc":"2.0","result":{"data":[0,12,5,3,8193],"resultId":"1"}}
V[17:41:09.945] ASTWorker running DocumentLinks on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:textDocument/documentLink(18) 91 ms
V[17:41:09.945] >>> {"id":18,"jsonrpc":"2.0","result":[]}
V[17:41:09.945] ASTWorker running InlayHints on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:clangd/inlayHints(19) 90 ms
V[17:41:09.945] >>> {"id":19,"jsonrpc":"2.0","result":[]}
V[17:41:09.945] ASTWorker running Highlights on version 1 of c:\src\src2.h
I[17:41:09.945] --> reply:textDocument/documentHighlight(20) 90 ms
V[17:41:09.945] >>> {"id":20,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":17,"line":0},"start":{"character":12,"line":0}}}]}
I[17:41:09.945] --> textDocument/clangd.fileStatus
V[17:41:09.945] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.h"}}
[Error - 17:41:09] Request textDocument/documentHighlight failed.
[object Object]
V[17:41:10.061] <<< {"id":22,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":12,"line":0},"start":{"character":12,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.h"}}}
I[17:41:10.061] <-- textDocument/codeAction(22)
V[17:41:10.061] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.h
I[17:41:10.061] --> reply:textDocument/codeAction(22) 0 ms
V[17:41:10.061] >>> {"id":22,"jsonrpc":"2.0","result":[]}
I[17:41:10.061] --> textDocument/clangd.fileStatus
V[17:41:10.061] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.h"}}
The following is the log when src2.c is opened in Windows after opening src2.c and jumping to the func2 definition.
I[17:41:51.139] clangd version 14.0.0
I[17:41:51.141] Features: windows
I[17:41:51.141] PID: 38556
I[17:41:51.141] Working directory: c:\src
I[17:41:51.141] argv[0]: C:\Program Files\LLVM\bin\clangd.EXE
I[17:41:51.141] argv[1]: --log=verbose
V[17:41:51.170] User config file is C:\Users\xxxxx\AppData\Local\clangd\config.yaml
I[17:41:51.170] Starting LSP over stdin/stdout
V[17:41:51.171] <<< {"id":0,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"markdown":{"parser":"marked","version":"1.1.0"},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]}},"textDocument":{"callHierarchy":{"dynamicRegistration":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"dynamicRegistration":true,"honorsChangeAnnotations":false,"isPreferredSupport":true,"resolveSupport":{"properties":["edit"]}},"codeLens":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"completion":{"completionItem":{"commitCharactersSupport":true,"deprecatedSupport":true,"documentationFormat":["markdown","plaintext"],"insertReplaceSupport":true,"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true,"preselectSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"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]},"contextSupport":true,"dynamicRegistration":true,"editsNearCursor":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"documentHighlight":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"documentSymbol":{"dynamicRegistration":true,"hierarchicalDocumentSymbolSupport":true,"labelSupport":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]},"tagSupport":{"valueSet":[1]}},"foldingRange":{"dynamicRegistration":true,"lineFoldingOnly":true,"rangeLimit":5000},"formatting":{"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"linkedEditingRange":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"dataSupport":true,"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":false},"rangeFormatting":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"honorsChangeAnnotations":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1},"selectionRange":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"formats":["relative"],"multilineTokenSupport":false,"overlappingTokenSupport":false,"requests":{"full":{"delta":true},"range":true},"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"]},"signatureHelp":{"contextSupport":true,"dynamicRegistration":true,"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"synchronization":{"didSave":true,"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true}},"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true},"workspace":{"applyEdit":true,"codeLens":{"refreshSupport":true},"configuration":true,"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"fileOperations":{"didCreate":true,"didDelete":true,"didRename":true,"dynamicRegistration":true,"willCreate":true,"willDelete":true,"willRename":true},"semanticTokens":{"refreshSupport":true},"symbol":{"dynamicRegistration":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]},"tagSupport":{"valueSet":[1]}},"workspaceEdit":{"changeAnnotationSupport":{"groupsOnLabel":true},"documentChanges":true,"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.67.0"},"initializationOptions":{"clangdFileStatus":true,"fallbackFlags":[]},"locale":"ja","processId":10952,"rootPath":"c:\\src","rootUri":"file:///c%3A/src","trace":"off","workspaceFolders":[{"name":"src","uri":"file:///c%3A/src"}]}}
I[17:41:51.171] <-- initialize(0)
I[17:41:51.175] --> reply:initialize(0) 4 ms
V[17:41:51.175] >>> {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"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.applyTweak"]},"hoverProvider":true,"implementationProvider":true,"memoryUsageProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","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","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"clangd version 14.0.0 windows x86_64-pc-windows-msvc"}}}
V[17:41:51.262] <<< {"jsonrpc":"2.0","method":"initialized","params":{}}
I[17:41:51.262] <-- initialized
V[17:41:51.315] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"c","text":"#include \"src2.h\"\nvoid func2(void) { }\n","uri":"file:///c%3A/src/src2.c","version":1}}}
I[17:41:51.315] <-- textDocument/didOpen
V[17:41:51.316] <<< {"id":1,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:51.316] <-- textDocument/codeAction(1)
V[17:41:51.317] <<< {"id":2,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:51.317] <-- textDocument/documentLink(2)
V[17:41:51.317] <<< {"id":3,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":2},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:51.318] <-- clangd/inlayHints(3)
I[17:41:51.321] Loaded compilation database from c:\src\compile_commands.json
I[17:41:51.321] ASTWorker building file c:\src\src2.c version 1 with command
[c:/src]
"C:\\Program Files\\LLVM\\bin\\gcc" -c -o src2.o "-resource-dir=C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -- "c:\\src\\src2.c"
V[17:41:51.321] Broadcasting compilation database from c:\src
I[17:41:51.321] --> window/workDoneProgress/create(0)
V[17:41:51.321] >>> {"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
I[17:41:51.321] Enqueueing 2 commands for indexing
V[17:41:51.324] Failed to load shard: c:\src\src1.c
V[17:41:51.325] Failed to load shard: c:\src\src2.c
V[17:41:51.338] Indexing src1.c (digest:=BDD48FCEEC748CF6)
V[17:41:51.339] Indexing src2.c (digest:=520AEE45A2019BAE)
V[17:41:51.351] <<< {"id":0,"jsonrpc":"2.0","result":null}
I[17:41:51.351] <-- reply(0)
I[17:41:51.351] --> $/progress
V[17:41:51.351] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}
I[17:41:51.351] --> $/progress
V[17:41:51.351] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/3","percentage":33}}}
V[17:41:51.351] <<< {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":2}}
I[17:41:51.351] <-- $/cancelRequest
V[17:41:51.352] <<< {"id":4,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:51.352] <-- textDocument/documentLink(4)
V[17:41:51.367] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src2.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -fcoverage-compilation-dir=c:/src -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\winrt" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c "c:\\src\\src2.c"
I[17:41:51.367] --> textDocument/clangd.fileStatus
V[17:41:51.367] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///c:/src/src2.c"}}
V[17:41:51.368] Building first preamble for c:\src\src2.c version 1
I[17:41:51.381] Indexed src1.c (3 symbols, 4 refs, 3 files)
I[17:41:51.382] Indexed src2.c (1 symbols, 2 refs, 2 files)
V[17:41:51.410] indexed preamble AST for c:\src\src2.c version 1:
symbol slab: 1 symbols, 4456 bytes
ref slab: 0 symbols, 0 refs, 136 bytes
relations slab: 0 relations, 24 bytes
V[17:41:51.410] Build dynamic index for header symbols with estimated memory usage of 8060 bytes
V[17:41:51.413] Built preamble of size 220576 for file c:\src\src2.c version 1
I[17:41:51.414] --> workspace/semanticTokens/refresh(1)
I[17:41:51.414] --> textDocument/clangd.fileStatus
V[17:41:51.414] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
V[17:41:51.414] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///c:/src/src2.c"}}
I[17:41:51.414] --> textDocument/clangd.fileStatus
V[17:41:51.414] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, parsing main file","uri":"file:///c:/src/src2.c"}}
V[17:41:51.415] <<< {"id":1,"jsonrpc":"2.0","result":null}
I[17:41:51.415] <-- reply(1)
I[17:41:51.421] --> $/progress
V[17:41:51.421] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/3","percentage":66}}}
V[17:41:51.430] BackgroundIndex: building version 1 when background indexer is idle
V[17:41:51.430] BackgroundIndex: serving version 1 (23528 bytes)
I[17:41:51.430] --> $/progress
V[17:41:51.430] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
V[17:41:51.462] indexed file AST for c:\src\src2.c version 1:
symbol slab: 1 symbols, 4456 bytes
ref slab: 1 symbols, 1 refs, 4256 bytes
relations slab: 0 relations, 24 bytes
V[17:41:51.462] Build dynamic index for main-file symbols with estimated memory usage of 11536 bytes
I[17:41:51.462] --> textDocument/publishDiagnostics
V[17:41:51.462] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c:/src/src2.c","version":1}}
V[17:41:51.462] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.c
I[17:41:51.462] --> reply:textDocument/codeAction(1) 146 ms
V[17:41:51.462] >>> {"id":1,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"file":"file:///c:/src/src2.c","selection":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"tweakID":"DefineInline"}],"command":"clangd.applyTweak","title":"Move function body to declaration"},"kind":"refactor","title":"Move function body to declaration"}]}
I[17:41:51.462] --> reply:textDocument/documentLink(2) 145 ms, error: Task was cancelled.
V[17:41:51.462] >>> {"error":{"code":-32800,"message":"Request cancelled"},"id":2,"jsonrpc":"2.0"}
V[17:41:51.462] ASTWorker running InlayHints on version 1 of c:\src\src2.c
I[17:41:51.462] --> reply:clangd/inlayHints(3) 144 ms
V[17:41:51.462] >>> {"id":3,"jsonrpc":"2.0","result":[]}
V[17:41:51.463] ASTWorker running DocumentLinks on version 1 of c:\src\src2.c
I[17:41:51.463] --> reply:textDocument/documentLink(4) 110 ms
V[17:41:51.463] >>> {"id":4,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src2.h"}]}
I[17:41:51.463] --> textDocument/clangd.fileStatus
V[17:41:51.463] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
[Error - 17:41:51] Request textDocument/documentLink failed.
[object Object]
V[17:41:51.476] <<< {"id":5,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:51.476] <-- textDocument/semanticTokens/full(5)
V[17:41:51.476] ASTWorker running SemanticHighlights on version 1 of c:\src\src2.c
I[17:41:51.476] --> reply:textDocument/semanticTokens/full(5) 0 ms
V[17:41:51.476] >>> {"id":5,"jsonrpc":"2.0","result":{"data":[1,5,5,3,8193],"resultId":"1"}}
I[17:41:51.476] --> textDocument/clangd.fileStatus
V[17:41:51.476] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:41:52.338] <<< {"id":6,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:52.338] <-- textDocument/codeAction(6)
V[17:41:52.338] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.c
I[17:41:52.338] --> reply:textDocument/codeAction(6) 0 ms
V[17:41:52.338] >>> {"id":6,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"file":"file:///c:/src/src2.c","selection":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"tweakID":"DefineInline"}],"command":"clangd.applyTweak","title":"Move function body to declaration"},"kind":"refactor","title":"Move function body to declaration"}]}
I[17:41:52.338] --> textDocument/clangd.fileStatus
V[17:41:52.338] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:41:52.338] <<< {"id":7,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:52.338] <-- textDocument/documentSymbol(7)
V[17:41:52.339] ASTWorker running DocumentSymbols on version 1 of c:\src\src2.c
I[17:41:52.339] --> reply:textDocument/documentSymbol(7) 0 ms
V[17:41:52.339] >>> {"id":7,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func2","range":{"end":{"character":20,"line":1},"start":{"character":0,"line":1}},"selectionRange":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}}}]}
I[17:41:52.339] --> textDocument/clangd.fileStatus
V[17:41:52.339] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:41:54.066] <<< {"jsonrpc":"2.0","method":"$/setTrace","params":{"value":"off"}}
I[17:41:54.067] <-- $/setTrace
I[17:41:54.067] unhandled notification $/setTrace
V[17:41:55.708] <<< {"jsonrpc":"2.0","method":"$/setTrace","params":{"value":"off"}}
I[17:41:55.708] <-- $/setTrace
I[17:41:55.708] unhandled notification $/setTrace
V[17:41:58.765] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"c","text":"#include \"src1.h\"\n#include \"src2.h\"\nvoid func1(void) { func2(); }\n","uri":"file:///c%3A/src/src1.c","version":1}}}
I[17:41:58.765] <-- textDocument/didOpen
V[17:41:58.766] <<< {"id":8,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.766] <-- textDocument/codeAction(8)
V[17:41:58.766] <<< {"id":9,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.766] <-- textDocument/documentSymbol(9)
V[17:41:58.766] <<< {"id":10,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.766] <-- textDocument/documentHighlight(10)
V[17:41:58.766] <<< {"id":11,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.766] <-- textDocument/semanticTokens/full(11)
V[17:41:58.766] <<< {"id":12,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.766] <-- textDocument/documentLink(12)
V[17:41:58.767] <<< {"id":13,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.767] <-- clangd/inlayHints(13)
I[17:41:58.771] ASTWorker building file c:\src\src1.c version 1 with command
[c:/src]
"C:\\Program Files\\LLVM\\bin\\gcc" -c -o src1.o "-resource-dir=C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -- "c:\\src\\src1.c"
V[17:41:58.787] Driver produced command: cc1 -cc1 -triple x86_64-pc-windows-msvc19.0.24215 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src1.c -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -fcoverage-compilation-dir=c:/src -resource-dir "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0" -internal-isystem "C:\\Program Files\\LLVM\\lib\\clang\\14.0.0\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include" -internal-isystem "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\atlmfc\\include" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10240.0\\ucrt" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\shared" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\um" -internal-isystem "C:\\Program Files (x86)\\Windows Kits\\8.1\\Include\\winrt" -fdebug-compilation-dir=c:/src -ferror-limit 19 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.0.24215 -fdelayed-template-parsing -faddrsig -x c "c:\\src\\src1.c"
I[17:41:58.788] --> textDocument/clangd.fileStatus
V[17:41:58.788] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///c:/src/src1.c"}}
V[17:41:58.788] Building first preamble for c:\src\src1.c version 1
V[17:41:58.807] indexed preamble AST for c:\src\src1.c version 1:
symbol slab: 2 symbols, 4688 bytes
ref slab: 0 symbols, 0 refs, 136 bytes
relations slab: 0 relations, 24 bytes
V[17:41:58.807] Build dynamic index for header symbols with estimated memory usage of 12696 bytes
V[17:41:58.810] Built preamble of size 220844 for file c:\src\src1.c version 1
I[17:41:58.810] --> workspace/semanticTokens/refresh(2)
I[17:41:58.810] --> textDocument/clangd.fileStatus
V[17:41:58.810] >>> {"id":2,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
V[17:41:58.810] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///c:/src/src1.c"}}
I[17:41:58.810] --> textDocument/clangd.fileStatus
V[17:41:58.810] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, parsing main file","uri":"file:///c:/src/src1.c"}}
V[17:41:58.811] <<< {"id":2,"jsonrpc":"2.0","result":null}
I[17:41:58.811] <-- reply(2)
V[17:41:58.814] <<< {"id":14,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full/delta","params":{"previousResultId":"1","textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:41:58.814] <-- textDocument/semanticTokens/full/delta(14)
V[17:41:58.815] ASTWorker running SemanticHighlights on version 1 of c:\src\src2.c
I[17:41:58.815] --> reply:textDocument/semanticTokens/full/delta(14) 0 ms
V[17:41:58.815] >>> {"id":14,"jsonrpc":"2.0","result":{"edits":[],"resultId":"2"}}
I[17:41:58.815] --> textDocument/clangd.fileStatus
V[17:41:58.815] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:41:58.844] indexed file AST for c:\src\src1.c version 1:
symbol slab: 1 symbols, 4456 bytes
ref slab: 2 symbols, 2 refs, 4280 bytes
relations slab: 0 relations, 24 bytes
V[17:41:58.844] Build dynamic index for main-file symbols with estimated memory usage of 20568 bytes
I[17:41:58.844] --> textDocument/publishDiagnostics
V[17:41:58.844] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///c:/src/src1.c","version":1}}
V[17:41:58.844] ASTWorker running EnumerateTweaks on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:textDocument/codeAction(8) 78 ms
V[17:41:58.844] >>> {"id":8,"jsonrpc":"2.0","result":[]}
V[17:41:58.844] ASTWorker running DocumentSymbols on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:textDocument/documentSymbol(9) 78 ms
V[17:41:58.844] >>> {"id":9,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func1","range":{"end":{"character":29,"line":2},"start":{"character":0,"line":2}},"selectionRange":{"end":{"character":10,"line":2},"start":{"character":5,"line":2}}}]}
V[17:41:58.844] ASTWorker running Highlights on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:textDocument/documentHighlight(10) 78 ms
V[17:41:58.844] >>> {"id":10,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}}}]}
V[17:41:58.844] ASTWorker running SemanticHighlights on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:textDocument/semanticTokens/full(11) 77 ms
V[17:41:58.844] >>> {"id":11,"jsonrpc":"2.0","result":{"data":[2,5,5,3,8193,0,14,5,3,8192],"resultId":"1"}}
V[17:41:58.844] ASTWorker running DocumentLinks on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:textDocument/documentLink(12) 77 ms
V[17:41:58.844] >>> {"id":12,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src1.h"},{"range":{"end":{"character":17,"line":1},"start":{"character":9,"line":1}},"target":"file:///C:/src/src2.h"}]}
V[17:41:58.844] ASTWorker running InlayHints on version 1 of c:\src\src1.c
I[17:41:58.844] --> reply:clangd/inlayHints(13) 77 ms
V[17:41:58.844] >>> {"id":13,"jsonrpc":"2.0","result":[]}
I[17:41:58.844] --> textDocument/clangd.fileStatus
V[17:41:58.844] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:41:58.984] <<< {"id":15,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":21,"line":2},"start":{"character":21,"line":2}},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:41:58.984] <-- textDocument/codeAction(15)
V[17:41:58.984] ASTWorker running EnumerateTweaks on version 1 of c:\src\src1.c
I[17:41:58.984] --> reply:textDocument/codeAction(15) 0 ms
V[17:41:58.984] >>> {"id":15,"jsonrpc":"2.0","result":[]}
I[17:41:58.984] --> textDocument/clangd.fileStatus
V[17:41:58.984] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:42:06.478] <<< {"id":16,"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:42:06.478] <-- textDocument/hover(16)
V[17:42:06.481] ASTWorker running Hover on version 1 of c:\src\src1.c
I[17:42:06.482] --> reply:textDocument/hover(16) 4 ms
V[17:42:06.482] >>> {"id":16,"jsonrpc":"2.0","result":{"contents":{"kind":"markdown","value":"### function `func2` \n\n---\n→ `void` \n\n---\n```cpp\nextern void func2()\n```"},"range":{"end":{"character":24,"line":2},"start":{"character":19,"line":2}}}}
I[17:42:06.482] --> textDocument/clangd.fileStatus
V[17:42:06.482] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:42:10.651] <<< {"id":17,"jsonrpc":"2.0","method":"textDocument/definition","params":{"position":{"character":21,"line":2},"textDocument":{"uri":"file:///c%3A/src/src1.c"}}}
I[17:42:10.651] <-- textDocument/definition(17)
V[17:42:10.651] ASTWorker running Definitions on version 1 of c:\src\src1.c
I[17:42:10.652] --> reply:textDocument/definition(17) 1 ms
V[17:42:10.652] >>> {"id":17,"jsonrpc":"2.0","result":[{"range":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}},"uri":"file:///C:/src/src2.c"}]}
I[17:42:10.652] --> textDocument/clangd.fileStatus
V[17:42:10.652] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src1.c"}}
V[17:42:10.711] <<< {"id":18,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:42:10.711] <-- textDocument/codeAction(18)
V[17:42:10.711] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.c
I[17:42:10.711] --> reply:textDocument/codeAction(18) 0 ms
V[17:42:10.711] >>> {"id":18,"jsonrpc":"2.0","result":[]}
I[17:42:10.711] --> textDocument/clangd.fileStatus
V[17:42:10.711] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:42:10.712] <<< {"id":19,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:42:10.712] <-- textDocument/documentLink(19)
V[17:42:10.712] ASTWorker running DocumentLinks on version 1 of c:\src\src2.c
I[17:42:10.712] --> reply:textDocument/documentLink(19) 0 ms
V[17:42:10.712] >>> {"id":19,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///C:/src/src2.h"}]}
I[17:42:10.712] --> textDocument/clangd.fileStatus
V[17:42:10.712] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:42:10.712] <<< {"id":20,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":2},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:42:10.712] <-- clangd/inlayHints(20)
V[17:42:10.712] ASTWorker running InlayHints on version 1 of c:\src\src2.c
I[17:42:10.712] --> reply:clangd/inlayHints(20) 0 ms
V[17:42:10.712] >>> {"id":20,"jsonrpc":"2.0","result":[]}
I[17:42:10.712] --> textDocument/clangd.fileStatus
V[17:42:10.712] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:42:10.713] <<< {"id":21,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":5,"line":1},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:42:10.713] <-- textDocument/documentHighlight(21)
V[17:42:10.713] ASTWorker running Highlights on version 1 of c:\src\src2.c
I[17:42:10.713] --> reply:textDocument/documentHighlight(21) 0 ms
V[17:42:10.713] >>> {"id":21,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}}}]}
I[17:42:10.713] --> textDocument/clangd.fileStatus
V[17:42:10.713] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
V[17:42:10.926] <<< {"id":22,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"textDocument":{"uri":"file:///c%3A/src/src2.c"}}}
I[17:42:10.926] <-- textDocument/codeAction(22)
V[17:42:10.926] ASTWorker running EnumerateTweaks on version 1 of c:\src\src2.c
I[17:42:10.926] --> reply:textDocument/codeAction(22) 0 ms
V[17:42:10.926] >>> {"id":22,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"file":"file:///c:/src/src2.c","selection":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"tweakID":"DefineInline"}],"command":"clangd.applyTweak","title":"Move function body to declaration"},"kind":"refactor","title":"Move function body to declaration"}]}
I[17:42:10.926] --> textDocument/clangd.fileStatus
V[17:42:10.926] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///c:/src/src2.c"}}
The following is the log when src2.c is opened by jumping to the func2 definition before opening src2.c, using clangd on Ubuntu 22.04 using VS Code's Remote WSL feature.
I[17:39:17.341] Ubuntu clangd version 14.0.0-1ubuntu1
I[17:39:17.341] Features: linux+grpc
I[17:39:17.341] PID: 16903
I[17:39:17.341] Working directory: /tmp/src
I[17:39:17.341] argv[0]: /usr/bin/clangd
I[17:39:17.341] argv[1]: --log=verbose
V[17:39:17.341] User config file is /home/xxxxx/.config/clangd/config.yaml
I[17:39:17.341] Starting LSP over stdin/stdout
V[17:39:17.354] <<< {"id":0,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"markdown":{"parser":"marked","version":"1.1.0"},"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]}},"textDocument":{"callHierarchy":{"dynamicRegistration":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"dynamicRegistration":true,"honorsChangeAnnotations":false,"isPreferredSupport":true,"resolveSupport":{"properties":["edit"]}},"codeLens":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"completion":{"completionItem":{"commitCharactersSupport":true,"deprecatedSupport":true,"documentationFormat":["markdown","plaintext"],"insertReplaceSupport":true,"insertTextModeSupport":{"valueSet":[1,2]},"labelDetailsSupport":true,"preselectSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"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]},"contextSupport":true,"dynamicRegistration":true,"editsNearCursor":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"documentHighlight":{"dynamicRegistration":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"documentSymbol":{"dynamicRegistration":true,"hierarchicalDocumentSymbolSupport":true,"labelSupport":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]},"tagSupport":{"valueSet":[1]}},"foldingRange":{"dynamicRegistration":true,"lineFoldingOnly":true,"rangeLimit":5000},"formatting":{"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"linkedEditingRange":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"dataSupport":true,"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":false},"rangeFormatting":{"dynamicRegistration":true},"references":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"honorsChangeAnnotations":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1},"selectionRange":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"formats":["relative"],"multilineTokenSupport":false,"overlappingTokenSupport":false,"requests":{"full":{"delta":true},"range":true},"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"]},"signatureHelp":{"contextSupport":true,"dynamicRegistration":true,"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}}},"synchronization":{"didSave":true,"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true}},"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true},"workspace":{"applyEdit":true,"codeLens":{"refreshSupport":true},"configuration":true,"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"executeCommand":{"dynamicRegistration":true},"fileOperations":{"didCreate":true,"didDelete":true,"didRename":true,"dynamicRegistration":true,"willCreate":true,"willDelete":true,"willRename":true},"semanticTokens":{"refreshSupport":true},"symbol":{"dynamicRegistration":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]},"tagSupport":{"valueSet":[1]}},"workspaceEdit":{"changeAnnotationSupport":{"groupsOnLabel":true},"documentChanges":true,"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"Visual Studio Code","version":"1.67.0"},"initializationOptions":{"clangdFileStatus":true,"fallbackFlags":[]},"locale":"ja","processId":16877,"rootPath":"/tmp/src","rootUri":"file:///tmp/src","trace":"off","workspaceFolders":[{"name":"src","uri":"file:///tmp/src"}]}}
I[17:39:17.354] <-- initialize(0)
I[17:39:17.355] --> reply:initialize(0) 0 ms
V[17:39:17.355] >>> {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"allCommitCharacters":[" ","\t","(",")","[","]","{","}","<",">",":",";",",","+","-","/","*","%","^","&","#","?",".","=","\"","'","|"],"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.applyTweak"]},"hoverProvider":true,"implementationProvider":true,"memoryUsageProvider":true,"referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","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","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"Ubuntu clangd version 14.0.0-1ubuntu1 linux+grpc x86_64-pc-linux-gnu"}}}
V[17:39:17.415] <<< {"jsonrpc":"2.0","method":"initialized","params":{}}
I[17:39:17.415] <-- initialized
V[17:39:17.415] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"c","text":"#include \"src1.h\"\n#include \"src2.h\"\nvoid func1(void) { func2(); }\n","uri":"file:///tmp/src/src1.c","version":1}}}
I[17:39:17.415] <-- textDocument/didOpen
I[17:39:17.417] Loaded compilation database from /tmp/src/compile_commands.json
V[17:39:17.417] Broadcasting compilation database from /tmp/src
I[17:39:17.417] ASTWorker building file /tmp/src/src1.c version 1 with command
[/tmp/src]
/usr/lib/llvm-14/bin/gcc -c -o src1.o -resource-dir=/usr/lib/llvm-14/lib/clang/14.0.0 -- /tmp/src/src1.c
I[17:39:17.417] --> window/workDoneProgress/create(0)
V[17:39:17.417] >>> {"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
I[17:39:17.417] Enqueueing 2 commands for indexing
V[17:39:17.418] Failed to load shard: /tmp/src/src1.c
V[17:39:17.418] Failed to load shard: /tmp/src/src2.c
V[17:39:17.418] Indexing src1.c (digest:=BDD48FCEEC748CF6)
V[17:39:17.418] Indexing src2.c (digest:=520AEE45A2019BAE)
V[17:39:17.421] <<< {"id":1,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":22,"line":2},"start":{"character":22,"line":2}},"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.421] <-- textDocument/codeAction(1)
V[17:39:17.421] <<< {"id":2,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.421] <-- textDocument/documentLink(2)
V[17:39:17.421] <<< {"id":3,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":3},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.422] <-- clangd/inlayHints(3)
V[17:39:17.436] <<< {"id":0,"jsonrpc":"2.0","result":null}
I[17:39:17.436] <-- reply(0)
I[17:39:17.436] --> $/progress
V[17:39:17.436] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}
I[17:39:17.436] --> $/progress
V[17:39:17.436] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/3","percentage":33}}}
V[17:39:17.445] <<< {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":1}}
I[17:39:17.445] <-- $/cancelRequest
V[17:39:17.445] <<< {"id":4,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":22,"line":2},"start":{"character":22,"line":2}},"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.445] <-- textDocument/codeAction(4)
V[17:39:17.445] <<< {"id":5,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.445] <-- textDocument/documentSymbol(5)
V[17:39:17.449] Driver produced command: cc1 -cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src1.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp/src -resource-dir /usr/lib/llvm-14/lib/clang/14.0.0 -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/tmp/src -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c /tmp/src/src1.c
I[17:39:17.450] --> textDocument/clangd.fileStatus
V[17:39:17.450] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///tmp/src/src1.c"}}
V[17:39:17.450] Building first preamble for /tmp/src/src1.c version 1
I[17:39:17.453] Indexed src1.c (3 symbols, 4 refs, 3 files)
I[17:39:17.454] --> $/progress
V[17:39:17.454] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/3","percentage":66}}}
I[17:39:17.457] Indexed src2.c (1 symbols, 2 refs, 2 files)
V[17:39:17.457] BackgroundIndex: building version 1 when background indexer is idle
V[17:39:17.457] BackgroundIndex: serving version 1 (40788 bytes)
I[17:39:17.457] --> $/progress
V[17:39:17.457] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
V[17:39:17.458] indexed preamble AST for /tmp/src/src1.c version 1:
symbol slab: 2 symbols, 4680 bytes
ref slab: 0 symbols, 0 refs, 128 bytes
relations slab: 0 relations, 24 bytes
V[17:39:17.458] Build dynamic index for header symbols with estimated memory usage of 12664 bytes
V[17:39:17.459] Built preamble of size 208020 for file /tmp/src/src1.c version 1
I[17:39:17.459] --> workspace/semanticTokens/refresh(1)
V[17:39:17.459] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
I[17:39:17.459] --> textDocument/clangd.fileStatus
V[17:39:17.459] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///tmp/src/src1.c"}}
I[17:39:17.459] --> textDocument/clangd.fileStatus
V[17:39:17.459] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, parsing main file","uri":"file:///tmp/src/src1.c"}}
V[17:39:17.461] <<< {"id":1,"jsonrpc":"2.0","result":null}
I[17:39:17.461] <-- reply(1)
V[17:39:17.514] <<< {"jsonrpc":"2.0","method":"$/cancelRequest","params":{"id":2}}
I[17:39:17.514] <-- $/cancelRequest
V[17:39:17.521] <<< {"id":6,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.521] <-- textDocument/documentLink(6)
V[17:39:17.521] <<< {"id":7,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:17.521] <-- textDocument/semanticTokens/full(7)
V[17:39:17.556] indexed file AST for /tmp/src/src1.c version 1:
symbol slab: 1 symbols, 4448 bytes
ref slab: 2 symbols, 2 refs, 4272 bytes
relations slab: 0 relations, 24 bytes
V[17:39:17.556] Build dynamic index for main-file symbols with estimated memory usage of 11576 bytes
I[17:39:17.556] --> textDocument/publishDiagnostics
V[17:39:17.556] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///tmp/src/src1.c","version":1}}
I[17:39:17.556] --> reply:textDocument/codeAction(1) 135 ms, error: Task was cancelled.
V[17:39:17.556] >>> {"error":{"code":-32800,"message":"Request cancelled"},"id":1,"jsonrpc":"2.0"}
I[17:39:17.556] --> reply:textDocument/documentLink(2) 134 ms, error: Task was cancelled.
V[17:39:17.556] >>> {"error":{"code":-32800,"message":"Request cancelled"},"id":2,"jsonrpc":"2.0"}
V[17:39:17.556] ASTWorker running InlayHints on version 1 of /tmp/src/src1.c
I[17:39:17.556] --> reply:clangd/inlayHints(3) 134 ms
V[17:39:17.556] >>> {"id":3,"jsonrpc":"2.0","result":[]}
V[17:39:17.556] ASTWorker running EnumerateTweaks on version 1 of /tmp/src/src1.c
I[17:39:17.556] --> reply:textDocument/codeAction(4) 111 ms
V[17:39:17.556] >>> {"id":4,"jsonrpc":"2.0","result":[]}
V[17:39:17.556] ASTWorker running DocumentSymbols on version 1 of /tmp/src/src1.c
I[17:39:17.556] --> reply:textDocument/documentSymbol(5) 110 ms
V[17:39:17.556] >>> {"id":5,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func1","range":{"end":{"character":29,"line":2},"start":{"character":0,"line":2}},"selectionRange":{"end":{"character":10,"line":2},"start":{"character":5,"line":2}}}]}
V[17:39:17.556] ASTWorker running DocumentLinks on version 1 of /tmp/src/src1.c
I[17:39:17.556] --> reply:textDocument/documentLink(6) 35 ms
V[17:39:17.556] >>> {"id":6,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///tmp/src/src1.h"},{"range":{"end":{"character":17,"line":1},"start":{"character":9,"line":1}},"target":"file:///tmp/src/src2.h"}]}
V[17:39:17.556] ASTWorker running SemanticHighlights on version 1 of /tmp/src/src1.c
I[17:39:17.556] --> reply:textDocument/semanticTokens/full(7) 35 ms
V[17:39:17.556] >>> {"id":7,"jsonrpc":"2.0","result":{"data":[2,5,5,3,8193,0,14,5,3,8192],"resultId":"1"}}
I[17:39:17.557] --> textDocument/clangd.fileStatus
V[17:39:17.557] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///tmp/src/src1.c"}}
[Error - 17:39:17] Request textDocument/codeAction failed.
[object Object]
[Error - 17:39:17] Request textDocument/documentLink failed.
[object Object]
V[17:39:37.483] <<< {"id":8,"jsonrpc":"2.0","method":"textDocument/definition","params":{"position":{"character":22,"line":2},"textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:37.483] <-- textDocument/definition(8)
V[17:39:37.485] ASTWorker running Definitions on version 1 of /tmp/src/src1.c
I[17:39:37.485] --> reply:textDocument/definition(8) 1 ms
V[17:39:37.485] >>> {"id":8,"jsonrpc":"2.0","result":[{"range":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}},"uri":"file:///tmp/src/src2.c"}]}
I[17:39:37.485] --> textDocument/clangd.fileStatus
V[17:39:37.485] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///tmp/src/src1.c"}}
V[17:39:37.563] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"c","text":"#include \"src2.h\"\nvoid func2(void) { }\n","uri":"file:///tmp/src/src2.c","version":1}}}
I[17:39:37.563] <-- textDocument/didOpen
V[17:39:37.564] <<< {"id":9,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- textDocument/codeAction(9)
V[17:39:37.564] <<< {"id":10,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- textDocument/documentSymbol(10)
V[17:39:37.564] <<< {"id":11,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- textDocument/semanticTokens/full(11)
V[17:39:37.564] <<< {"id":12,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- textDocument/documentLink(12)
V[17:39:37.564] <<< {"id":13,"jsonrpc":"2.0","method":"clangd/inlayHints","params":{"range":{"end":{"character":0,"line":2},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- clangd/inlayHints(13)
V[17:39:37.564] <<< {"id":14,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":5,"line":1},"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.564] <-- textDocument/documentHighlight(14)
I[17:39:37.564] ASTWorker building file /tmp/src/src2.c version 1 with command
[/tmp/src]
/usr/lib/llvm-14/bin/gcc -c -o src2.o -resource-dir=/usr/lib/llvm-14/lib/clang/14.0.0 -- /tmp/src/src2.c
V[17:39:37.595] Driver produced command: cc1 -cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name src2.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp/src -resource-dir /usr/lib/llvm-14/lib/clang/14.0.0 -internal-isystem /usr/lib/llvm-14/lib/clang/14.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdebug-compilation-dir=/tmp/src -ferror-limit 19 -fgnuc-version=4.2.1 -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c /tmp/src/src2.c
I[17:39:37.595] --> textDocument/clangd.fileStatus
V[17:39:37.595] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///tmp/src/src2.c"}}
V[17:39:37.595] Building first preamble for /tmp/src/src2.c version 1
V[17:39:37.600] indexed preamble AST for /tmp/src/src2.c version 1:
symbol slab: 1 symbols, 4448 bytes
ref slab: 0 symbols, 0 refs, 128 bytes
relations slab: 0 relations, 24 bytes
V[17:39:37.600] Build dynamic index for header symbols with estimated memory usage of 12664 bytes
V[17:39:37.601] Built preamble of size 207756 for file /tmp/src/src2.c version 1
I[17:39:37.601] --> workspace/semanticTokens/refresh(2)
V[17:39:37.601] >>> {"id":2,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
I[17:39:37.601] --> textDocument/clangd.fileStatus
V[17:39:37.601] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST","uri":"file:///tmp/src/src2.c"}}
V[17:39:37.603] <<< {"id":2,"jsonrpc":"2.0","result":null}
I[17:39:37.603] <-- reply(2)
V[17:39:37.608] <<< {"id":15,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full/delta","params":{"previousResultId":"1","textDocument":{"uri":"file:///tmp/src/src1.c"}}}
I[17:39:37.608] <-- textDocument/semanticTokens/full/delta(15)
V[17:39:37.608] ASTWorker running SemanticHighlights on version 1 of /tmp/src/src1.c
I[17:39:37.608] --> reply:textDocument/semanticTokens/full/delta(15) 0 ms
V[17:39:37.608] >>> {"id":15,"jsonrpc":"2.0","result":{"edits":[],"resultId":"2"}}
I[17:39:37.608] --> textDocument/clangd.fileStatus
V[17:39:37.608] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///tmp/src/src1.c"}}
V[17:39:37.659] indexed file AST for /tmp/src/src2.c version 1:
symbol slab: 1 symbols, 4448 bytes
ref slab: 1 symbols, 1 refs, 4248 bytes
relations slab: 0 relations, 24 bytes
V[17:39:37.659] Build dynamic index for main-file symbols with estimated memory usage of 20536 bytes
I[17:39:37.659] --> textDocument/publishDiagnostics
V[17:39:37.659] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[],"uri":"file:///tmp/src/src2.c","version":1}}
V[17:39:37.659] ASTWorker running EnumerateTweaks on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:textDocument/codeAction(9) 94 ms
V[17:39:37.659] >>> {"id":9,"jsonrpc":"2.0","result":[]}
V[17:39:37.659] ASTWorker running DocumentSymbols on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:textDocument/documentSymbol(10) 94 ms
V[17:39:37.659] >>> {"id":10,"jsonrpc":"2.0","result":[{"detail":"void (void)","kind":12,"name":"func2","range":{"end":{"character":20,"line":1},"start":{"character":0,"line":1}},"selectionRange":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}}}]}
V[17:39:37.659] ASTWorker running SemanticHighlights on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:textDocument/semanticTokens/full(11) 94 ms
V[17:39:37.659] >>> {"id":11,"jsonrpc":"2.0","result":{"data":[1,5,5,3,8193],"resultId":"1"}}
V[17:39:37.659] ASTWorker running DocumentLinks on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:textDocument/documentLink(12) 94 ms
V[17:39:37.659] >>> {"id":12,"jsonrpc":"2.0","result":[{"range":{"end":{"character":17,"line":0},"start":{"character":9,"line":0}},"target":"file:///tmp/src/src2.h"}]}
V[17:39:37.659] ASTWorker running InlayHints on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:clangd/inlayHints(13) 94 ms
V[17:39:37.659] >>> {"id":13,"jsonrpc":"2.0","result":[]}
V[17:39:37.659] ASTWorker running Highlights on version 1 of /tmp/src/src2.c
I[17:39:37.659] --> reply:textDocument/documentHighlight(14) 94 ms
V[17:39:37.659] >>> {"id":14,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":10,"line":1},"start":{"character":5,"line":1}}}]}
I[17:39:37.659] --> textDocument/clangd.fileStatus
V[17:39:37.659] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///tmp/src/src2.c"}}
V[17:39:37.788] <<< {"id":16,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[]},"range":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"textDocument":{"uri":"file:///tmp/src/src2.c"}}}
I[17:39:37.788] <-- textDocument/codeAction(16)
V[17:39:37.788] ASTWorker running EnumerateTweaks on version 1 of /tmp/src/src2.c
I[17:39:37.788] --> reply:textDocument/codeAction(16) 0 ms
V[17:39:37.788] >>> {"id":16,"jsonrpc":"2.0","result":[{"command":{"arguments":[{"file":"file:///tmp/src/src2.c","selection":{"end":{"character":5,"line":1},"start":{"character":5,"line":1}},"tweakID":"DefineInline"}],"command":"clangd.applyTweak","title":"Move function body to declaration"},"kind":"refactor","title":"Move function body to declaration"}]}
I[17:39:37.788] --> textDocument/clangd.fileStatus
V[17:39:37.788] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///tmp/src/src2.c"}}
Looks like indexing completed OK before the request. My guess is this is yet another case-sensitivity issue somewhere...
No, there's something else going on (too?).
// src.h
extern void foo(void);
extern int bar;
// src.c
void foo(void) {}
int bar;
No compilation database, open up both files so only the dynamic index is involved, on any platform:
- go-to-definition on
barinsrc.hworks - go-to-definition or
fooinsrc.hdoes not work workspace/documentSymbolsreports two symbols namedfooand one namedbar
I think something's gone wrong with our symbol ID generation.
void foo(void) {} gets a different SymbolID when parsed in C mode vs in C++ mode.
In C++ the USR is c:@F@foo# and in C it is c:@F@foo.
c: is common to all USRs, @F@ means function, foo is the name. #s are added around parameters... but only in C++. Hmm.
I'm not exactly certain how that connects to the windows-specific symptoms yet. It seems plausible it's related though, e.g. flags not being applied correctly because of case or slash mismatch between the CDB and the opened files. (I don't see that in the logs, but could be something else along those lines)
#sare added around parameters... but only in C++. Hmm.
Presumably because it's only in C++ that you can have multiple distinct functions with the same name that need to be distinguished by their parameter lists.
I feel like I've run into this USR gotcha before, but I can't find the issue at the moment.
// src.h extern void foo(void); extern int bar;// src.c void foo(void) {} int bar;No compilation database, open up both files so only the dynamic index is involved, on any platform:
Does src.h get parsed in C++ mode by default?
Yeah, the problem is:
- we need the same USR for every redecl
- in C any of the redecls can be
void foo()with no prototype given, therefore the USR must not contain arg info - but in C++ different args mean different functions, so the USR must contain arg info
@ilya-biryukov had a tricky idea about this:
void foo()usually meansvoid foo(void)- a forward declaration is usually visible to all redecls (usually there's just the forward decl + definition)
Therefore: we could include the args in C for compatibility with C++ USRs, but always use the first redecl. So if you have
void foo(); void foo(int) {}then both get mangled the same as a C++ functionvoid foo(). We only end up getting the wrong equivalence classes for USRs if both a prototypeless function decl refers to a function with args and the decl isn't visible to he definition.
Does src.h get parsed in C++ mode by default?
Yes, if there's no CDB the fallback flag is -xobjective-c++. But that doesn't seem to be the case in the original report (per logs), so maybe I'm barking up the wrong tree.
HI, Is there any fix or workaround for this issue..? Sorry, I couldn't spot it if it was already mentioned in the thread.!. I am also facing the same issue on clangd 1.23 version
Is there any fix or workaround for this issue..? Sorry, I couldn't spot it if it was already mentioned in the thread.!. I am also facing the same issue on clangd 1.23 version
If the issue that Sam discovered is indeed what the original reporter was running into, then I think a workaround could be to instruct clangd to parse .h files in C mode by adding something like this to .clangd:
If:
PathMatch: .*\*.h
CompileFlags:
Add: [-xc]
But please note that the symptom "jumping to definition jumps to a header file instead of a source file" could have other, more common, causes as well (e.g. the project does not have a compile_commands.json file, or clangd is not finding the compile_commands.json, or the source file containing the definition is not listed in the compile_commands.json). If in doubt, please feel free to file a new issue and attach logs.