-
Notifications
You must be signed in to change notification settings - Fork 152
Description
I'm working on a project that uses C++20 modules and everything was going smoothly until I started getting undefined identifier errors for symbols defined in imported modules. I tried clearing .cache/ and build/ and re-configuring and building, and also stripped out almost everything from the project until it was just a main file and a simple module exporting one function and was still getting these errors. But after copying the code over to another directory and reconfiguring and building the project, clangd was able to pick up all modules just fine. Additionally, the errors went away after disabling and then re-enabling the clangd extension. Is there some state that clangd stores outside of the source directory that could be causing issues?
src/main.cpp:
import mod;
auto main() -> int
{
foo();
}src/foo.cppm:
export module mod;
export auto foo() -> void
{
}CMakeLists.txt:
cmake_minimum_required(VERSION 4.2 FATAL_ERROR)
set(CMAKE_COLOR_DIAGNOSTICS ON)
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_SCAN_FOR_MODULES ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
project(example
LANGUAGES CXX
)
add_library(mod)
target_sources(mod
PUBLIC FILE_SET CXX_MODULES FILES
src/mod.cppm
)
add_executable(main)
target_sources(main
PUBLIC
src/main.cpp
)
target_link_libraries(main
PRIVATE
mod
)Commands:
cmake -B build/ -S . -G "Ninja Multi-Config" -DCMAKE_CXX_COMPILER=clang++-21
cmake --build build/Logs
Please attach the clangd log from the "Output" window if you can.
If possible, run with --log=verbose - note that the logs will include the contents of open files!
Logs
V[15:59:33.486] <<< {"id":14,"jsonrpc":"2.0","method":"shutdown"}
I[15:59:33.486] <-- shutdown(14)
I[15:59:33.486] --> reply:shutdown(14) 0 ms
V[15:59:33.486] >>> {"id":14,"jsonrpc":"2.0","result":null}
V[15:59:33.548] <<< {"jsonrpc":"2.0","method":"exit"}
I[15:59:33.549] <-- exit
I[15:59:33.549] LSP finished, exiting with status 0
I[15:59:33.555] clangd version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28)
I[15:59:33.555] Features: linux+grpc
I[15:59:33.555] PID: 41281
I[15:59:33.555] Working directory: /u4/rydong/cs444/cs-444-compiler
I[15:59:33.555] argv[0]: /u4/rydong/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/21.1.8/clangd_21.1.8/bin/clangd
I[15:59:33.555] argv[1]: --experimental-modules-support
I[15:59:33.555] argv[2]: --log=verbose
V[15:59:33.555] User config file is /u4/rydong/.config/clangd/config.yaml
I[15:59:33.555] Starting LSP over stdin/stdout
V[15:59:33.556] <<< {"id":0,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"markdown":{"parser":"marked","version":"1.1.0"},"positionEncodings":["utf-16"],"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"staleRequestSupport":{"cancel":true,"retryOnContentModified":["textDocument/semanticTokens/full","textDocument/semanticTokens/range","textDocument/semanticTokens/full/delta"]}},"notebookDocument":{"synchronization":{"dynamicRegistration":true,"executionSummarySupport":true}},"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":true,"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]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode","data"]},"contextSupport":true,"dynamicRegistration":true,"editsNearCursor":true,"insertTextMode":2},"declaration":{"dynamicRegistration":true,"linkSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"diagnostic":{"dynamicRegistration":true,"relatedDocumentSupport":false},"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,"foldingRange":{"collapsedText":false},"foldingRangeKind":{"valueSet":["comment","imports","region"]},"lineFoldingOnly":true,"rangeLimit":5000},"formatting":{"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"inactiveRegionsCapabilities":{"inactiveRegions":true},"inlayHint":{"dynamicRegistration":true,"resolveSupport":{"properties":["tooltip","textEdits","label.tooltip","label.location","label.command"]}},"inlineValue":{"dynamicRegistration":true},"linkedEditingRange":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"dataSupport":true,"relatedInformation":true,"tagSupport":{"valueSet":[1,2]},"versionSupport":false},"rangeFormatting":{"dynamicRegistration":true,"rangesSupport":true},"references":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"honorsChangeAnnotations":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1},"selectionRange":{"dynamicRegistration":true},"semanticTokens":{"augmentsSyntaxTokens":true,"dynamicRegistration":true,"formats":["relative"],"multilineTokenSupport":false,"overlappingTokenSupport":false,"requests":{"full":{"delta":true},"range":true},"serverCancelSupport":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","decorator"]},"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},"typeHierarchy":{"dynamicRegistration":true}},"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true},"workspace":{"applyEdit":true,"codeLens":{"refreshSupport":true},"configuration":true,"diagnostics":{"refreshSupport":true},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":true},"executeCommand":{"dynamicRegistration":true},"fileOperations":{"didCreate":true,"didDelete":true,"didRename":true,"dynamicRegistration":true,"willCreate":true,"willDelete":true,"willRename":true},"foldingRange":{"refreshSupport":true},"inlayHint":{"refreshSupport":true},"inlineValue":{"refreshSupport":true},"semanticTokens":{"refreshSupport":true},"symbol":{"dynamicRegistration":true,"resolveSupport":{"properties":["location.range"]},"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.108.2"},"initializationOptions":{"clangdFileStatus":true,"fallbackFlags":[]},"locale":"en","processId":36295,"rootPath":"/u4/rydong/cs444/cs-444-compiler","rootUri":"file:///u4/rydong/cs444/cs-444-compiler","trace":"off","workspaceFolders":[{"name":"cs-444-compiler","uri":"file:///u4/rydong/cs444/cs-444-compiler"}]}}
I[15:59:33.556] <-- initialize(0)
I[15:59:33.569] --> reply:initialize(0) 12 ms
V[15:59:33.569] >>> {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":true,"clangdInlayHintsProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","refactor","info"]},"compilationDatabase":{"automaticReload":true},"completionProvider":{"resolveProvider":false,"triggerCharacters":[".","<",">",":","\"","/","*"]},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"documentHighlightProvider":true,"documentLinkProvider":{"resolveProvider":false},"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"\n","moreTriggerCharacter":[]},"documentRangeFormattingProvider":{"rangesSupport":true},"documentSymbolProvider":true,"executeCommandProvider":{"commands":["clangd.applyFix","clangd.applyRename","clangd.applyTweak"]},"foldingRangeProvider":true,"hoverProvider":true,"implementationProvider":true,"inactiveRegionsProvider":true,"inlayHintProvider":true,"memoryUsageProvider":true,"positionEncoding":"utf-16","referencesProvider":true,"renameProvider":{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProvider":{"full":{"delta":true},"legend":{"tokenModifiers":["declaration","definition","deprecated","deduced","readonly","static","abstract","virtual","dependentName","defaultLibrary","usedAsMutableReference","usedAsMutablePointer","constructorOrDestructor","userDefined","functionScope","classScope","fileScope","globalScope"],"tokenTypes":["variable","variable","parameter","function","method","function","property","variable","class","interface","enum","enumMember","type","type","unknown","namespace","typeParameter","concept","type","macro","modifier","operator","bracket","label","comment"]},"range":false},"signatureHelpProvider":{"triggerCharacters":["(",")","{","}","<",">",","]},"standardTypeHierarchyProvider":true,"textDocumentSync":{"change":2,"openClose":true,"save":true},"typeDefinitionProvider":true,"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"offsetEncoding":"utf-16","serverInfo":{"name":"clangd","version":"clangd version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28) linux+grpc x86_64-unknown-linux-gnu"}}}
V[15:59:33.571] <<< {"jsonrpc":"2.0","method":"initialized","params":{}}
I[15:59:33.571] <-- initialized
V[15:59:33.573] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"cpp","text":"import mod;\n\nauto main() -> int\n{\n foo();\n}\n","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp","version":374}}}
I[15:59:33.573] <-- textDocument/didOpen
I[15:59:33.576] Loaded compilation database from /u4/rydong/cs444/cs-444-compiler/build/compile_commands.json
V[15:59:33.576] Broadcasting compilation database from /u4/rydong/cs444/cs-444-compiler
I[15:59:33.577] --> window/workDoneProgress/create(0)
V[15:59:33.577] >>> {"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}}
I[15:59:33.577] Enqueueing 2 commands for indexing
V[15:59:33.577] <<< {"id":0,"jsonrpc":"2.0","result":null}
I[15:59:33.577] <-- reply(0)
I[15:59:33.577] --> $/progress
I[15:59:33.577] ASTWorker building file /u4/rydong/cs444/cs-444-compiler/src/main.cpp version 374 with command
[/u4/rydong/cs444/cs-444-compiler/build]
/usr/lib/llvm-21/bin/clang++-21 --driver-mode=g++ "-DCMAKE_INTDIR=\"Debug\"" -g -std=c++26 -fcolor-diagnostics -gmodules -fmodule-file=mod=CMakeFiles/mod.dir/Debug/mod.pcm -o CMakeFiles/main.dir/Debug/src/main.cpp.o -c -resource-dir=/u4/rydong/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/21.1.8/clangd_21.1.8/lib/clang/21 -- /u4/rydong/cs444/cs-444-compiler/src/main.cpp
V[15:59:33.577] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}}
I[15:59:33.577] --> $/progress
V[15:59:33.577] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}
V[15:59:33.578] BackgroundIndex: building version 1 after loading index from disk
V[15:59:33.578] BackgroundIndex: serving version 1 (13140 bytes)
I[15:59:33.579] --> $/progress
V[15:59:33.579] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"0/1","percentage":0}}}
I[15:59:33.579] --> $/progress
V[15:59:33.579] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
V[15:59:33.580] Ignored diagnostic. argument unused during compilation: '-c'
V[15:59:33.582] Driver produced command: cc1 -cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -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 -dwarf-ext-refs -fmodule-format=obj -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fdebug-compilation-dir=/u4/rydong/cs444/cs-444-compiler/build -fcoverage-compilation-dir=/u4/rydong/cs444/cs-444-compiler/build -resource-dir /u4/rydong/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/21.1.8/clangd_21.1.8/lib/clang/21 -D "CMAKE_INTDIR=\"Debug\"" -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/backward -internal-isystem /u4/rydong/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/21.1.8/clangd_21.1.8/lib/clang/21/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++26 -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fmodule-file=mod=CMakeFiles/mod.dir/Debug/mod.pcm -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -no-round-trip-args -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:33.582] --> textDocument/clangd.fileStatus
V[15:59:33.582] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:33.582] Building first preamble for /u4/rydong/cs444/cs-444-compiler/src/main.cpp version 374
[Error - 3:59:33 PM] Server process exited with code 0.
I[15:59:33.597] Built preamble of size 253732 for file /u4/rydong/cs444/cs-444-compiler/src/main.cpp version 374 in 0.01 seconds
V[15:59:33.620] Ignored diagnostic. argument unused during compilation: '-c'
V[15:59:33.626] Ignored diagnostic. unable to open output file '/tmp/clangd/module_files/mod.cppm17647138007654665420-40-7b-fb-88-73-34/mod.pcm': 'Permission denied'
V[15:59:33.626] Failed to compile /u4/rydong/cs444/cs-444-compiler/src/mod.cppm with command: /usr/lib/llvm-21/bin/clang++-21 --driver-mode=g++ -DCMAKE_INTDIR="Debug" -g -std=c++26 -fcolor-diagnostics -gmodules -x c++-module -fmodule-output=CMakeFiles/mod.dir/Debug/mod.pcm -o CMakeFiles/mod.dir/Debug/src/mod.cppm.o -c -resource-dir=/u4/rydong/.vscode-server/data/User/globalStorage/llvm-vs-code-extensions.vscode-clangd/install/21.1.8/clangd_21.1.8/lib/clang/21 -- /u4/rydong/cs444/cs-444-compiler/src/mod.cppm.
E[15:59:33.626] Failed to build module mod; due to Failed to compile /u4/rydong/cs444/cs-444-compiler/src/mod.cppm. Use '--log=verbose' to view detailed failure reasons.
I[15:59:33.626] Built prerequisite modules for file /u4/rydong/cs444/cs-444-compiler/src/main.cpp in 0.03 seconds
I[15:59:33.627] --> workspace/semanticTokens/refresh(1)
V[15:59:33.627] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null}
V[15:59:33.627] indexed preamble AST for /u4/rydong/cs444/cs-444-compiler/src/main.cpp version 374:
symbol slab: 0 symbols, 120 bytes
ref slab: 0 symbols, 0 refs, 128 bytes
relations slab: 0 relations, 24 bytes
V[15:59:33.627] <<< {"id":1,"jsonrpc":"2.0","result":null}
I[15:59:33.627] <-- reply(1)
I[15:59:33.630] Indexing c++23 standard library in the context of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
V[15:59:33.644] Trying to fix unresolved name "foo" in scopes: []
V[15:59:33.645] Dex query tree: false
V[15:59:33.647] indexed file AST for /u4/rydong/cs444/cs-444-compiler/src/main.cpp version 374:
symbol slab: 1 symbols, 4448 bytes
ref slab: 1 symbols, 1 refs, 4248 bytes
relations slab: 0 relations, 24 bytes
V[15:59:33.647] Build dynamic index for main-file symbols with estimated memory usage of 11520 bytes
I[15:59:33.647] --> textDocument/publishDiagnostics
V[15:59:33.647] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"ast_file_different_branch","message":"Module file 'CMakeFiles/mod.dir/Debug/mod.pcm' built from a different branch ((++20251221032922+2078da43e25a-1~exp1~20251221153059.70)) than the compiler ((https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28))","range":{"end":{"character":6,"line":0},"start":{"character":0,"line":0}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"undeclared_var_use","message":"Use of undeclared identifier 'foo'","range":{"end":{"character":7,"line":4},"start":{"character":4,"line":4}},"relatedInformation":[],"severity":1,"source":"clang"}],"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp","version":374}}
I[15:59:33.647] --> textDocument/inactiveRegions
V[15:59:33.647] >>> {"jsonrpc":"2.0","method":"textDocument/inactiveRegions","params":{"regions":[],"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:33.648] --> textDocument/clangd.fileStatus
V[15:59:33.648] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:35.091] Ignored diagnostic. /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/backward/backward_warning.h:32:2:This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
V[15:59:35.650] indexed preamble AST for /u4/rydong/cs444/cs-444-compiler/src/main.cpp version :
symbol slab: 29695 symbols, 9330576 bytes
ref slab: 0 symbols, 0 refs, 128 bytes
relations slab: 710 relations, 17432 bytes
I[15:59:35.689] Indexed c++23 standard library: 17387 symbols, 12308 filtered
V[15:59:35.726] Build dynamic index for header symbols with estimated memory usage of 10226076 bytes
V[15:59:41.786] <<< {"id":1,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"ast_file_different_branch","message":"Module file 'CMakeFiles/mod.dir/Debug/mod.pcm' built from a different branch ((++20251221032922+2078da43e25a-1~exp1~20251221153059.70)) than the compiler ((https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28))","range":{"end":{"character":6,"line":0},"start":{"character":0,"line":0}},"relatedInformation":[],"severity":1,"source":"clang"}],"triggerKind":2},"range":{"end":{"character":0,"line":0},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.786] <-- textDocument/codeAction(1)
V[15:59:41.786] <<< {"id":2,"jsonrpc":"2.0","method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.786] <-- textDocument/documentSymbol(2)
V[15:59:41.786] ASTWorker running codeAction on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.787] --> reply:textDocument/codeAction(1) 0 ms
V[15:59:41.787] >>> {"id":1,"jsonrpc":"2.0","result":[]}
V[15:59:41.787] ASTWorker running DocumentSymbols on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.787] --> reply:textDocument/documentSymbol(2) 0 ms
V[15:59:41.787] >>> {"id":2,"jsonrpc":"2.0","result":[{"detail":"auto () -> int","kind":12,"name":"main","range":{"end":{"character":1,"line":5},"start":{"character":0,"line":2}},"selectionRange":{"end":{"character":9,"line":2},"start":{"character":5,"line":2}}}]}
I[15:59:41.787] --> textDocument/clangd.fileStatus
V[15:59:41.787] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:41.793] <<< {"id":3,"jsonrpc":"2.0","method":"textDocument/inlayHint","params":{"range":{"end":{"character":0,"line":6},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.793] <-- textDocument/inlayHint(3)
V[15:59:41.793] <<< {"id":4,"jsonrpc":"2.0","method":"textDocument/documentLink","params":{"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.793] <-- textDocument/documentLink(4)
V[15:59:41.793] ASTWorker running InlayHints on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.793] --> reply:textDocument/inlayHint(3) 0 ms
V[15:59:41.793] >>> {"id":3,"jsonrpc":"2.0","result":[]}
V[15:59:41.793] ASTWorker running DocumentLinks on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.793] --> reply:textDocument/documentLink(4) 0 ms
V[15:59:41.793] >>> {"id":4,"jsonrpc":"2.0","result":[]}
I[15:59:41.793] --> textDocument/clangd.fileStatus
V[15:59:41.793] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:41.877] <<< {"id":5,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":6,"line":4},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.877] <-- textDocument/documentHighlight(5)
V[15:59:41.877] ASTWorker running Highlights on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.878] --> reply:textDocument/documentHighlight(5) 0 ms
V[15:59:41.878] >>> {"id":5,"jsonrpc":"2.0","result":[]}
I[15:59:41.878] --> textDocument/clangd.fileStatus
V[15:59:41.878] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:41.925] <<< {"id":6,"jsonrpc":"2.0","method":"textDocument/inlayHint","params":{"range":{"end":{"character":0,"line":6},"start":{"character":0,"line":0}},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.925] <-- textDocument/inlayHint(6)
V[15:59:41.925] ASTWorker running InlayHints on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:41.925] --> reply:textDocument/inlayHint(6) 0 ms
V[15:59:41.925] >>> {"id":6,"jsonrpc":"2.0","result":[]}
I[15:59:41.925] --> textDocument/clangd.fileStatus
V[15:59:41.925] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:41.974] <<< {"id":7,"jsonrpc":"2.0","method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:41.974] <-- textDocument/foldingRange(7)
I[15:59:41.975] --> reply:textDocument/foldingRange(7) 0 ms
V[15:59:41.975] >>> {"id":7,"jsonrpc":"2.0","result":[{"endLine":4,"kind":"region","startCharacter":1,"startLine":3}]}
V[15:59:42.009] <<< {"id":8,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"undeclared_var_use","message":"Use of undeclared identifier 'foo'","range":{"end":{"character":7,"line":4},"start":{"character":4,"line":4}},"relatedInformation":[],"severity":1,"source":"clang"}],"triggerKind":2},"range":{"end":{"character":6,"line":4},"start":{"character":6,"line":4}},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:42.009] <-- textDocument/codeAction(8)
V[15:59:42.009] ASTWorker running codeAction on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:42.010] --> reply:textDocument/codeAction(8) 0 ms
V[15:59:42.010] >>> {"id":8,"jsonrpc":"2.0","result":[]}
I[15:59:42.010] --> textDocument/clangd.fileStatus
V[15:59:42.010] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
V[15:59:42.079] <<< {"id":9,"jsonrpc":"2.0","method":"textDocument/semanticTokens/full","params":{"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:42.079] <-- textDocument/semanticTokens/full(9)
V[15:59:42.079] <<< {"id":10,"jsonrpc":"2.0","method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:42.079] <-- textDocument/foldingRange(10)
V[15:59:42.079] ASTWorker running SemanticHighlights on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:42.080] --> reply:textDocument/semanticTokens/full(9) 0 ms
V[15:59:42.080] >>> {"id":9,"jsonrpc":"2.0","result":{"data":[2,5,4,3,131075,2,4,3,14,256],"resultId":"1"}}
I[15:59:42.080] --> textDocument/clangd.fileStatus
V[15:59:42.080] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
I[15:59:42.080] --> reply:textDocument/foldingRange(10) 0 ms
V[15:59:42.080] >>> {"id":10,"jsonrpc":"2.0","result":[{"endLine":4,"kind":"region","startCharacter":1,"startLine":3}]}
V[15:59:42.414] <<< {"id":11,"jsonrpc":"2.0","method":"textDocument/hover","params":{"position":{"character":10,"line":4},"textDocument":{"uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}}
I[15:59:42.414] <-- textDocument/hover(11)
V[15:59:42.414] ASTWorker running Hover on version 374 of /u4/rydong/cs444/cs-444-compiler/src/main.cpp
I[15:59:42.414] --> reply:textDocument/hover(11) 0 ms
V[15:59:42.414] >>> {"id":11,"jsonrpc":"2.0","result":null}
I[15:59:42.414] --> textDocument/clangd.fileStatus
V[15:59:42.414] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///u4/rydong/cs444/cs-444-compiler/src/main.cpp"}}
System information
Clangd version (from the log, or clangd --version): bundled with extension: clangd version 21.1.8 (https://github.com/llvm/llvm-project 2078da43e25a4623cab2d0d60decddf709aaea28)
clangd extension version: 0.4.0
Operating system: Ubuntu 24.04.3