From 6c03b4aaa59cb7c5e6973a809b9ad4872676c23b Mon Sep 17 00:00:00 2001 From: BlackCAT <52720489+psnwd@users.noreply.github.com> Date: Thu, 17 Sep 2026 13:08:40 +0530 Subject: [PATCH] vscode: point IntelliSense at clang instead of MSVC (#564) * vscode: point IntelliSense at clang instead of MSVC KYTY_SYSV_ABI expands to __attribute__((sysv_abi)) with no MSVC fallback, which is correct for a project that rejects cl.exe at configure time. Nothing told the C/C++ extension that, so it fell back to windows-msvc-x64 and flagged every guest-facing function in the tree with "__attribute__ is not a type name". Set the IntelliSense mode, compiler path and C++ standard to match the compiler the build actually uses, and export a compile database for it to read. * vscode: resolve the clang toolchain through the VS developer environment The IntelliSense settings named a specific Visual Studio install, so the compiler and Ninja only resolved on machines with VS 18 Community under Program Files. Let CMake Tools source the developer environment instead, which locates the toolchain through vswhere, and drop the explicit compilerPath so cpptools takes the compiler from compile_commands.json. Also point C_Cpp.default.compileCommands at the build directory this workspace actually configures, and drop CMAKE_EXPORT_COMPILE_COMMANDS because CMake Tools already exports the database by default. --- .vscode/settings.json | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 197264d5..49b63142 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,15 +2,17 @@ "cmake.sourceDirectory": "${workspaceFolder}", "cmake.buildDirectory": "${workspaceFolder}/_Build/vscode-clang", "cmake.generator": "Ninja", + "cmake.useVsDeveloperEnvironment": "always", "cmake.environment": { "CC": "clang-cl", - "CXX": "clang-cl", - "PATH": "${env:ProgramFiles}/Microsoft Visual Studio/18/Community/VC/Tools/Llvm/x64/bin;${env:ProgramFiles}/Microsoft Visual Studio/18/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja;${env:PATH}" + "CXX": "clang-cl" }, "cmake.configureSettings": { "CMAKE_C_COMPILER": "clang-cl", "CMAKE_CXX_COMPILER": "clang-cl", "CMAKE_PREFIX_PATH": "C:/Qt/6.11.0/msvc2022_64" - } + }, + "C_Cpp.default.intelliSenseMode": "windows-clang-x64", + "C_Cpp.default.compileCommands": "${workspaceFolder}/_Build/vscode-clang/compile_commands.json", + "C_Cpp.default.cppStandard": "c++20" } -