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

Including standard library headers doesn't work since 1.14.3 #10531

Closed
K1T3K1 opened this issue Feb 15, 2023 · 5 comments
Closed

Including standard library headers doesn't work since 1.14.3 #10531

K1T3K1 opened this issue Feb 15, 2023 · 5 comments
Assignees
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
Milestone

Comments

@K1T3K1
Copy link

K1T3K1 commented Feb 15, 2023

Environment

  • OS and Version: macOS Ventura 13.1 M1 Pro Arm64 Apple Silicon
  • VS Code Version: 1.75.1
  • C/C++ Extension Version: 1.14.3
  • If using SSH remote, specify OS of remote machine:

Bug Summary and Steps to Reproduce

Bug Summary: can't #include <header> from standard library on 1.14.3. Reverting to 1.13.9 fixes the problem

Expected behavior:

Configuration and Logs

#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/kpz/repositories/cpp_projects/std_lib_impl/function.h).C/C++(1696)
cannot open source file "memory"C/C++(1696)

settings.json:
    "C_Cpp.intelliSenseEngine":"default",
    "C_Cpp.clang_format_fallbackStyle": "{BasedOnStyle: Google, ColumnLimit: 0}",
    "C_Cpp.clang_format_style": "file",
    "C_Cpp.formatting": "default",
    "C_Cpp.vcFormat.newLine.beforeElse": false,
    "C_Cpp.vcFormat.space.beforeInheritanceColon": false,
    "C_Cpp.codeAnalysis.clangTidy.enabled": false,
    "C_Cpp.codeAnalysis.clangTidy.checks.enabled": [
        "clang-analyzer-*"
    ],
    "C_Cpp.codeAnalysis.clangTidy.fallbackConfig": "",
    "C_Cpp.codeAnalysis.runAutomatically": true,
    "C_Cpp.codeAnalysis.clangTidy.useBuildPath": true,
    //"C_Cpp.codeAnalysis.clangTidy.args": ["--extra-arg=--target=gcc-arm-none-eabi"],
    "C_Cpp.default.includePath": [
        "${workspaceFolder}/**",
        //"/Users/kpz/esp/esp-idf/components/**"

Other Extensions

No response

Additional context

No response

@K1T3K1 K1T3K1 changed the title Including standard library headers doesn't work since 1.14.4 Including standard library headers doesn't work since 1.14.3 Feb 15, 2023
@bobbrow
Copy link
Member

bobbrow commented Feb 15, 2023

Do you use c_cpp_properties.json to configure IntelliSense? If not, you'll need to run the "Select a Compiler" command to tell us which compiler you want us to emulate. We don't automatically pick one for you anymore unless it's in your $PATH and there should have been a prompt to select one after you upgraded the extension. This command effectively sets the C_Cpp.default.compilerPath setting for you.

@bobbrow bobbrow added more info needed The issue report is not actionable in its current state Language Service labels Feb 15, 2023
@K1T3K1
Copy link
Author

K1T3K1 commented Feb 15, 2023

Adding C_Cpp.default.compilerPath in my settings.json helped me! Thank You, wish there was note on this in patch notes tho..

@K1T3K1 K1T3K1 closed this as completed Feb 15, 2023
@bobbrow
Copy link
Member

bobbrow commented Feb 15, 2023

Good point. I updated the release notes on GitHub.

New Behavior

The extension does not automatically query compilers that it cannot implicitly trust when configuring IntelliSense. This may impact the extension's ability to locate system headers. If the compiler you want us to emulate is not in the $PATH and you accidentally dismissed the notification asking you to confirm the compiler we found, run the C/C++: Select Default Compiler command to instruct the extension which compiler to emulate for IntelliSense.

@bobbrow bobbrow pinned this issue Feb 15, 2023
@bobbrow
Copy link
Member

bobbrow commented Feb 15, 2023

Also, I think we might be able to add a better error message for the failed resolution of #include for system headers to make it more obvious what you need to do. I'm reopening this issue and will discuss options with the team.

@bobbrow bobbrow reopened this Feb 15, 2023
@bobbrow bobbrow added Feature Request Feature: Configuration An issue related to configuring the extension or IntelliSense and removed more info needed The issue report is not actionable in its current state labels Feb 15, 2023
@bobbrow bobbrow added this to Triage in 1.15 via automation Feb 15, 2023
@bobbrow bobbrow added this to the On Deck milestone Feb 15, 2023
@bobbrow bobbrow moved this from Triage to To do in 1.15 Feb 15, 2023
@bobbrow
Copy link
Member

bobbrow commented Feb 15, 2023

The current plan is to add an additional message to the #include error and also add a code action (fixit) for the squiggle to run the "Select Default Compiler" command.

The include error can say something like cannot open source file "memory". Please run the "Select Default Compiler" command to help the C/C++ extension locate your system headers. Check with @AlexandraKemperMS on the exact wording.

The code action can have a label like Select a compiler to locate system headers.

@bobbrow bobbrow moved this from To do to In progress in 1.15 Feb 21, 2023
@browntarik browntarik moved this from In progress to Code Review in 1.15 Feb 23, 2023
@browntarik browntarik added the fixed Check the Milestone for the release in which the fix is or will be available. label Mar 3, 2023
@browntarik browntarik moved this from Code Review to Done in 1.15 Mar 3, 2023
@browntarik browntarik moved this from Done to Code Review in 1.15 Mar 6, 2023
@browntarik browntarik moved this from Code Review to Done in 1.15 Mar 6, 2023
@sean-mcmanus sean-mcmanus modified the milestones: On Deck, 1.15.0 Mar 10, 2023
@sean-mcmanus sean-mcmanus unpinned this issue Mar 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: Configuration An issue related to configuring the extension or IntelliSense Feature Request fixed Check the Milestone for the release in which the fix is or will be available. Language Service
Projects
No open projects
1.15
Done
Development

No branches or pull requests

4 participants