Vscode-cpptools: Intellisense for C++: Values for enum variables/arguments prediction

Created on 18 Jul 2020  Â·  1Comment  Â·  Source: microsoft/vscode-cpptools

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

Feature Request Auto-complete Language Service Visual Studio

Most helpful comment

I've filed a feature request on VS. If they add it, we might be able to get the fix from them.

https://developercommunity.visualstudio.com/idea/1122535/intellisense-for-c-values-for-enum-variablesargume-1.html

>All comments

I've filed a feature request on VS. If they add it, we might be able to get the fix from them.

https://developercommunity.visualstudio.com/idea/1122535/intellisense-for-c-values-for-enum-variablesargume-1.html

Was this page helpful?
0 / 5 - 0 ratings