A Visual Studio Code extension that enables quick source code comparison using simple .srcc files. Compare two files side-by-side with automatic diff view opening and syntax highlighting support.
- Simple File Format: Create
.srccfiles with just two file paths (one per line) - Automatic Path Resolution: Supports both absolute and relative paths
- Intelligent File Detection: Automatically detects and validates file existence
- Auto-Open Diff: Automatically open diff view when
.srccfiles are opened (configurable) - Error Handling: Clear error messages for invalid paths or missing files
- VS Code Version: 1.106.1 or higher
- Node.js: No additional Node.js dependencies required for end users
- File System Access: Extension needs to read file paths and open files for comparison
- Open Visual Studio Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Search for "SRCC"
- Click Install
# Clone the repository
git clone https://github.com/rainbowatcher/srcc.git
cd srcc
# Install dependencies
npm install
# Compile the extension
npm run compile
# Install the extension locally
code --install-extension srcc-<version>.vsix- Download the
.vsixfile from the releases page - In VS Code: Extensions โ Install from VSIX...
- Select the downloaded
.vsixfile
- Create a new file with
.srccextension (e.g.,comparison.srcc) - Write two file paths, one per line:
/path/to/left-file.js
/path/to/right-file.js
Or using relative paths:
./src/old-version.js
./src/new-version.js
- Save the file - the diff view opens automatically (if auto-open is enabled)
/Users/username/project/src/file1.js
/Users/username/project/src/file2.js
./src/feature-a.js
./src/feature-b.js
This extension contributes the following settings:
- Type:
boolean - Default:
true - Description: Automatically open the diff view when opening
.srccfiles
To modify this setting:
- Open VS Code User Settings (
Ctrl+,/Cmd+,) - Search for "srcc"
- Toggle the
Auto Open Diffsetting
Or add to your settings.json:
{
"srcc.autoOpenDiff": false
}hello.js
world.js
./src/main-branch.js
./src/feature-branch.js
config/production.json
config/development.json
- Line 1: Path to the left/base file (displayed on the left side in diff)
- Line 2: Path to the right/comparison file (displayed on the right side in diff)
- Absolute paths: Used as-is
- Relative paths: Resolved relative to the
.srccfile's directory - File validation: Both files must exist before opening diff view
"File does not exist" error
- Ensure file paths are correct and accessible
- Check if files exist at the specified locations
- Verify read permissions for the files
Diff view not opening
- Check the
srcc.autoOpenDiffsetting is enabled - Verify both files exist and are readable
- Try manually opening files first to ensure VS Code can access them
Syntax highlighting not working
- Ensure the file has
.srccextension - Check VS Code language mode is set to "Source Compare"
- Try reloading the window (
Ctrl+Shift+Pโ "Developer: Reload Window")
We welcome contributions to improve the SRCC extension!
# Clone and setup
git clone https://github.com/your-repo/srcc-vscode-extension.git
cd srcc-vscode-extension
npm install
# Development
npm run build # Build TypeScript
npm run watch # Watch for changes
# Testing
# Open test files in VS Code and verify functionalityAdd .srcc test files to the test/ directory following the naming pattern test*.srcc.
- Update version in
package.json - Build and test the extension
- Create a new release on GitHub
- Publish to VS Code Marketplace using
vsce publish
MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions