A Visual Studio Code extension that provides inline hints for C and C++ preprocessor macro definitions (#define) and enum values across your project.
Features
Automatically detects and displays inline hints for:
#define macros values in gray
Enum member values in gray
Cross-project reference support:
Collects definitions from multiple files in your workspace
Highlights duplicate definitions with a red '×' indicator
Smart detection:
Ignores values within comments
Truncates long values (>10 characters) with ellipsis
Processes files up to 500KB in size
Handles up to 100 files per workspace
Easy toggle on/off functionality
Usage
Open a C or C++ file in your workspace
Inline hints will automatically appear next to macro and enum member usages
Use keyboard shortcuts to toggle hints
Toggle Hints
ctrl+alt+d: Toggle hints
Examples
Define Examples
#define MAX_BUFFER 1024
#define SERVER_PORT 8080
void someFunction() {
// MAX_BUFFER will show "1024" in gray
char buffer[MAX_BUFFER];
// SERVER_PORT will show "8080" in gray
connectToPort(SERVER_PORT);
}
Enum Examples
enum Color {
RED = 0,
GREEN = 1,
BLUE = 2
};
void setColor() {
// RED will show "0" in gray
// GREEN will show "1" in gray
Color colors[] = { RED, GREEN };
}
Supported File Types
The extension supports the following file extensions:
.c
.cpp
.h
.hpp
.cxx
.hxx
Requirements
Visual Studio Code version 1.96.0 or higher
Extension Settings
This extension contributes the following settings:
clangDefineEnumHints.enabled: Enable/disable all hints (default: true)
Known Limitations
Processes only the first 100 files in the workspace
Maximum file size limit of 500KB
Values longer than 10 characters are truncated with ellipsis
Basic parsing may not handle complex macro definitions
Anonymous enums are labeled as "Anonymous"
Release Notes
0.0.1
Initial release
Basic #define and enum hint functionality
Duplicate definition detection
Toggle support for all hints
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.