microsoft / microsoft/vscode-cpptools

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

Open
#5,798 8 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Auto-complete Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is named. Start by reproducing the enum assignment example in VS Code with the C/C++ extension and inspect the IntelliSense completion path. Done means Ctrl+Space presents enum-compatible values instead of the large set of unrelated suggestions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.