Morph ORM - VS Code / Cursor / Antigravity Extension
Prisma-style Schema tooling, Syntax Highlighting, Formatter, Linter, Snippets, and Generator for Morph ORM in Flutter & Dart.
⚡ Features
- 🎨 Full Syntax Highlighting:
- Highlights
model, enum, datasource, and generator declarations.
- Recognizes primitive types (
String, Int, Boolean, DateTime, Float, Json, Bytes, BigInt), arrays ([]), and optionals (?).
- Distinguishes field attributes (
@id, @default, @relation, @unique, @updatedAt, @map) and model attributes (@@map, @@unique, @@index, @@id).
- 📐 Column-Aligned Auto Formatter:
- Automatically aligns field names, types, and attributes into neat columns (just like Prisma!).
- Triggered with Format Document (
Shift + Alt + F / Shift + Option + F) or Format on Save.
- 🔍 Live Schema Diagnostics & Linter:
- Instant error detection: catches unclosed braces, duplicate model names, duplicate fields, unrecognized types, and missing
@id primary keys.
- 💡 Rich IntelliSense & Autocomplete:
- Autocompletes directives with
@ and @@.
- Suggests primitive types and declared models for relation fields.
- Suggests default functions (
uuid(), now(), autoincrement()).
- 📖 Interactive Hover Documentation:
- Hover over attributes, types, and keywords to read explanations and examples.
- ⚡ CodeLens & Shortcuts:
- Direct
▶ Generate Client and 🔄 Convert to Dart DSL buttons above model blocks.
- 📦 Morph CLI Integration:
- Integrated commands to trigger
dart run morph generate and dart run morph convert.
🛠️ Commands
| Command |
Description |
Morph: Generate Dart Client & Models |
Runs dart run morph generate to compile models and MorphClient. |
Morph: Convert Schema to Dart Code-First DSL |
Converts .morph schema into Dart DSL. |
Morph: Convert Dart DSL to Morph Schema |
Converts Dart DSL back to .morph schema. |
Morph: Format Schema Document |
Aligns columns and formats active .morph file. |
🚀 Installation
In VS Code / Cursor / Antigravity:
- Build the
.vsix package:
cd vscode-extension
npm install
npm run build
npx @vscode/vsce package --no-dependencies
- Install in your editor:
- VS Code: Run
code --install-extension morph-orm-0.1.0.vsix or open the Extensions view -> ... -> Install from VSIX...
- Cursor: Open Extensions ->
... -> Install from VSIX...
- Antigravity: Open Extensions ->
... -> Install from VSIX...
⚙️ Extension Settings
| Setting |
Default |
Description |
morph.schemaPath |
schema.morph |
Path to Morph schema relative to workspace root |
morph.outputPath |
lib/generated/morph_client.dart |
Output path for the generated Dart client |
morph.enableDiagnostics |
true |
Enable live schema syntax and linter checks |
morph.enableCodeLens |
true |
Display CodeLens buttons above models |
| |