vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Option to Show Hex Values of Variables & Enums on Hover (IntelliSense)

Open MBetters opened this issue 4 years ago • 24 comments

Type: LanguageService

Describe the bug

  • OS and Version: Win10
  • VS Code Version: 1.55.0
  • C/C++ Extension Version: 1.3.0-insiders3
  • Other extensions you installed (and if the issue persists after disabling them): N/A
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc). Not a bug. It's a feature.

Steps to reproduce

N/A

Expected behavior

Add a workspace/settings option to be able to show the hex values of variables upon hovering over them, using IntelliSense. Likewise have an option for when hovering over enum values. This is especially useful when dealing with enum values that intentionally enumerate over specific hex ranges for things like different protocols' message/arbitration IDs, etc.

Sometimes when I hover over hex enum values, the hex value will flicker in the tooltip before being replaced by a decimal value, so the extension is definitely capable of at least showing hex values "as declared", which is usually more useful behavior than showing their decimal equivalents anyway.

Logs
N/A

Screenshots

N/A

MBetters avatar Apr 02 '21 15:04 MBetters

This feature request is being closed due to insufficient upvotes. When enough upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] avatar Jun 06 '21 11:06 github-actions[bot]

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

github-actions[bot] avatar Jul 28 '21 12:07 github-actions[bot]

+1. I've also noted that it momentarily shows the hex value at first hover before quickly "resolving" it to decimal and no means to see the hex value again without resorting to navigating to its definition.

phogy avatar Nov 18 '21 10:11 phogy

+1. Embedded system developer uses hexadecimal value a lot.

trievis avatar Aug 19 '22 16:08 trievis

+1

r0oland avatar Mar 24 '23 11:03 r0oland

+1

leongross avatar May 09 '23 09:05 leongross

+1

Divraj-Dev avatar Jun 09 '23 01:06 Divraj-Dev

+9

achillelrc avatar Jul 13 '23 13:07 achillelrc

Hover Converter

achillelrc avatar Jul 13 '23 13:07 achillelrc

Hover Converter

Sadly not for hvoering variables and showing the value in different formats. At least not for me. Also: Hex Hover Converter Here it is mentioned "vscode turns the normal hovers off if in debug mode. To make them visible press the "ALT" key while hovering."

So +1 on this request

Stimmenhotel avatar Jul 19 '23 08:07 Stimmenhotel

+1

vedvern avatar Aug 28 '23 22:08 vedvern

+1 need!

Antecer avatar Apr 08 '24 03:04 Antecer

I'm dealing with a bunch of hex consts. They are defined as hex but displayed in dec. Makes no sense. If some const is defined in hex, display the hint in hex. Seems obvious. Maybe VSC thinks it's doing me a favor? I thought hints should just show the code. Now it's doing some processing to show my the value in decimal. Let me turn that feature off please.

ronderwear avatar May 21 '24 22:05 ronderwear

+1 firmware engineer here having to implement a CAN interface and all of my protocol constants are in hex, yet VS code autoconverts them to decimal. this feature needs to be implemented

n0stalgic avatar May 30 '24 17:05 n0stalgic

+1 I'm implementing a usbdev and wondering if vscode has some way to display binary instead of dec. After a while googling ended up being here. It would be helpful if this feature is implemented.

kienvo avatar Jun 26 '24 16:06 kienvo

just use addon https://marketplace.visualstudio.com/items?itemName=mateuszchudyk.hexinspector image

please close

mrx23dot avatar Jul 11 '24 12:07 mrx23dot

just use addon https://marketplace.visualstudio.com/items?itemName=mateuszchudyk.hexinspector image

please close

What we want is to display it when hovering over the variable name, not the variable value.

Antecer avatar Jul 11 '24 12:07 Antecer