Enhanced right-click context menus for Node.js development with intelligent code operations for React, Angular, Express, Next.js, TypeScript, and JavaScript projects.

Features
- 🎯 Copy Function - AST-based function detection and copying with intelligent import handling
- 📋 Copy to Existing File - Smart code copying with import conflict resolution
- ✂️ Move to Existing File - Intelligent code moving with automatic cleanup
- 💾 Save All - Enhanced save functionality with progress feedback and read-only handling
Project Intelligence
- 🔍 Automatic Project Detection - Detects React, Angular, Express, and Next.js projects
- 📁 Smart File Discovery - Finds compatible files for code operations
- 🔧 Context-Aware Menus - Shows relevant options based on file type and project
- 📝 TypeScript & JavaScript Support - Full support for .ts, .tsx, .js, .jsx files
Code Operations
- 🧠 AST-Based Analysis - Uses Babel parser for accurate code parsing
- 🔀 Import Management - Merge, duplicate, or skip import statements
- 📍 Smart Insertion - Intelligent code placement (smart, end, beginning)
- 💬 Comment Preservation - Maintains code comments during operations
Status Bar Integration
- 📊 Visual Project Status - Real-time display of extension and project state in VS Code status bar
- 🎯 Framework Detection - Shows detected frameworks with specific icons:
- ⚛️ React projects
- 🅰️ Angular projects
- 🚂 Express projects
- ▲ Next.js projects
- 🔍 Project State Indicators - Clear visual feedback for:
- Extension enabled/disabled status
- Node.js project detection
- Multi-framework project support
- 🖱️ Interactive Debug - Click status bar item to debug context variables
- 🎨 Color-Coded Status - Different background colors for various states:
- Prominent background for active projects
- Warning background when extension is disabled
- Normal background for non-Node.js projects
Installation
From VS Code Marketplace
- Open Visual Studio Code
- Press
Ctrl+P
(Windows/Linux) or Cmd+P
(macOS)
- Type
ext install VijayGangatharan.additional-context-menus
- Press Enter
From Command Line
code --install-extension VijayGangatharan.additional-context-menus
Usage
The extension automatically detects Node.js projects and enhances right-click context menus for supported file types.
Copy Function
- Right-click in a TypeScript/JavaScript file
- Select "Copy Function" from the context menu
- The extension will detect and copy the function at your cursor position
Copy/Move Code
- Select the code you want to copy or move
- Right-click on the selection
- Choose "Copy to Existing File" or "Move to Existing File"
- Select the target file from the quick pick menu
- The code will be intelligently inserted with proper import handling
Save All
- Right-click anywhere in the editor
- Select "Save All" to save all modified files with progress feedback
Commands
Additional Context Menus provides command palette integration (accessible via Ctrl+Shift+P
or Cmd+Shift+P
):
Additional Context Menus: Enable
- Enable the extension
Additional Context Menus: Disable
- Disable the extension
Additional Context Menus: Show Output Channel
- Open debug logs for troubleshooting
Additional Context Menus: Debug Context Variables
- Inspect extension state and context variables
Additional Context Menus: Refresh Context Variables
- Reload project detection and refresh context
Additional Context Menus: Check Keybinding Conflicts
- Detect potential keyboard shortcut conflicts
Additional Context Menus: Enable Keybindings
- Enable keyboard shortcuts for all commands
Additional Context Menus: Disable Keybindings
- Disable keyboard shortcuts for all commands
Keyboard Shortcuts
Additional Context Menus provides optional keyboard shortcuts for all core operations. Keybindings are disabled by default to prevent conflicts with existing shortcuts.
Default Keybindings
Command |
Windows/Linux |
macOS |
Description |
Copy Function |
Ctrl+Alt+Shift+F |
Cmd+Alt+Shift+F |
Copy function at cursor position |
Copy Code to File |
Ctrl+Alt+Shift+C |
Cmd+Alt+Shift+C |
Copy selected code to another file |
Move Code to File |
Ctrl+Alt+Shift+M |
Cmd+Alt+Shift+M |
Move selected code to another file |
Save All Files |
Ctrl+Alt+Shift+A |
Cmd+Alt+Shift+A |
Save all open files with progress |
Enabling Keyboard Shortcuts
⚠️ Important: Check for conflicts before enabling keybindings!
Check for conflicts (recommended):
- Open Command Palette (
Ctrl+Shift+P
/ Cmd+Shift+P
)
- Run
Additional Context Menus: Check Keybinding Conflicts
- Review any reported conflicts
Enable keybindings:
- Use Command Palette:
Additional Context Menus: Enable Keybindings
- Or set
additionalContextMenus.enableKeybindings
to true
in settings
Customize shortcuts (optional):
- Open Keyboard Shortcuts (
Ctrl+K Ctrl+S
/ Cmd+K Cmd+S
)
- Search for "Additional Context Menus"
- Modify shortcuts as needed
Safety Features
- Disabled by default - Prevents conflicts with existing shortcuts
- Conflict detection - Built-in command to check for potential conflicts
- Conditional activation - Shortcuts only work when appropriate (e.g., with selected text)
- Context-aware - Keybindings respect file types and project detection
Requirements
- Visual Studio Code version 1.102.0 or higher
- Node.js project with package.json (for project detection)
- TypeScript/JavaScript files (.ts, .tsx, .js, .jsx)
Extension Settings
Additional Context Menus provides extensive configuration options:
Core Settings
additionalContextMenus.enabled
(boolean, default: true
) - Enable or disable the extension
additionalContextMenus.autoDetectProjects
(boolean, default: true
) - Automatically detect Node.js projects
additionalContextMenus.supportedExtensions
(array, default: [".ts", ".tsx", ".js", ".jsx"]
) - File extensions where context menus will be shown
Code Copy Settings
additionalContextMenus.copyCode.insertionPoint
(string, default: "smart"
) - Where to insert copied code
"smart"
- Intelligently choose the best location
"end"
- Insert at the end of the file
"beginning"
- Insert at the beginning of the file
additionalContextMenus.copyCode.handleImports
(string, default: "merge"
) - How to handle import statements
"merge"
- Merge with existing imports
"duplicate"
- Allow duplicate imports
"skip"
- Skip import statements
additionalContextMenus.copyCode.preserveComments
(boolean, default: true
) - Preserve comments when copying code
Save All Settings
additionalContextMenus.saveAll.showNotification
(boolean, default: true
) - Show notification after saving all files
additionalContextMenus.saveAll.skipReadOnly
(boolean, default: true
) - Skip read-only files when saving all
Keyboard Shortcut Settings
additionalContextMenus.enableKeybindings
(boolean, default: false
) - Enable keyboard shortcuts for context menu commands
- ⚠️ Warning: Check for conflicts with existing keybindings before enabling
additionalContextMenus.showKeybindingsInMenu
(boolean, default: true
) - Show keyboard shortcuts in context menu items when keybindings are enabled
Supported Frameworks
The extension automatically detects and provides enhanced functionality for:
- React - Component-based development with JSX support
- Angular - Service and component development
- Express - Server-side routing and middleware
- Next.js - Full-stack React framework
- TypeScript - Enhanced type checking and IntelliSense
- JavaScript - ES6+ syntax support
Known Issues
Please report any issues on our GitHub repository.
- Context menus only appear in Node.js projects with package.json
- Function detection requires valid JavaScript/TypeScript syntax
Release Notes
See CHANGELOG.md for detailed release notes.
[1.1.0] - Latest
- ⌨️ Keyboard Shortcuts System: Complete keybinding support with conflict detection and safety features
- 📊 Status Bar Integration: Visual project status indicators with framework-specific icons
- 🔧 Enhanced Command System: New debug and management commands for better control
- ⚙️ Expanded Configuration: Enhanced settings for keybinding and status bar management
- 🛡️ Safety First: Keybindings disabled by default to prevent conflicts with existing shortcuts
[1.0.0] - Initial Release
- Enhanced right-click context menus for Node.js development
- Support for React, Angular, Express, Next.js projects
- TypeScript and JavaScript intelligent code operations
- Copy Function feature with AST-based function detection
- Copy to Existing File with smart import handling
- Move to Existing File with conflict resolution
- Save All functionality with progress feedback
Additional Context Menus is optimized for speed, efficiency, and production-ready reliability:
- ⚡ Lightning Fast Builds: esbuild compilation in ~1 second (20x faster than webpack)
- 📦 Minimal Bundle Size: 24.75KB production bundle (95.9% reduction from 601KB)
- 🔄 Instant Rebuilds: Near-instant watch mode for development
- 🧪 Enterprise-Grade Testing: 37 comprehensive tests with 100% success rate
- 🛡️ Robust Error Handling: Graceful handling of edge cases and extreme conditions
- 📊 Production Ready: Proven reliability under stress testing scenarios
Quality Assurance
Additional Context Menus maintains the highest quality standards through comprehensive testing:
Test Coverage Excellence
- 37 Comprehensive Tests: Covers real-world production scenarios
- 100% Success Rate: All tests pass consistently (37/37 passing)
- Edge Case Testing: Handles extreme conditions like large files, special characters, and rapid operations
- Performance Testing: Stress-tested with nested functions, concurrent operations, and memory pressure
- Configuration Testing: Validated with invalid values, rapid changes, and extreme configurations
Reliability Features
- Error Boundary Protection: Extension continues working even with malformed code or unusual file structures
- Graceful Degradation: Handles unsupported file types and edge cases without crashes
- Concurrent Operation Safety: Multiple commands can execute simultaneously without conflicts
- Memory Efficiency: Optimized for large codebases and complex project structures
Development Quality
- TypeScript Strict Mode: Ensures type safety and catches errors at compile time
- ESLint Compliance: Code adheres to strict linting rules for consistency
- Prettier Formatting: Maintains consistent code style across the entire codebase
- Production Testing: Extensively tested in real-world development environments
Architecture
Additional Context Menus follows a service-oriented architecture with clear separation of concerns:
Core Components
- ExtensionManager - Coordinates extension lifecycle and component initialization
- ContextMenuManager - Handles command registration and menu interactions
Services (Singleton Pattern)
- ProjectDetectionService - Detects Node.js projects and frameworks
- ConfigurationService - Manages extension settings and configuration changes
- FileDiscoveryService - Discovers compatible files for code operations
- FileSaveService - Handles "Save All" functionality with progress feedback
- CodeAnalysisService - Parses and analyzes JavaScript/TypeScript code using Babel parser
Key Features
- Smart Context Menus - Conditionally shown based on project type and file compatibility
- Code Copy/Move Operations - Intelligent import handling and conflict resolution
- Function Extraction - AST-based function detection and copying
- Project Auto-Detection - Analyzes package.json to determine framework support
Contributing
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines.
Development Setup
- Clone the repository
- Run
npm install
to install dependencies
- Run
npm run compile
to build the extension
- Press
F5
to launch Extension Development Host
- Run
npm test
to execute the test suite
Available Commands
npm run compile
- Compile TypeScript using esbuild (⚡ ~1s)
npm run watch
- Watch mode for development with instant rebuilds
npm run package
- Production build with optimizations (~25KB output)
npm run lint
- Run ESLint on src directory
npm run format
- Format code using Prettier
npm test
- Run extension tests
License
This extension is licensed under the MIT License.
Developer
Enjoy! 🚀