Value Converter — VSCode Extension
Converts numeric and text literals between decimal, hexadecimal, binary, and ASCII directly in the editor.
Features
Hover over any literal to see a panel with all representations:
| Format | Value |
|---------------|---------------|
| Decimal | 42 | ◀
| Hexadecimal | 0x2A |
| Binary | 0b101010 |
| ASCII / String| "* " |
⚡ CodeLens
An inline hint appears above each line containing literals:
⇄ 0xFF → dec: 255 | bin: 0b11111111 | str: "ÿ"
const MAX = 0xFF;
🔄 Command: Convert Selection
Opens a Quick Pick to replace the selected token with any form:
- Suggested shortcut:
Ctrl+Shift+V / Cmd+Shift+V
- Or from Command Palette:
Value Converter: Convert Selection
| Input |
Example |
| Decimal |
255, -42, 3.14 |
| Hexadecimal |
0xFF, 0x1A3C |
| Binary |
0b11001010 |
| String/ASCII |
"hello", 'A' |
Installation (development)
# 1. Install dependencies
pnpm install
# 2. Compile
npm run compile
# 3. Open in VSCode and press F5 for Extension Development Host
Configuration
| Setting |
Default |
Description |
valueConverter.enableHover |
true |
Show conversion tooltip on hover |
valueConverter.enableCodeLens |
true |
Show inline CodeLens hints |
Quick Examples
const a = 0b1010; // hover → dec: 10, hex: 0xA
const b = 0xFF; // hover → dec: 255, bin: 0b11111111, str: "ÿ"
const c = 65; // hover → hex: 0x41, bin: 0b1000001, str: "A"
const d = "hello"; // hover → dec: 104 101 108 108 111, hex: 0x68 0x65…