C/C++ Typedef Hover
A Visual Studio Code extension that provides enhanced hover information for typedef definitions in C and C++ files. When hovering over a type identifier, this extension shows the complete type definition with source location links.
Features
This extension adds enhanced hover functionality for C and C++ files:
- Shows complete typedef definitions when hovering over custom types
- Displays the full type definition including nested structures
- Provides direct links to type definitions in source code
- Supports multi-line typedef declarations
- Handles complex type definitions with nested braces
For example, when you hover over a custom type:
typedef struct {
int x;
int y;
} Point;
Point p; // Hover over "Point" to see the complete definition
The hover tooltip will show:
- A link to the type definition location
- The complete type definition in a formatted code block
Usage
The extension automatically activates for C and C++ files. Simply hover over any symbol to view its type definition:
- Open a C or C++ file
- Hover over any custom type or variable
- The hover tooltip will display the complete type definition if available
Requirements
This extension requires:
- Visual Studio Code version 1.x.x or higher
- C/C++ files in your workspace
Extension Settings
This extension does not contribute any additional settings.
Known Issues
The definition body is located with line-based heuristics, not a real C parser, so the following limits apply:
- The upward search for the start of a definition stops after 50 lines; the forward search for the closing brace stops after 200 lines. Definitions longer than that are truncated without warning.
- Definitions where the type name and the body are separated by preprocessor conditionals (
#if / #else) may resolve to the wrong branch.
- Variable declarations are recognized only in the shape
<keyword> <type> <name>;; forms such as static const int x; are not matched.
If you encounter any other problems, please report them on the GitHub repository.
Release Notes
1.0.0
Initial release of C/C++ Typedef Hover:
- Hover support for C and C++ files
- Complete typedef display
- Source location links
- Multi-line typedef handling
Contributing
If you'd like to contribute to this extension, please submit pull requests or create issues in the GitHub repository.
License
This extension is licensed under the MIT License.