Dimming of Unused Variables · Issue #10490 · microsoft/vscode-cpptools · GitHub
Skip to content

Dimming of Unused Variables #10490

Open

Description

Feature Request

After getting syntax highlighting all setup and working, I noticed that there was not a way to visually ensure that a variable was used or unused. There are other ways to accomplish this, but it would be nice to get a heads up from the syntax highlighting that a variable is never used. Similar to what happens when using an #ifdef block:
image

Is this possible? Or is the static analysis to ensure an unused variable beyond the scope of the extension?

Activity

  1. self-assigned this
    on Feb 8, 2023
  2. added this to the Triage milestone on Feb 8, 2023
  3. browntarik commented on Feb 9, 2023

    @browntarik
    Contributor

    Thank for providing this request! We will look into implementing your feature request in the future. For now, please track this issue for further updates. Considering we have a backlog of feature requests; we will consider this request based on priority. If you would like us to address this issue faster, having more users upvote the issue usually helps.

  4. removed their assignment
    on Feb 9, 2023
  5. github-actions commented on Apr 11, 2023

    @github-actions

    This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.

  6. modified the milestones: Triage, Backlog on May 25, 2023
  7. github-actions commented on May 25, 2023

    @github-actions

    This feature request has received enough votes to be added to our backlog.

  8. removed
    more votes neededIssues that have been postponed until more community members upvote it
    on May 25, 2023
  9. haoenz commented on Jul 13, 2023

    @haoenz

    Because of the lack of this feature, someone suggested that I should give up using VSCode and turn to other real IDEs…

  10. sean-mcmanus commented on Jul 13, 2023

    @sean-mcmanus
    Contributor
  11. haoenz commented on Jul 13, 2023

    @haoenz

    Haoen Zhang (@haoenz) Which IDE?

    If I remember correctly, he recommended CLion. But I haven't tried it yet.

  12. starball5 commented on Aug 7, 2023

    @starball5

    Historically related: #6588, but closed pointing to problem matchers for build tasks.

    Related on Stack Overflow: How can I dim out unused C++ variables in VS Code?

    Related on r/vscode: How to enable C++ unused variables gray out?

  13. AlefCS commented on Oct 7, 2024

    @AlefCS

    It would also be nice to have this kind of feature for unused headers.

  14. moved this from Pull Request to Done in cpptoolson Sep 18, 2026
  15. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Feature RequestFeature: Code AnalysisRelated to integration with clang-tidy, cppcheck, cl.exe /analyze, etc.Language ServiceVisual StudioInherited from Visual StudiofixedCheck the Milestone for the release in which the fix is or will be available.

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions