VS Code language support for the Forger DSL used by ForgerAPI to generate NestJS and Prisma code.
Features
- Syntax highlighting for models, enums, actions, guards, modules, annotations, primitive/reference types, and HTTP methods.
- Language Server support for diagnostics, completion, hover, semantic tokens, folding, and go to definition.
- Bracket matching, automatic closing pairs, indentation, comments, and region folding.
- File associations for
.forgerand.forge.
Supported syntax
enum Role {
USER
ADMIN
}
model User {
id: uuid @id @default(uuid)
email: string @unique
role: Role
}
guard AuthGuard { import: "@nestjs/passport" }
module Auth {
route: "/auth"
models: User
guards: AuthGuard
action Login {
route: "/login"
method: POST
input: [email: string, password: string]
steps: validateUser signToken
emits: UserLoggedIn
}
}
The syntax follows the ForgerAPI language reference in the sibling forgerapi repository. The bundled language server is built from @forgerapi/lsp, so building this extension requires that repository at ../forgerapi.
Development
npm install
npm run check
npm run package
Press F5 in VS Code to launch an Extension Development Host.