Reference Counter for VSCode


Why Use Reference Counter?
- Identify Dead Code: Find unused functions and classes that can be safely removed
- Understand Impact: See how widely used a function is before refactoring it
- Improve Code Quality: Maintain a cleaner codebase by removing unused code
- Save Time: No more manual searches to find all references
- Displaying the number of times a function, class, or method is called directly in your editor
- Identifying unused symbols in your workspace with a dedicated view
Screenshots
Inline Reference Counts

Unused Symbols View

Features
- Inline Reference Counts: See how many times each function, class, or method is used
- Unused Symbols View: Quickly identify unused code in your workspace
- Multi-language Support: Works with Python, JavaScript, TypeScript, and more
- Smart Import Handling: Excludes import statements by default for more accurate counts
- Performance Optimized: Automatically excludes common folders like node_modules and build directories
- Highly Configurable: Customize to fit your workflow
New in Latest Version
- Unused Symbols Explorer: Dedicated view in the Explorer sidebar with on-demand scanning
- Performance Improvements: Automatically excludes node_modules, .next, dist, and other build folders
- Improved Symbol Detection: Better handling of nested symbols and class methods
- Enhanced Logging: More detailed logging for easier troubleshooting
Usage
- Open any supported file in your workspace
- Reference counts will automatically appear next to functions, classes, and methods
- Open the "Unused Symbols" view in the Explorer sidebar
- Click the "Find Unused Symbols" button (or run the command from the command palette) to scan your workspace
- Click on any unused symbol to navigate directly to its location
Configuration
Customize the extension through VS Code settings:
// settings.json
{
// File extensions to include in reference counting
"referenceCounter.fileExtensions": ["py", "js", "jsx", "ts", "tsx"],
// Patterns to exclude from scanning (improves performance)
"referenceCounter.excludePatterns": ["node_modules", ".next", "dist", "build"],
// Whether to include import statements in reference count
"referenceCounter.includeImports": false,
// Use a more compact display for reference counts
"referenceCounter.minimalisticDecorations": true,
// Enable or disable the Unused Symbols view
"referenceCounter.enableUnusedSymbols": true
}
Contributing
We welcome contributions from the community! Reference Counter is an open-source project that gets better with your help.
Ways to Contribute
- Report Bugs: Found an issue? Let us know in the GitHub Issues
- Suggest Features: Have an idea? We'd love to hear it!
- Submit Pull Requests: Fixed a bug or added a feature? Submit a PR!
- Improve Documentation: Help make our docs better for everyone
Development Setup
Clone the repository
git clone https://github.com/gosvig123/reference_count_extension.git
cd reference_count_extension
Install dependencies
npm install
Build and run
npm run compile
# Press F5 in VS Code to launch the extension in debug mode
Feedback and Support
If you like this extension, please:
For support, please open an issue on GitHub.
Connect with the Developer
License
This extension is licensed under the MIT License.