vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Intellisense forces the use of msvc LSP, no way to override the setting.

Open esperanza-esperanza opened this issue 1 month ago • 18 comments

Environment

  • OS and Version: Windows 11 x64 Pro 25H2
  • VS Code Version: 1.101.5
  • C/C++ Version: 1.28.3
  • C/C++ Extension Version: 1.3.1
  • Meson Extension Version: 1.27.0

Bug Summary and Steps to Reproduce

Bug Summary: Possibly I used env var CC=clang-cl instead of clang-cl.exe.

Steps to reproduce:

  1. Set the env var for CC/CXX to clang-cl/clang.
  2. Create an example meson project.
  3. Set intellisense to windows-clang-x64.
  4. Intellisense cannot find clang-cl/clang.
  5. Add clang-cl/clang to path.
  6. Intellisense cannot find clang-cl/clang.
  7. Provide direct compiler path and folder to the compiler path in C/C++ extension settings.
  8. Intellisense cannot find clang-cl/clang.
  9. Install clangd extension.
  10. Intellisense prompts for disablement.
  11. The compiler path is in PATH env varriable, clangd gets found. C:(...)\VC\Tools\Llvm\x64\bin
  12. Some global setting gets set that stays when the extension gets disabled. LSP no longer is set to the MSVC LSP.

Expected behaviour: LLVM-tools are installed from VS. Therefore clang/clang-cl gets found without any fiddling when setting intellisense to the windows-clang-x64 setting. PATH should get used as a fallback. "C_Cpp.default.compilerPath" shouldn't get ignored or allow direct path to .exe. Setting CC to clang-cl.exe doesn't do much

Configuration and Logs

Startup debug message:
Unable to resolve configuration with compilerPath "clang-cl.exe". Using "cl.exe" instead.

-------- Diagnostics - 11/11/2025, 11:36:26 AM
Version: 1.28.3
Current Configuration:
{
    "name": "Win32",
    "includePath": [
        "c:/Users/jakubby/Desktop/Code Projects/Graphics Scribble/Bicubic/**"
    ],
    "defines": [
        "_DEBUG",
        "UNICODE",
        "_UNICODE"
    ],
    "windowsSdkVersion": "10.0.26100.0",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "compileCommands": [
        "c:\\Users\\jakubby\\Desktop\\Code Projects\\Graphics Scribble\\Bicubic\\build/compile_commands.json"
    ],
    "intelliSenseMode": "windows-clang-x64",
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "recursiveIncludes": {},
    "recursiveIncludesReduceIsExplicit": false,
    "recursiveIncludesPriorityIsExplicit": false,
    "recursiveIncludesOrderIsExplicit": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "mesonbuild.mesonbuild",
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Modified Settings:
{
    "C_Cpp.default.compileCommands": "c:\\Users\\jakubby\\Desktop\\Code Projects\\Graphics Scribble\\Bicubic\\build/compile_commands.json",
    "C_Cpp.default.intelliSenseMode": "windows-clang-x64",
    "C_Cpp.default.compilerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\Llvm\\x64\\bin",
    "C_Cpp.default.configurationProvider": "mesonbuild.mesonbuild"
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {},
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
Custom browse configuration: 
{
    "browsePath": [
        ""
    ],
    "compilerPath": "clang-cl.exe",
    "compilerArgs": []
}
cpptools version (native): 1.28.3.0
Current database path: C:\USERS\JAKUBBY\APPDATA\LOCAL\MICROSOFT\VSCODE-CPPTOOLS\22EF692DF0D2A1A8F52301E9197AB384\.BROWSE.VC.DB
Translation Unit Mappings:
[ C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\wack.c - source TU]:
Translation Unit Configurations:
[ C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\wack.c ]
    Process ID: 3008
    Memory Usage: 204 MB
    Compiler Path: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe
    Include paths:
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\build\wack.exe.p
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\build
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\external\glad\include
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\external\SDL2\include
        include: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\external\SDL2_image\include
        system include: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include
        system include: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\atlmfc\include
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
        system include: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
    Standard Version: ms_c17
    IntelliSense Mode: windows-msvc-x64
    compile_commands.json entry:
        directory: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic\build
        file: C:\USERS\JAKUBBY\DESKTOP\CODE PROJECTS\GRAPHICS SCRIBBLE\BICUBIC\WACK.C
        command: "clang-cl.exe" "-Iwack.exe.p" "-I." "-I.." "-I..\external\glad\include" "-I..\external\SDL2\include" "-I..\external\SDL2_image\include" "/MD" "/nologo" "/showIncludes" "/utf-8" "/W4" "/O2" "/Zi" "/Fdwack.exe.p\wack.c.pdb" /Fowack.exe.p/wack.c.obj "/c" ../wack.c
        output: wack.exe.p/wack.c.obj
Total Memory Usage: 204 MB
Browse Paths from compile_commands.json, from workspace folder: C:\Users\jakubby\Desktop\Code Projects\Graphics Scribble\Bicubic
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\cppwinrt
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\shared
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\um
    C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\winrt
    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\atlmfc\include
    C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\include

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 5074

Other Extensions

  • Meson Extension Version: 1.27.0
  • clangd Extension Version: 0.2.0

Additional context

No response

esperanza-esperanza avatar Nov 11 '25 11:11 esperanza-esperanza