microsoft / microsoft/vscode-cpptools

Type and variable size indicator

Open
#6,460 12 comments 67 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Language Service Works in VS
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Type: LanguageService
I was recently exposed to an IDE which displays the size of a type (also structs and classes) or variable when hovering over the semantic object. So basically it just shows the number sizeof(type) would give you. It proved to be very handy when optimizing for memory usage and working with bit fields.

Here is a simple mock-up I made:
Screenshot from 2020-11-06 22-25-59

I was originally trying to implement such a feature as a standalone extension but came to the conclusion that this would probably need to be included into cpptools itself.

Also thank you for working on this awesome extension!

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

Start by reviewing the LanguageService hover path in cpptools and how semantic objects are represented. Determine where type and variable hover information is assembled, then define how sizeof(type) results should be displayed and validated for types, structs, classes, variables, and bit fields.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, typescript, vscode
Domain
developer-experience, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.