Auto-Rebase VS Code Extension
A VS Code extension that provides a GUI interface for the auto-rebase tool, which re-targets feature customizations when base software updates.
Features
- Sidebar Panel: Custom sidebar view with folder selection interface
- Progress Visualization: Real-time progress indicators during rebasing process
- File Tree Display: Expandable tree showing all project files with status indicators
- Four-Way Diff Viewer: Diamond layout diff viewer showing:
- Base 1.0 (Old Base) - Top
- Base 1.1 (New Base) - Left
- Feature 5.0 (Original Feature) - Right
- Feature 5.1 (Rebased Result) - Bottom
- Configuration Management: Save/load configuration presets
- Export Reports: HTML diff reports and JSON trace files
Installation
Prerequisites
- Python 3.11+ with the auto-rebase project installed
- Node.js 18+ for building the extension
- VS Code 1.74+
Build the Extension
Navigate to the extension directory:
cd vscode-extension
Install dependencies:
npm install
Compile TypeScript:
npm run compile
Package the extension (optional):
npx vsce package
Install the Extension
From VSIX file (if packaged):
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click "..." menu → "Install from VSIX..."
- Select the generated
.vsix
file
From source (for development):
- Open VS Code
- Press F5 to launch Extension Development Host
- The extension will be loaded in a new VS Code window
Usage
Configuration
- Open the Auto-Rebase sidebar panel
- Configure the following paths:
- Old Base: Path to the original base software (e.g.,
/data/sample/base-1.0
)
- New Base: Path to the updated base software (e.g.,
/data/sample/base-1.1
)
- Feature: Path to the feature to rebase (e.g.,
/data/sample/feature-5.0
)
- Requirements Map: Path to the requirements mapping file (e.g.,
/data/sample/requirements_map.yaml
)
- Output Directory: Where to save the rebased results
Running Auto-Rebase
- Click "Run Auto-Rebase" button
- Monitor progress in the sidebar and output channel
- View results in the file tree
- Click on files to open the four-way diff viewer
Four-Way Diff Viewer
The diff viewer shows:
- Top: Original base (Base 1.0)
- Left: Updated base (Base 1.1)
- Right: Original feature (Feature 5.0) with requirements mapping
- Bottom: Rebased result (Feature 5.1)
AI Rebase (Future Feature)
The AI Rebase feature requires an OpenAI API key:
- Enter your API key when prompted
- The key is saved securely in VS Code settings
- AI suggestions will appear in the diff viewer
Commands
The extension provides several commands accessible via Command Palette (Ctrl+Shift+P):
Auto-Rebase: Run Auto-Rebase
- Execute the rebase process
Auto-Rebase: Run AI Rebase
- Execute AI-assisted rebase
Auto-Rebase: Open Diff View
- Open four-way diff viewer
Auto-Rebase: Select Folder
- Browse for folder selection
Auto-Rebase: Select File
- Browse for file selection
Auto-Rebase: Refresh File Tree
- Refresh the file tree display
Configuration
The extension can be configured via VS Code settings:
{
"autorebase.pythonPath": "python",
"autorebase.openaiApiKey": "",
"autorebase.defaultPaths": {
"oldBase": "/data/sample/base-1.0",
"newBase": "/data/sample/base-1.1",
"feature": "/data/sample/feature-5.0",
"requirementsMap": "/data/sample/requirements_map.yaml"
}
}
Development
Project Structure
vscode-extension/
├── src/
│ ├── extension.ts # Main extension entry point
│ ├── providers/
│ │ ├── sidebarProvider.ts # Sidebar tree data provider
│ │ └── diffViewProvider.ts # Diff viewer webview provider
│ ├── commands/
│ │ └── rebaseCommands.ts # Command implementations
│ └── views/
│ └── sidebar.html # Sidebar HTML template
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
└── README.md # This file
Building
# Watch mode for development
npm run watch
# One-time build
npm run compile
# Package for distribution
npx vsce package
Testing
- Press F5 to launch Extension Development Host
- Test the extension functionality
- Check the output channel for logs
Troubleshooting
Common Issues
- Python not found: Ensure Python is in your PATH or configure
autorebase.pythonPath
- Permission errors: Ensure the extension has access to the configured directories
- CLI commands fail: Verify the auto-rebase CLI module is properly installed
Debugging
- Open the Output panel
- Select "Auto-Rebase" from the dropdown
- Check for error messages and logs
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
License
This extension is part of the auto-rebase project and follows the same license terms.