vscode-objectql
v3.0.0
Published
Language support for ObjectQL - The Standard Protocol for AI Software Generation
Maintainers
Readme
ObjectQL - Visual Studio Code Extension
![]()
The Standard Protocol for AI Software Generation
Enhance your development experience with ObjectQL metadata files through intelligent code completion, validation, and snippets.
✨ Features
🎯 Intelligent IntelliSense
- Auto-completion for ObjectQL YAML files (
.object.yml,.validation.yml,.permission.yml,.app.yml) - JSON Schema validation with inline error reporting
- Context-aware suggestions based on file type and cursor position
📝 Code Snippets
Object Definition Snippets:
oql-object- Complete object definition templateoql-field-text- Text fieldoql-field-number- Number fieldoql-field-select- Select field with optionsoql-field-lookup- Relationship fieldoql-field-datetime- DateTime fieldoql-field-email- Email fieldoql-field-file- File attachment fieldoql-field-image- Image fieldoql-index- Database index definitionoql-ai-search- AI semantic search configuration
Validation Snippets:
oql-validation-cross-field- Cross-field validationoql-validation-unique- Uniqueness validationoql-validation-business- Business rule validationoql-validation-state- State machine validation
TypeScript Hook & Action Snippets:
oql-hook-beforeCreate- Before create hookoql-hook-afterCreate- After create hookoql-hook-beforeUpdate- Before update hookoql-hook-afterUpdate- After update hookoql-hook-beforeDelete- Before delete hookoql-hook-afterDelete- After delete hookoql-action-record- Record-level actionoql-action-global- Global actionoql-query- Repository queryoql-create- Create recordoql-update- Update record
🎨 File Type Recognition
Custom icons and language associations for ObjectQL metadata files:
*.object.yml- Object definitions*.validation.yml- Validation rules*.permission.yml- Permission rules*.app.yml- Application configuration*.hook.ts- Hook implementations*.action.ts- Action implementations
⚡ Quick Commands
Access via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
- ObjectQL: New Object Definition - Create a new object from template
- ObjectQL: New Validation Rules - Create validation rules file
- ObjectQL: New Permission Rules - Create permission rules file
- ObjectQL: New Application Config - Create app configuration
- ObjectQL: Validate Current File - Validate current ObjectQL file
🔍 Schema Validation
Real-time validation against ObjectQL JSON schemas:
- Syntax checking
- Type validation
- Required field validation
- Enum value validation
- Instant feedback in Problems panel
🚀 Getting Started
Prerequisites
This extension works best with:
- Red Hat YAML extension (
redhat.vscode-yaml) - Recommended for YAML language support
The extension will prompt you to install the YAML extension if it's not already installed.
Installation
From VSIX File
- Download the latest
.vsixfile from releases - Open VS Code
- Go to Extensions (
Ctrl+Shift+X/Cmd+Shift+X) - Click the "..." menu → "Install from VSIX..."
- Select the downloaded
.vsixfile
From Source
cd packages/tools/vscode-objectql
npm install
npm run compile
npm run packageThis creates a vscode-objectql-0.1.0.vsix file that you can install.
📖 Usage
Creating a New Object
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type "ObjectQL: New Object Definition"
- Enter object name (e.g.,
account,project) - A new file is created with a complete template
Example Output:
# ObjectQL Object Definition
name: account
label: Account
description: "Account object"
fields:
name:
type: text
label: Name
required: true
searchable: true
status:
type: select
label: Status
options:
- label: Active
value: active
- label: Inactive
value: inactive
defaultValue: activeUsing Snippets
Start typing in a YAML file:
- Type
oql-field-and see available field snippets - Select the desired field type
- Tab through placeholders to customize
Example - Adding a lookup field:
fields:
owner: # Type 'oql-field-lookup' and press Enter
type: lookup
label: Owner
reference_to: users
required: trueValidation in Real-Time
As you type, the extension validates your YAML against ObjectQL schemas:
- ✅ Valid fields show no errors
- ❌ Invalid fields are underlined in red
- 💡 Hover over errors for detailed messages
- 📋 View all issues in the Problems panel
⚙️ Configuration
Configure the extension through VS Code settings:
{
"objectql.validation.enabled": true,
"objectql.completion.enabled": true,
"objectql.diagnostics.enabled": true,
"objectql.trace.server": "off"
}Settings Reference
| Setting | Type | Default | Description |
|---------|------|---------|-------------|
| objectql.validation.enabled | boolean | true | Enable schema validation |
| objectql.completion.enabled | boolean | true | Enable auto-completion |
| objectql.diagnostics.enabled | boolean | true | Enable diagnostics |
| objectql.trace.server | string | "off" | Language server trace level |
🎓 Examples
Complete Object with Validation
name: opportunity
label: Opportunity
description: "Sales opportunity tracking"
fields:
name:
type: text
label: Opportunity Name
required: true
searchable: true
amount:
type: currency
label: Amount
min: 0
close_date:
type: date
label: Close Date
required: true
stage:
type: select
label: Stage
options:
- label: Prospecting
value: prospecting
- label: Qualification
value: qualification
- label: Proposal
value: proposal
- label: Closed Won
value: closed_won
- label: Closed Lost
value: closed_lost
defaultValue: prospecting
account:
type: lookup
label: Account
reference_to: accounts
required: true
validation:
rules:
- name: positive_amount
type: cross_field
message: "Amount must be positive"
rule:
field: amount
operator: ">"
value: 0
trigger: [create, update]
indexes:
stage_date:
fields: [stage, close_date]🔗 Resources
- Documentation: ObjectQL Docs
- Repository: GitHub
- Issues: Report a Bug
- Website: objectql.org
🤝 Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
For Maintainers: Publishing
This extension is automatically published to the VSCode Marketplace using GitHub Actions. See PUBLISHING.md for detailed instructions on:
- Configuring VSCode Marketplace credentials
- Publishing via GitHub Actions workflow
- Version management
- Testing before publishing
📄 License
MIT License - see LICENSE for details.
🙏 Acknowledgments
- Built on the ObjectQL protocol and runtime
- Uses Red Hat YAML extension for YAML language support
- Part of the ObjectStack AI ecosystem
ObjectQL • ObjectOS • Object UI
The Trinity of AI-Native Software Generation
