Organelle Language Support for VS Code
IntelliSense, syntax highlighting, and code snippets for Euglena .organelle files.
Features
Syntax Highlighting
- Full syntax highlighting for
.organelle DSL
- Rust code highlighting within organelle blocks
- Special highlighting for
emit! macro and organelle keywords
IntelliSense
- Auto-completion for organelle keywords, properties, and macros
- Hover documentation for organelle constructs
- Signature help for
emit! macro
- Code snippets for common patterns
Snippets
Type these prefixes and press Tab:
organelle - Create a new organelle template
organelle-deps - Create an organelle with dependencies
match - Particle class match pattern
getdata - Extract data from particle
emit - Emit a new particle
input - Define input classes
output - Define output classes
effects - Define effects
deps - Define dependencies
log - Print log message
error - Print error message
Validation
Real-time validation with warnings for:
- Missing organelle definition
- Missing required properties (input_classes, output_classes, effects)
- Missing process function
Document Symbols
Quickly navigate organelle definitions using:
- Outline view
- Go to Symbol (
Ctrl+Shift+O / Cmd+Shift+O)
- Breadcrumbs
Example
use reqwest;
organelle HttpClient {
input_classes: ["Get", "Post"],
output_classes: ["HttpResponse"],
effects: ["http"],
dependencies: ['reqwest = { version = "0.11" }'],
fn process(particle: Particle) {
match particle.class.as_str() {
"Get" => {
let url = particle.data.get("url")
.and_then(|v| v.as_str())
.unwrap_or("");
emit!("HttpResponse",
"status" => 200,
"url" => url
);
},
_ => {}
}
}
}
Requirements
Installation
From VSIX
- Download the
.vsix file
- Open VS Code
- Go to Extensions view (
Ctrl+Shift+X / Cmd+Shift+X)
- Click
... menu → Install from VSIX...
- Select the downloaded file
From Source
cd vscode-organelle-extension
npm install
npm run compile
npm run package
code --install-extension organelle-language-0.1.0.vsix
Development
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension
npm run package
Publishing to VS Code Marketplace
- Create a publisher account at https://marketplace.visualstudio.com/manage
- Get a Personal Access Token from Azure DevOps
- Login:
vsce login <publisher-name>
- Publish:
vsce publish
Or publish manually:
vsce package
# Upload the .vsix file to marketplace
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT