Skip to content

Mixed up default intellisense options #6075

Description

Type: LanguageService

Describe the bug
When I change intellisense default mode, it seems that some settings are mixed up and show different values when setting some values. I happened to fond this when it was showing VLA intellisense errors on a C18 standard when it sohuldn't in clang on windows.

  • OS and Version: Windows 10
  • VS Code Version: 1.48.2
  • C/C++ Extension Version: 0.30.0-insiders4
  • Other extensions you installed (and if the issue persists after disabling them): I do have CodeLLDB 1.5.3, but the issue seems to be not related to this extension.

Steps to reproduce

  1. Go to settings.json
  2. Set the C_Cpp.default.intelliSenseMode value to anything you want to.
  3. Call the C/C++ diagnostics. Look for the IntelliSense Mode log file.
  4. See mixed up versions. This will also trigger errors given the intelligence (for example VLAs)
    a. clang-x86 and clang-x64 results in msvc-x86 and msvc-x64
    b. gcc-x86 and gcc-x64 results in clang-x86 and clang-x64
    c. gcc-arm results in clang-arm

The rest of the settings work fine.

This also happens if you set this values via the UI method. When I reload the project, the feature seems to correct itself, up until I close the settings window or file.

Expected behavior
Have correct relations to the settings.

Activity

  1. sean-mcmanus commented on Sep 3, 2020

    @sean-mcmanus
    Contributor

    We'll generally override the intelliSenseMode based on the compilerPath that is found. What compilerPath is being used? You could see via running C/C++: Log Diagnostics.

  2. edwood-grant commented on Sep 12, 2020

    @edwood-grant
    Author

    The compiler path points to clang, version 10.0. This is my setup in c_cpp_properties.json:
    "compilerPath": "C:/Program Files/LLVM/bin/clang.exe",

    The compiler path showing in the diagnostics is the same in both the Current Configuration and the Translation Unit Configurations.

    It does seem that its showing wrong in the translation configurations section only. I may be doing something wrong, maybe the extra inclusions for windows might be a problem, and force it to msvc-64 (is there a way for me to remove those additional includes if I want to?). Or maybe there is something in clang that connects to msvc-64 and I cannot change it on Windows.

    I'll attach my C++ Diagnostic log file here and my c_cpp_properties.json file as well.

    Thank you.

    C_CPP_Diagnostics.log
    c_cpp_properties.txt

  3. sean-mcmanus commented on Sep 14, 2020

    @sean-mcmanus
    Contributor

    Yeah, it should be using clang intelliSenseMode instead of msvc intelliSenseMode, along with some extra flags.

  4. added this to the 1.1.0 milestone on Sep 17, 2020
  5. sean-mcmanus commented on Oct 14, 2020

    @sean-mcmanus
    Contributor

    Fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/1.1.0-insiders .

    Let us know if you're still hitting other issues with clang-cl.exe configuration.

  6. edwood-grant commented on Oct 14, 2020

    @edwood-grant
    Author

    Hello!

    Just tested, everything seem to work ok now on a first inspection. Thanks a lot!

    EDIT: Hmm I did notice that now it seems that I cannot force my C Standard to a certain value. It keeps defaulting to C11 even if I set the option as "cStandard": "c17", or to any option for that matter,

    Not sure if related to this problem. It seems to happen only on cStandard with clang. cppStandard works ok for me.

  7. nunojsa commented on Oct 14, 2020

    @nunojsa

    EDIT: Hmm I did notice that now it seems that I cannot force my C Standard to a certain value. It keeps defaulting to C11 even if I set the option as "cStandard": "c17", or to any option for that matter,

    I'm also experiencing this with aarch64-linux-gnu-. It looks like the cStandard option is just ignored and whatever is the default used by the compiler, will be taken. One way I found to workaround this was to add -std=gnu89 to the compilerArgs setting...

  8. Colengms commented on Oct 14, 2020

    @Colengms
    Contributor

    Nuno Sá (@nunojsa) Italo F. Capasso B. (@edwood-grant) It looks like the failure to use the cStandard from the base config in c_cpp_properties.json is due to a bug introduced by the 1.1.0 insiders. We have a fix, and will release another insiders soon.

  9. edwood-grant commented on Oct 14, 2020

    @edwood-grant
    Author

    Awesome, thanks a lot for all the care on this plugin 👍

  10. locked and limited conversation to collaborators on Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Feature: ConfigurationAn issue related to configuring the extension or IntelliSenseLanguage ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions