Nautilus Schema — VS Code Extension
Language support for the Nautilus schema DSL (*.nautilus files).
Features
- Syntax highlighting — keywords, types, attributes (
@, @@), strings, numbers, comments
- Snippets —
model, enum, datasource, generator, @relation, and all common attributes
- Bracket matching — auto-close and surround for
{}, [], ()
- Comment toggling —
// line and /* block */ via Ctrl+/ / Shift+Alt+A
Supported Syntax
// schema.nautilus
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "nautilus-client-py" // or "nautilus-client-rs", "nautilus-client-js"
output = "db"
}
enum Role {
USER
ADMIN
MODERATOR
}
enum OrderStatus {
PENDING
CONFIRMED
SHIPPED
DELIVERED
CANCELLED
}
type Address {
street String
city String
zip String
country String
}
model User {
id Uuid @id @default(uuid())
email String @unique
username VarChar(30) @unique
name String
role Role @default(USER)
bio String?
tags String[]
address Address?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
profile Profile?
orders Order[]
@@index([email], type: Hash)
@@index([createdAt], type: Brin, map: "idx_users_created")
@@map("users")
}
model Profile {
id Int @id @default(autoincrement())
userId Uuid @unique @map("user_id")
avatar String?
website VarChar(255)?
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
@@map("profiles")
}
model Product {
id BigInt @id @default(autoincrement())
name String
slug VarChar(100) @unique
description String?
price Decimal(10, 2) @check(price > 0)
discount Decimal(5, 2) @default(0)
finalPrice Decimal(10, 2) @computed(price - discount, Stored) @map("final_price")
stock Int @default(0) @check(stock >= 0)
tags String[]
metadata Json?
active Boolean @default(true)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
orderItems OrderItem[]
@@index([tags], type: Gin)
@@index([name, slug])
@@map("products")
}
model Order {
id BigInt @id @default(autoincrement())
userId Uuid @map("user_id")
status OrderStatus @default(PENDING)
totalAmount Decimal(12, 2) @map("total_amount")
note String?
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
user User @relation(fields: [userId], references: [id], onDelete: Restrict)
items OrderItem[]
@@check(totalAmount > 0)
@@index([userId, status])
@@index([createdAt], type: Brin, map: "idx_orders_created")
@@map("orders")
}
model OrderItem {
id BigInt @id @default(autoincrement())
orderId BigInt @map("order_id")
productId BigInt @map("product_id")
quantity Int @check(quantity > 0)
unitPrice Decimal(10, 2) @map("unit_price")
lineTotal Decimal(12, 2) @computed(quantity * unitPrice, Stored) @map("line_total")
order Order @relation(fields: [orderId], references: [id], onDelete: Cascade)
product Product @relation(fields: [productId], references: [id], onDelete: Restrict)
@@unique([orderId, productId])
@@map("order_items")
}
Installation
Option A — From a GitHub Release (recommended)
- Go to the latest release and download the
.vsix file.
- In VS Code: Extensions → ⋯ → Install from VSIX… and pick the downloaded file.
- On first activation, the extension automatically downloads the
nautilus-lsp binary for your platform (macOS arm64/x64, Linux x64, Windows x64) and caches it in VS Code's global storage. A progress notification will appear briefly.
Option B — Manual binary override
If you prefer to manage the binary yourself (e.g. a custom build or a company-internal distribution):
// .vscode/settings.json (or user settings)
{
"nautilus.lspPath": "/absolute/path/to/nautilus-lsp"
}
The extension will use that path instead of the auto-downloaded binary.
Option C — Local development (F5)
cargo build -p nautilus-lsp — builds the debug binary at target/debug/nautilus-lsp.
- Open the
tools/vscode-nautilus-schema/ folder in VS Code and press F5.
The extension automatically picks up the debug binary from the repo root.
Configuration
| Setting |
Default |
Description |
nautilus.lspPath |
"" |
Absolute path to the nautilus-lsp binary. Empty = auto-resolve. |