microsoft / microsoft/vscode-cpptools
Type and variable size indicator
Nobody has claimed this yet.
- 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:

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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