IDE Setup
IDE Setup
To get the best experience developing with ObjectQL, we recommend Visual Studio Code equipped with the official toolset. This setup provides you with an "AI-like" development experience with intelligent auto-completion, real-time validation, and instant code generation.
Visual Studio Code Extension
The Standard ObjectStack AI Extension transforms VS Code into a dedicated IDE for ObjectQL.
Core Features
-
Metadata Generators ⚡
- Instantly scaffold new files using the Command Palette.
- Supported templates: Object Definitions, Validation Rules, Permission Policies, App Configurations.
- Usage:
Cmd+Shift+P-> TypeObjectQL: New...
-
Intelligent IntelliSense 🧠
- Schema-Aware: The extension understands the full ObjectQL protocol (
@objectql/types). - Auto-Completion: Get suggestions for valid field types (
text,select,lookup...), column options, and relationship targets. - Validation: Real-time red-line error reporting for missing required fields or invalid types according to the strict schema.
- Schema-Aware: The extension understands the full ObjectQL protocol (
-
Smart Snippets 📝
- Type
oql-to trigger a rich library of snippets. - Objects:
oql-field-lookup,oql-field-select,oql-index - Logic:
oql-hook-beforeCreate,oql-action-record - Validation:
oql-validation-business
- Type
Installation
Option 1: VS Code Marketplace (Recommended)
Search for "ObjectQL" in the Extensions view (Cmd+Shift+X) and install.
Option 2: Install from VSIX (For Enterprise/Offline)
If you are building from source or using a private build:
- Run
pnpm run packageinpackages/tools/vscode-objectql. - In VS Code, run command: "Extensions: Install from VSIX..."
- Select the generated
.vsixfile.
Recommended Usage
To maximize productivity, we recommend the following workflow:
-
Create an Object: Run "ObjectQL: New Object Definition". Enter a name (e.g.,
invoice). Result:src/objects/invoice.object.ymlis created with standard fields definitions. -
Add Fields: Open the file and use Snippets.
- Type
oql-field-lookup-> tab -> auto-fills a relationship field structure. - Type
oql-index-> tab -> adds a database index.
- Type
-
Validate: The extension runs silently in the background. If you see red squiggles, hover over them to see exactly which protocol rule was violated (e.g., "Field 'required' must be a boolean").
Other Essential Extensions
The ObjectQL extension automatically configures these for you, but they are worth noting:
-
- Why: The engine behind our schema validation.
- Config: Our extension automatically injects ObjectQL schemas into this plugin's settings.
-
- Why: For formatting your TypeScript Logic Hooks (
*.hook.ts).
- Why: For formatting your TypeScript Logic Hooks (
Workspace Settings
For teams working on ObjectQL projects, we recommend committing a .vscode/extensions.json file to suggest these tools to all developers:
Git Configuration
PNPM Lock File Merge Driver
To avoid manual merge conflicts in pnpm-lock.yaml, run the setup script after cloning the repository:
This configures Git to automatically regenerate the lock file when conflicts occur by running pnpm install.
Manual Configuration:
If you prefer to configure manually, run:
AI Assistant Configuration
ObjectQL is designed to be "AI-Native". The most efficient way to write schema and hooks is by pairing with an LLM.
We strongly recommend configuring your AI Coding Assistant (GitHub Copilot, Cursor, Windsurf) with our specialized System Prompts. These prompts teach the AI about ObjectQL's metadata protocol.