clangd / vscode-clangd

Visual Studio Code extension for clangd
https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd
MIT License
625 stars 102 forks source link

Default value for option -std for c and c++ #684

Open lijh8 opened 1 week ago

lijh8 commented 1 week ago

Clangd version: Apple clangd version 14.0.0 (clang-1400.0.29.202); clangd extension version: v0.1.29; Operating system: macOS 12.7.6;

I happen to encounter this problem. Both the compile_commands.json and compile_flags.txt examples do not include the option -std=, failing to have this option in these two files results in the -I/path/to/header to be ignored. This also causes problem in .clangd and the clangd.fallbackFlags of vscode settings.json.

But the option -std do have default value, so we do not have to specify this in our Makefiles.

compile_commands.json without `-std` { "directory": "/Users/ljh/Documents/lijh8.github/Asio/src/main/", "arguments": [ "/usr/bin/clang++", "-DSOMEDEF=With spaces, quotes and \\-es.", "-I/Users/ljh/Downloads/asio-1.30.2/include", "-c", "-o", "server.o", "server.cpp" ], "file": "server.cpp" },
log without `-std` I[01:24:58.297] Apple clangd version 14.0.0 (clang-1400.0.29.202) I[01:24:58.298] Features: mac+xpc I[01:24:58.298] PID: 4670 I[01:24:58.299] Working directory: /Users/ljh/Documents/lijh8.github/Asio I[01:24:58.299] argv[0]: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clangd I[01:24:58.299] argv[1]: --background-index I[01:24:58.299] argv[2]: --header-insertion=never I[01:24:58.300] argv[3]: --log=verbose V[01:24:58.300] User config file is /Users/ljh/Library/Preferences/clangd/config.yaml I[01:24:58.300] Starting LSP over stdin/stdout V[01:24:58.300] <<< {"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":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]},"completionList":{"itemDefaults":["commitCharacters","editRange","insertTextFormat","insertTextMode"]},"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},"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},"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.93.1"},"initializationOptions":{"clangdFileStatus":true,"fallbackFlags":["-std=c++2a","-DGLOG_USE_GLOG_EXPORT","-I../foo","-I/Users/ljh/Documents/lijh8.github/Asio/src/foo","-I/Users/ljh/Downloads/asio-1.30.2/include","-I/home/ljh/Downloads/glog/src","-I/home/ljh/Downloads/glog/build"]},"locale":"en-us","processId":4647,"rootPath":"/Users/ljh/Documents/lijh8.github/Asio","rootUri":"file:///Users/ljh/Documents/lijh8.github/Asio","trace":"off","workspaceFolders":[{"name":"Asio","uri":"file:///Users/ljh/Documents/lijh8.github/Asio"}]}} I[01:24:58.300] <-- initialize(0) V[01:24:58.301] Invoking /usr/bin/xcrun to find clang installation I[01:24:58.315] --> reply:initialize(0) 15 ms V[01:24:58.315] >>> {"id":0,"jsonrpc":"2.0","result":{"capabilities":{"astProvider":true,"callHierarchyProvider":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},"typeHierarchyProvider":true,"workspaceSymbolProvider":true},"serverInfo":{"name":"clangd","version":"Apple clangd version 14.0.0 (clang-1400.0.29.202) mac+xpc x86_64-apple-darwin21.6.0"}}} V[01:24:58.317] <<< {"jsonrpc":"2.0","method":"initialized","params":{}} I[01:24:58.317] <-- initialized V[01:24:58.323] <<< {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"cpp","text":"\n// https://github.com/chriskohlhoff/asio/blob/master/asio/src/examples/cpp11/echo/async_tcp_echo_server.cpp\n\n#include \n#include \n\n#ifndef NDEBUG\n#include \n#endif\n\nstruct session : public std::enable_shared_from_this {\n session(asio::ip::tcp::socket socket) : socket(std::move(socket)) {}\n\n void start() {\n start_read();\n start_write();\n }\n\n void start_read() {\n auto self(shared_from_this());\n memset(input_data, 0, sizeof(input_data));\n asio::async_read(socket, asio::buffer(input_data, sizeof(input_data)),\n [this, self](std::error_code ec, std::size_t length) {\n if (!ec) {\n std::cout << input_data;\n start_read(); // continuous read test with recursion\n } else {\n std::cout << ec.message() << \"\\n\"; // error\n }\n });\n }\n\n void start_write() {\n auto self(shared_from_this());\n memset(output_data, 0, sizeof(output_data));\n snprintf(output_data, sizeof(output_data) - 1, \"hello client %zu\\n\", cnt++);\n asio::async_write(socket, asio::buffer(output_data, sizeof(output_data)),\n [this, self](std::error_code ec, std::size_t length) {\n if (!ec) {\n start_write(); // continuous write test with recursion\n } else {\n std::cout << ec.message() << \"\\n\"; // error\n }\n });\n }\n\n asio::ip::tcp::socket socket;\n enum { LEN = 1024 };\n char input_data[LEN];\n char output_data[LEN];\n size_t cnt = 0;\n};\n\nstruct server {\n server(asio::io_context &io_context, short port)\n : acceptor(io_context,\n asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port)) {\n std::cout << \"Listen on port: \" << port << \" \\n\";\n do_accept();\n }\n\n void do_accept() {\n acceptor.async_accept([this](std::error_code ec,\n asio::ip::tcp::socket socket) {\n if (!ec) {\n std::cout << \"Accept connection: \" << socket.remote_endpoint() << \"\\n\";\n std::make_shared(std::move(socket))->start();\n } else {\n std::cout << ec.message() << \"\\n\";\n }\n do_accept();\n });\n }\n\n asio::ip::tcp::acceptor acceptor;\n};\n\nvoid handlerCont(int signum) {\n printf(\"SIGCONT %d\\n\", signum);\n#ifndef NDEBUG\n __lsan_do_recoverable_leak_check();\n#endif\n}\n\nint main(int argc, char *argv[]) {\n if (argc != 2) {\n std::cerr << \"Usage: server \\n\";\n return 1;\n }\n\n signal(SIGCONT, handlerCont); // kill -CONT 123 # pid\n\n asio::io_context io_context;\n server s(io_context, std::atoi(argv[1]));\n io_context.run();\n\n return 0;\n}\n","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp","version":1}}} I[01:24:58.325] <-- textDocument/didOpen I[01:24:58.328] Loaded compilation database from /Users/ljh/Documents/lijh8.github/Asio/compile_commands.json V[01:24:58.328] Broadcasting compilation database from /Users/ljh/Documents/lijh8.github/Asio I[01:24:58.328] ASTWorker building file /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp version 1 with command [/Users/ljh/Documents/lijh8.github/Asio/src/main/] /usr/bin/clang++ --driver-mode=g++ "-DSOMEDEF=With spaces, quotes and \\-es." -I/Users/ljh/Downloads/asio-1.30.2/include -c -o server.o -resource-dir=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -- /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp I[01:24:58.328] --> window/workDoneProgress/create(0) V[01:24:58.328] >>> {"id":0,"jsonrpc":"2.0","method":"window/workDoneProgress/create","params":{"token":"backgroundIndexProgress"}} I[01:24:58.328] Enqueueing 2 commands for indexing V[01:24:58.329] Failed to load shard: /Users/ljh/Documents/lijh8.github/Asio/src/main/client.cpp V[01:24:58.329] Failed to load shard: /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp V[01:24:58.329] <<< {"id":0,"jsonrpc":"2.0","result":null} I[01:24:58.329] <-- reply(0) I[01:24:58.329] --> $/progress V[01:24:58.329] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"begin","percentage":0,"title":"indexing"}}} I[01:24:58.329] --> $/progress V[01:24:58.329] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"1/3","percentage":33}}} V[01:24:58.330] Driver produced command: cc1 -cc1 -triple x86_64-apple-macosx12.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name server.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fno-strict-return -fno-rounding-math -funwind-tables=2 -target-sdk-version=13.1 -fvisibility-inlines-hidden-static-local-var -target-cpu penryn -tune-cpu generic -debugger-tuning=lldb -target-linker-version 820.1 -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -D "SOMEDEF=With spaces, quotes and \\-es." -I /Users/ljh/Downloads/asio-1.30.2/include -I/usr/local/include -stdlib=libc++ -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -Wno-cast-function-type -Wno-bitwise-instead-of-logical -fdeprecated-macro -fdebug-compilation-dir=/Users/ljh/Documents/lijh8.github/Asio/src/main/ -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+messageToSelfInClassMethodIdReturnType -clang-vendor-feature=+disableInferNewAvailabilityFromInit -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -mllvm -disable-aligned-alloc-awareness=1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c++ /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp I[01:24:58.330] --> textDocument/clangd.fileStatus V[01:24:58.330] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Update (1)","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} V[01:24:58.330] Building first preamble for /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp version 1 V[01:24:58.333] Indexing server.cpp (digest:=7437C66A667F8286) V[01:24:58.342] Indexing client.cpp (digest:=84801E6BB5B7990A) V[01:24:58.367] Ignored diagnostic. /Users/ljh/Downloads/asio-1.30.2/include/asio/detail/config.hpp:53:11:'boost/config.hpp' file not found V[01:25:00.533] indexed preamble AST for /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp version 1: symbol slab: 20431 symbols, 5923045 bytes ref slab: 0 symbols, 0 refs, 128 bytes relations slab: 524 relations, 17432 bytes V[01:25:01.027] Build dynamic index for header symbols with estimated memory usage of 14478951 bytes V[01:25:01.091] Built preamble of size 7802412 for file /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp version 1 I[01:25:01.107] --> workspace/semanticTokens/refresh(1) V[01:25:01.107] >>> {"id":1,"jsonrpc":"2.0","method":"workspace/semanticTokens/refresh","params":null} I[01:25:01.107] --> textDocument/clangd.fileStatus V[01:25:01.108] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, running Build AST for (1)","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} I[01:25:01.109] --> textDocument/clangd.fileStatus V[01:25:01.109] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"parsing includes, parsing main file","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} V[01:25:01.108] <<< {"id":1,"jsonrpc":"2.0","result":null} I[01:25:01.114] <-- reply(1) V[01:25:01.188] Trying to fix unresolved name "buffer" in scopes: [asio::] V[01:25:01.189] Dex query tree: (LIMIT 10000 (& T=uff T=ffe S=asio:: T=buf T=fer ?=Restricted For Code Completion)) V[01:25:01.196] Trying to fix unresolved name "buffer" in scopes: [asio::] V[01:25:01.213] indexed file AST for /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp version 1: symbol slab: 16 symbols, 7928 bytes ref slab: 33 symbols, 55 refs, 5760 bytes relations slab: 1 relations, 41 bytes V[01:25:01.215] Build dynamic index for main-file symbols with estimated memory usage of 24280 bytes I[01:25:01.216] --> textDocument/publishDiagnostics V[01:25:01.219] >>> {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"code":"pp_file_not_found","message":"In included file: 'boost/config.hpp' file not found","range":{"end":{"character":10,"line":3},"start":{"character":9,"line":3}},"relatedInformation":[{"location":{"range":{"end":{"character":28,"line":52},"start":{"character":10,"line":52}},"uri":"file:///Users/ljh/Downloads/asio-1.30.2/include/asio/detail/config.hpp"},"message":"Error occurred here"}],"severity":1,"source":"clang"},{"code":"typename_nested_not_found","message":"No type named 'socket' in 'asio::ip::tcp'","range":{"end":{"character":31,"line":11},"start":{"character":25,"line":11}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"typename_nested_not_found","message":"No type named 'socket' in 'asio::ip::tcp'","range":{"end":{"character":23,"line":46},"start":{"character":17,"line":46}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"-Wc++11-extensions","message":"Default member initializer for non-static data member is a C++11 extension","range":{"end":{"character":14,"line":50},"start":{"character":13,"line":50}},"relatedInformation":[],"severity":2,"source":"clang"},{"code":"-Wc++11-extensions","message":"'auto' type specifier is a C++11 extension","range":{"end":{"character":8,"line":19},"start":{"character":4,"line":19}},"relatedInformation":[],"severity":2,"source":"clang"},{"code":"ovl_no_viable_member_function_in_call","message":"No matching member function for call to 'shared_from_this'","range":{"end":{"character":30,"line":19},"start":{"character":14,"line":19}},"relatedInformation":[{"location":{"range":{"end":{"character":36,"line":1690},"start":{"character":20,"line":1690}},"uri":"file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c%2B%2B/v1/__memory/shared_ptr.h"},"message":"Candidate function not viable: no known conversion from 'session' to 'std::enable_shared_from_this' for object argument"},{"location":{"range":{"end":{"character":42,"line":1693},"start":{"character":26,"line":1693}},"uri":"file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c%2B%2B/v1/__memory/shared_ptr.h"},"message":"Candidate function not viable: no known conversion from 'session' to 'const std::enable_shared_from_this' for object argument"}],"severity":1,"source":"clang"},{"code":"expected_expression","message":"Expected expression","range":{"end":{"character":22,"line":22},"start":{"character":21,"line":22}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"no_member","message":"No member named 'buffer' in namespace 'asio'","range":{"end":{"character":41,"line":21},"start":{"character":35,"line":21}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"-Wc++11-extensions","message":"'auto' type specifier is a C++11 extension","range":{"end":{"character":8,"line":33},"start":{"character":4,"line":33}},"relatedInformation":[],"severity":2,"source":"clang"},{"code":"ovl_no_viable_member_function_in_call","message":"No matching member function for call to 'shared_from_this'","range":{"end":{"character":30,"line":33},"start":{"character":14,"line":33}},"relatedInformation":[{"location":{"range":{"end":{"character":36,"line":1690},"start":{"character":20,"line":1690}},"uri":"file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c%2B%2B/v1/__memory/shared_ptr.h"},"message":"Candidate function not viable: no known conversion from 'session' to 'std::enable_shared_from_this' for object argument"},{"location":{"range":{"end":{"character":42,"line":1693},"start":{"character":26,"line":1693}},"uri":"file:///Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c%2B%2B/v1/__memory/shared_ptr.h"},"message":"Candidate function not viable: no known conversion from 'session' to 'const std::enable_shared_from_this' for object argument"}],"severity":1,"source":"clang"},{"code":"expected_expression","message":"Expected expression","range":{"end":{"character":23,"line":37},"start":{"character":22,"line":37}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"no_member","message":"No member named 'buffer' in namespace 'asio'","range":{"end":{"character":42,"line":36},"start":{"character":36,"line":36}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"ovl_no_viable_function_in_init","message":"No matching constructor for initialization of 'asio::ip::tcp::endpoint' (aka 'basic_endpoint')","range":{"end":{"character":21,"line":56},"start":{"character":17,"line":56}},"relatedInformation":[{"location":{"range":{"end":{"character":20,"line":48},"start":{"character":6,"line":48}},"uri":"file:///Users/ljh/Downloads/asio-1.30.2/include/asio/ip/basic_endpoint.hpp"},"message":"Candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided"},{"location":{"range":{"end":{"character":16,"line":63},"start":{"character":2,"line":63}},"uri":"file:///Users/ljh/Downloads/asio-1.30.2/include/asio/ip/basic_endpoint.hpp"},"message":"Candidate constructor not viable: requires 0 arguments, but 2 were provided"}],"severity":1,"source":"clang"},{"code":"excess_initializers","message":"Excess elements in scalar initializer","range":{"end":{"character":16,"line":55},"start":{"character":8,"line":55}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"typecheck_invalid_operands","message":"Invalid operands to binary expression ('std::ostream' (aka 'int') and 'const char[17]')","range":{"end":{"character":16,"line":57},"start":{"character":14,"line":57}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"typecheck_member_reference_struct_union","message":"Member reference base type 'asio::ip::tcp::acceptor' (aka 'int') is not a structure or union","range":{"end":{"character":13,"line":62},"start":{"character":12,"line":62}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"expected_expression","message":"Expected expression","range":{"end":{"character":27,"line":62},"start":{"character":26,"line":62}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"typecheck_invalid_operands","message":"Invalid operands to binary expression ('std::ostream' (aka 'int') and 'const char[22]')","range":{"end":{"character":16,"line":86},"start":{"character":14,"line":86}},"relatedInformation":[],"severity":1,"source":"clang"},{"code":"cppcoreguidelines-pro-type-member-init","message":"Constructor does not initialize these fields: socket, input_data, output_data (fix available)","range":{"end":{"character":9,"line":11},"start":{"character":2,"line":11}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-bounds-array-to-pointer-decay","message":"Do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead","range":{"end":{"character":21,"line":20},"start":{"character":11,"line":20}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-type-vararg","message":"Do not call c-style vararg functions","range":{"end":{"character":12,"line":35},"start":{"character":4,"line":35}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-bounds-array-to-pointer-decay","message":"Do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead","range":{"end":{"character":22,"line":34},"start":{"character":11,"line":34}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-bounds-array-to-pointer-decay","message":"Do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead","range":{"end":{"character":24,"line":35},"start":{"character":13,"line":35}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-type-vararg","message":"Do not call c-style vararg functions","range":{"end":{"character":8,"line":78},"start":{"character":2,"line":78}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-narrowing-conversions","message":"Narrowing conversion from 'int' to signed type 'short' is implementation-defined","range":{"end":{"character":26,"line":93},"start":{"character":23,"line":93}},"relatedInformation":[],"severity":2,"source":"clang-tidy"},{"code":"cppcoreguidelines-pro-bounds-pointer-arithmetic","message":"Do not use pointer arithmetic","range":{"end":{"character":37,"line":93},"start":{"character":33,"line":93}},"relatedInformation":[],"severity":2,"source":"clang-tidy"}],"uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp","version":1}} I[01:25:01.224] --> textDocument/clangd.fileStatus V[01:25:01.225] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} V[01:25:01.902] <<< {"id":1,"jsonrpc":"2.0","method":"textDocument/codeAction","params":{"context":{"diagnostics":[{"code":"pp_file_not_found","message":"In included file: 'boost/config.hpp' file not found","range":{"end":{"character":10,"line":3},"start":{"character":9,"line":3}},"relatedInformation":[{"location":{"range":{"end":{"character":28,"line":52},"start":{"character":10,"line":52}},"uri":"file:///Users/ljh/Downloads/asio-1.30.2/include/asio/detail/config.hpp"},"message":"Error occurred here"}],"severity":1,"source":"clang"}],"only":["quickfix"],"triggerKind":1},"range":{"end":{"character":10,"line":3},"start":{"character":9,"line":3}},"textDocument":{"uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}}} I[01:25:01.902] <-- textDocument/codeAction(1) V[01:25:01.924] ASTWorker running EnumerateTweaks on version 1 of /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp I[01:25:01.927] --> reply:textDocument/codeAction(1) 24 ms V[01:25:01.927] >>> {"id":1,"jsonrpc":"2.0","result":[]} I[01:25:01.927] --> textDocument/clangd.fileStatus V[01:25:01.927] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} I[01:25:03.820] Indexed server.cpp (15996 symbols, 105590 refs, 880 files) I[01:25:03.820] Failed to compile /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp, index may be incomplete V[01:25:05.421] <<< {"id":2,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":11,"line":15},"textDocument":{"uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}}} I[01:25:05.422] <-- textDocument/documentHighlight(2) V[01:25:05.422] ASTWorker running Highlights on version 1 of /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp I[01:25:05.423] --> reply:textDocument/documentHighlight(2) 1 ms V[01:25:05.424] >>> {"id":2,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":15,"line":15},"start":{"character":4,"line":15}}},{"kind":1,"range":{"end":{"character":18,"line":32},"start":{"character":7,"line":32}}}]} I[01:25:05.425] --> textDocument/clangd.fileStatus V[01:25:05.427] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} I[01:25:05.607] --> $/progress V[01:25:05.607] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"report","message":"2/3","percentage":66}}} V[01:25:06.004] <<< {"id":3,"jsonrpc":"2.0","method":"textDocument/documentHighlight","params":{"position":{"character":10,"line":14},"textDocument":{"uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}}} I[01:25:06.004] <-- textDocument/documentHighlight(3) V[01:25:06.004] ASTWorker running Highlights on version 1 of /Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp I[01:25:06.005] --> reply:textDocument/documentHighlight(3) 1 ms V[01:25:06.005] >>> {"id":3,"jsonrpc":"2.0","result":[{"kind":1,"range":{"end":{"character":14,"line":14},"start":{"character":4,"line":14}}},{"kind":1,"range":{"end":{"character":17,"line":18},"start":{"character":7,"line":18}}}]} I[01:25:06.005] --> textDocument/clangd.fileStatus V[01:25:06.005] >>> {"jsonrpc":"2.0","method":"textDocument/clangd.fileStatus","params":{"state":"idle","uri":"file:///Users/ljh/Documents/lijh8.github/Asio/src/main/server.cpp"}} I[01:25:07.144] Indexed client.cpp (20892 symbols, 172537 refs, 890 files) V[01:25:08.373] BackgroundIndex: building version 1 after indexing enough files V[01:25:08.674] BackgroundIndex: serving version 1 (26933949 bytes) I[01:25:08.701] --> $/progress V[01:25:08.704] >>> {"jsonrpc":"2.0","method":"$/progress","params":{"token":"backgroundIndexProgress","value":{"kind":"end"}}}
HighCommander4 commented 1 week ago

Can you share clangd logs please?