Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language server does not report path to SDK when using Xcode generator #13232

Open
alexbatalov opened this issue Feb 5, 2025 · 0 comments
Open

Comments

@alexbatalov
Copy link

Environment

  • OS and Version: macOS 14.5
  • VS Code Version: 1.96.4 (Universal)
  • C/C++ Extension Version: 1.23.5.0

Bug Summary and Steps to Reproduce

Minimal repo to reproduce: https://gist.github.com/alexbatalov/d364a78251d0c0d887a221a2cc0cf41f
Select unix makefiles preset, observe there is no include error in the main.c. Select xcode preset, observe include error.

Configuration and Logs

All defaults (implying cmake-tools configuration provider).

Other Extensions

ms-vscode.cmake-tools (1.19.52)

Additional context

Here is diagnostics log from unix makefiles preset:

Version: 1.23.5
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "/Users/alex/dev/sample/**"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks"
    ],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/clang",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "/Users/alex/dev/sample/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "stdio.h": "c"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": 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": [
        "/users/alex/dev/sample"
    ],
    "compilerPath": "/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/cc",
    "compilerArgs": [],
    "compilerFragments": [
        " -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk -mmacosx-version-min=14.5"
    ]
}
cpptools version (native): 1.23.5.0
Current database path: /Users/alex/Library/Caches/vscode-cpptools/574f383c91e984d4b69b86e95ab00552/.browse.VC.db
Translation Unit Mappings:
[ /Users/alex/dev/sample/main.c - source TU]:
Translation Unit Configurations:
[ /Users/alex/dev/sample/main.c ]
    Process ID: 4728
    Memory Usage: 15 MB
    Compiler Path: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/cc
    Includes:
    System Includes:
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/usr/include
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    Frameworks:
        /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/System/Library/Frameworks
    Standard Version: c17
    IntelliSense Mode: macos-clang-x64
    Other Flags:
        --clang
        --clang_version=170006
Total Memory Usage: 15 MB

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

And here are for the xcode preset:

Version: 1.23.5
Current Configuration:
{
    "name": "Mac",
    "includePath": [
        "/Users/alex/dev/sample/**"
    ],
    "defines": [],
    "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX14.5.sdk/System/Library/Frameworks"
    ],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c17",
    "cppStandard": "c++17",
    "intelliSenseMode": "macos-clang-x64",
    "compilerPathInCppPropertiesJson": "/usr/bin/clang",
    "intelliSenseModeIsExplicit": false,
    "cStandardIsExplicit": false,
    "cppStandardIsExplicit": false,
    "mergeConfigurations": false,
    "compilerPathIsExplicit": false,
    "configurationProvider": "ms-vscode.cmake-tools",
    "browse": {
        "path": [
            "/Users/alex/dev/sample/**",
            "${workspaceFolder}"
        ],
        "limitSymbolsToIncludedHeaders": true
    }
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "stdio.h": "c"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/CVS": 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": [
        "/users/alex/dev/sample/out/build/xcode/cmakefiles",
        "/users/alex/dev/sample"
    ],
    "compilerPath": "/applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang",
    "compilerArgs": [],
    "compilerFragments": [
        "-g"
    ]
}
cpptools version (native): 1.23.5.0
Current database path: /Users/alex/Library/Caches/vscode-cpptools/574f383c91e984d4b69b86e95ab00552/.browse.VC.db
Translation Unit Mappings:
[ /Users/alex/dev/sample/main.c - source TU]:
Translation Unit Configurations:
[ /Users/alex/dev/sample/main.c ]
    Process ID: 4774
    Memory Usage: 13 MB
    Compiler Path: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang
    Includes:
    System Includes:
        /usr/local/include
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/16/include
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
    Frameworks:
        /System/Library/Frameworks
        /Library/Frameworks
    Standard Version: c17
    IntelliSense Mode: macos-clang-x64
    Other Flags:
        --clang
        --clang_version=170006
Total Memory Usage: 13 MB

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

Path to SDK (/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.1.sdk/) is missing, hence include error. I'm not sure if that's vscode-cpptools or vscode-cmake-tools fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant