FBORM Syntax Highlighter
A Visual Studio Code extension that provides syntax highlighting for FBORM (Firebird ORM) schema files. FBORM is a schema definition language similar to Prisma, designed for mapping TypeScript-like models to SQL database structures.
Features
This extension provides comprehensive syntax highlighting for .fborm
files including:
- Model definitions - Highlights
model
keyword and model names
- Field definitions - Syntax highlighting for field names, types, and optional markers
- Decorators - Full support for decorators like
@map
, @pk
, @relation
, @default
- Type system - Highlights primitive types (
string
, number
, boolean
, date
) and custom model types
- Relationships - Special highlighting for relation syntax with
fields
and references
- Comments - Support for both single-line (
//
) and block (/* */
) comments
- Operators and punctuation - Proper highlighting for optional operators (
?
), arrays ([]
), and other syntax elements
Example FBORM Schema
@map(USER)
model user {
id: number @map(id) @pk
name: string @map(name)
email?: string @map(email)
is_active: string @map(active) @default("S")
// Relationships
company_id: number @map(company)
company: company @relation(fields: [company_id], references: [id])
}
@map(COMPANY)
model company {
id: number @map(id) @pk
legal_name: string @map(legal_name)
active: string @map(active) @default("S")
users: user[]
}
Supported Syntax Elements
Models
model
keyword for defining data models
- Model names with proper entity highlighting
- Block structure with braces
Decorators
@map()
- Maps model/field names to database table/column names
@pk
- Marks primary key fields
@default()
- Sets default values
@relation()
- Defines relationships between models
- And other standard decorators
Field Types
- Primitive types:
string
, number
, boolean
, date
- SQL-style types:
String
, Int
, Float
, DateTime
- Custom model types for relationships
- Array notation with
[]
- Optional fields with
?
Relationships
- One-to-many relationships (
model[]
)
- Foreign key definitions
fields
and references
arrays in @relation
decorators
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "FBORM Syntax Highlighter"
- Click Install
From VSIX file
- Download the
.vsix
file from the releases page
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Click the "..." menu and select "Install from VSIX..."
- Select the downloaded
.vsix
file
Usage
- Create or open a file with the
.fborm
extension
- The syntax highlighting will be automatically applied
- If the highlighting doesn't activate, you can manually set the language:
- Press
Ctrl+Shift+P
- Type "Change Language Mode"
- Select "FBORM" from the list
Language Configuration
The extension includes language configuration for:
- Auto-closing brackets, braces, and parentheses
- Comment toggling with
Ctrl+/
- Proper indentation rules
- Word pattern recognition for better text navigation
Requirements
- Visual Studio Code version 1.74.0 or higher
- No additional dependencies required
Extension Settings
This extension does not add any VS Code settings. It works out of the box with .fborm
files.
Known Issues
Currently no known issues. If you encounter any problems, please report them on the GitHub issues page.
Contributing
Contributions are welcome! Please feel free to submit issues and pull requests on the GitHub repository.
Release Notes
0.1.0
Initial release of FBORM Syntax Highlighter
- Complete syntax highlighting for FBORM schema files
- Support for all major FBORM language constructs
- Model definitions with decorators
- Field types and relationships
- Comments and string literals
- Proper punctuation and operator highlighting
Development
Working with the Extension
If you want to contribute to this extension:
- Clone the repository
- Open in VS Code
- Press
F5
to launch a new Extension Development Host window
- Create or open
.fborm
files to test the syntax highlighting
Building and Publishing
- Install dependencies:
npm install
- Package the extension:
vsce package
- Publish to marketplace:
vsce publish
License
This extension is licensed under the MIT License.
Enjoy coding with FBORM!