Skip to content

Intellisense for C++: Values for enum variables/arguments prediction #5798

Open

Description

@Voha888

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 x64
  • VS Code Version: 1.47.2
  • C/C++ Extension Version: 0.29.0
  • Other extensions you installed (and if the issue persists after disabling them): platformio

I'd like to propose improvement to how does IntelliSense operate on enums.

Currently if you have code like following and you press Ctrl+Space inside parentheses of the foo function call, IntelliSense returns huge list of unrelated items like: pre-processor derictives, integer constants, functions. See screenshot attached.

All 99% of the suggested items are not compatible with enum. They cannot be implicitly converted to enum.

Steps to reproduce

//

// Code example

//
enum SomeEnums
{
Element1,
Element2
};

int main()
{

SomeEnums SomeEnum;

SomeEnum = /* press Ctrl+Space here */

return 0;
}

Screenshots

The screenshots show the work of another IDE in this situation - the first to offer compatible options
photo5228978801931824965
photo5228978801931824963

Additional context

Activity

  1. sean-mcmanus commented on Jul 22, 2020

    @sean-mcmanus
    Contributor
  2. AlmiAlmo commented on Feb 1, 2022

    @AlmiAlmo

    I'm not familiar with intellisense and may bullshit. But...

    In Visual Studio (and other VS based IDEs like atmel studio) it has been worked for decades.
    image

  3. Alopex95 commented on May 24, 2022

    @Alopex95

    I would appreciate better enum suggestions as well.

  4. heartacker commented on Aug 30, 2022

    @heartacker
    Contributor

    This feature has now been released in the latest product update released version 17.3. Please install and let us know your feedback. Please continue to provide feedback and help us be even better.

  5. sean-mcmanus commented on Aug 30, 2022

    @sean-mcmanus
    Contributor

    heartacker Yeah, the fix came in too late for our pending 1.12.3 release tomorrow, but it should be available in the following 1.13.0 pre-release afterwards (maybe in a week or so).

  6. removed
    Visual Studio
    on Sep 13, 2022
  7. removed this from the 1.13.1 milestone on Sep 13, 2022
  8. sean-mcmanus commented on Sep 13, 2022

    @sean-mcmanus
    Contributor

    The fix got into VS 17.3, but unfortunately there is more work on the VS Code side to start getting the updated behavior.

  9. mrx23dot commented on Jul 11, 2024

    @mrx23dot

    Why VScode change is needed?
    When I install any AI copilot addon they can manipulate hint list freely already.

    I have cpptools v1.17.5 and it's still not working.
    It's really a basic function to have, more important than other niche issues.

    Maybe the issue is that named enums show as unnamed
    image

    image

  10. added this to cpptools and removed this from On Deckon Aug 30, 2024
  11. robinhellmers commented on May 8, 2025

    @robinhellmers

    How is this going, is it still on the map? Sean McManus (@sean-mcmanus).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions