Julia ↔ MATLAB Converter VS Code Extension
🚀 Professional VS Code extension for seamless Julia ↔ MATLAB code conversion with live preview and right-click convenience.
✨ Features
🖱️ Right-Click Conversion
- Right-click any
.jl
file → "Convert to MATLAB"
- Right-click any
.m
file → "Convert to Julia"
- Works in both file explorer and editor
⚡ Command Palette Integration
Julia↔MATLAB: Convert to MATLAB
- Convert current Julia file
Julia↔MATLAB: Convert to Julia
- Convert current MATLAB file
Julia↔MATLAB: Show Live Preview
- Open live preview panel
Julia↔MATLAB: Open Converter Panel
- Open converter sidebar
👁️ Live Preview
- Real-time conversion preview as you type
- Side-by-side comparison
- Syntax highlighting for both languages
- Auto-updates when switching files
📋 Converter Panel
- Dedicated sidebar with conversion tools
- Quick convert buttons
- Batch conversion options
- Settings access
⚙️ Smart Features
- Auto-detection of file types
- Configurable output file naming
- Safe operations (never overwrites originals)
- Professional error handling
🛠️ Installation
Method 1: Development Installation
Clone or copy the extension folder:
cd vscode-extension
Install dependencies:
npm install
Compile TypeScript:
npm run compile
Install in VS Code:
- Open VS Code
- Press
Ctrl+Shift+P
(or Cmd+Shift+P
on Mac)
- Type "Extensions: Install from VSIX"
- Navigate to the extension folder and select the generated
.vsix
file
Method 2: Development Mode
Open in VS Code:
code vscode-extension
Run in Extension Development Host:
- Press
F5
to launch a new Extension Development Host window
- The extension will be loaded automatically
🚀 Usage
Quick Conversion
Right-click method:
- Open any
.jl
or .m
file
- Right-click in the editor or file explorer
- Select "Convert to MATLAB" or "Convert to Julia"
Command palette method:
- Open a Julia or MATLAB file
- Press
Ctrl+Shift+P
- Type "Julia" and select your conversion command
Live Preview
Automatic preview:
- Open any
.jl
or .m
file
- The live preview panel opens automatically
- See real-time conversion as you edit
Manual preview:
- Use command palette: "Julia↔MATLAB: Show Live Preview"
- Or click the preview icon in the editor title bar
Converter Panel
Open the panel:
- Click the Julia↔MATLAB icon in the activity bar
- Or use command palette: "Julia↔MATLAB: Open Converter Panel"
Use quick actions:
- Expand "Quick Convert" for single file conversion
- Expand "Batch Convert" for multiple files
- Click "Live Preview" for instant preview
- Access "Settings" for configuration
⚙️ Configuration
Access settings via:
- Converter panel → Settings
- VS Code Settings → Extensions → Julia↔MATLAB Converter
Available Settings:
juliaMatlab.autoPreview
(default: true
)
- Automatically show preview when opening Julia/MATLAB files
juliaMatlab.outputSuffix
(default: "_converted"
)
- Suffix added to converted file names
juliaMatlab.enableSyntaxHighlighting
(default: true
)
- Enable syntax highlighting in preview panels
🎯 Supported File Types
- Julia files:
.jl
- MATLAB files:
.m
🔧 Requirements
- VS Code 1.74.0 or higher
- Python 3.7+ (for conversion backend)
- Julia ↔ MATLAB Converter CLI (included)
🐛 Troubleshooting
Common Issues
"No Python found"
- Ensure Python is installed and in PATH
- Update
conversionService.ts
with correct Python path
"CLI not found"
- Verify the CLI script path in
conversionService.ts
- Ensure
jm_cli.py
is accessible
"Conversion failed"
- Check that the source file is valid Julia/MATLAB code
- Verify file permissions
- Check VS Code output panel for detailed errors
Debugging
Enable developer tools:
- Help → Toggle Developer Tools
- Check Console for errors
Check extension host:
- View → Output → Extension Host
🎨 Customization
Custom Keybindings
Add to your keybindings.json
:
[
{
"key": "ctrl+shift+j",
"command": "juliaMatlab.convertToJulia",
"when": "resourceExtname == .m"
},
{
"key": "ctrl+shift+m",
"command": "juliaMatlab.convertToMatlab",
"when": "resourceExtname == .jl"
},
{
"key": "ctrl+shift+p",
"command": "juliaMatlab.showPreview",
"when": "resourceExtname == .jl || resourceExtname == .m"
}
]
Custom Themes
The extension respects VS Code themes and uses appropriate colors for:
- Julia syntax (purple theme)
- MATLAB syntax (blue theme)
- Preview panels
- Status indicators
📈 Features Roadmap
- ✅ Right-click conversion
- ✅ Live preview
- ✅ Command palette integration
- ✅ Converter sidebar panel
- 🔄 Batch conversion UI
- 🔄 Syntax highlighting in preview
- 🔄 Diff view for conversions
- 🔄 Conversion history
- 🔄 Custom conversion templates
🤝 Contributing
This extension is part of the Julia2MATLAB project. Contributions welcome!
📄 License
MIT License - see project root for details.
🎯 Perfect for: Scientific computing, algorithm porting, code migration, and multi-language workflows!