DSLForge
DSLForge is a VS Code extension for Copilot-assisted DSL authoring across Langium, ANTLR4, and Xtext workspaces.
It helps language engineers generate, explain, and iterate on DSL grammars inside VS Code without pretending to replace the underlying DSL engine. DSLForge detects the active grammar context, keeps AI features focused on explicit authoring tasks, and routes validation through the workspace's real command path so generated ideas can be checked against the actual project workflow.
Current Status
DSLForge is currently a pre-release extension.
- current branch work supports Langium, ANTLR4, and Xtext workflows
- AI commands are the primary authoring-assistance surface for scaffold, explanation, and sample generation
Validate Current Grammar is intentionally non-AI
- AI commands require GitHub Copilot or another supported VS Code model environment
- if AI access is unavailable, DSLForge stops and shows guidance instead of inventing a fake fallback
Features
- explains current grammars and generates scaffold or sample proposals through supported VS Code model access
- detects the current Langium, ANTLR4, or Xtext workspace and grammar context
- follows import-aware grammar context selection for Langium, reference-aware context selection for ANTLR4, and workflow-aware context selection for Xtext
- resolves validation from the real workspace in this order:
dslforge.validation.command
- auto-detected supported
package.json script
- auto-detected
gradlew task
- auto-detected
mvnw goal
- setup guidance
- publishes normalized diagnostics into Problems
- uses AI only for explicit DSL authoring tasks instead of generic coding assistance
- exposes grammar actions from editor and Explorer context menus in addition to the Command Palette
- lets reviewed AI preview documents move toward workspace files through an explicit diff-and-apply flow
What DSLForge Does Not Do
- it does not replace Langium, ANTLR4, or Xtext
- it does not try to be a generic AI coding copilot
- it does not fake a validation engine when the workspace has not defined one
- it does not fake AI output when no supported model environment is available
Install
After the Marketplace listing is live, install DSLForge from VS Code Marketplace.
Until then, you can evaluate it locally:
- run
npm install
- run
npm exec -- vsce package
- install the generated
dslforge-0.3.1.vsix in VS Code
One-Minute Flow
- Open a Langium, ANTLR4, or Xtext workspace.
- Open the grammar file you are working on.
- Run
DSLForge: Explain Current Grammar, Create DSL Scaffold, or Generate Sample DSL when GitHub Copilot or another supported model is available.
- Run
DSLForge: Validate Current Grammar to check the grammar through the workspace's real validation command path.
- If DSLForge cannot resolve validation, set
dslforge.validation.command or add a supported package.json script, gradlew task, or mvnw goal.
Scaffold-only bootstrap flow:
- Open any trusted workspace folder, even if it does not contain a detected DSL yet.
- Run
DSLForge: Create DSL Scaffold.
- Review the proposal before creating files manually.
Recommended first local check from this repository:
- open
test-fixtures/langium/configured-command
- open
src/language/configured.langium
- run
DSLForge: Validate Current Grammar
Expected result:
- DSLForge selects the configured validation command first
- validation output is streamed to the Output panel
- normalized diagnostics are surfaced in Problems
Commands
Non-AI:
DSLForge: Validate Current Grammar
AI-backed authoring assistance:
DSLForge: Explain Current Grammar
DSLForge: Create DSL Scaffold
DSLForge: Generate Sample DSL
Create DSL Scaffold can run in two modes:
- detected-workspace mode when DSLForge recognizes a Langium, ANTLR4, or Xtext context
- bootstrap mode when the workspace is open but no supported DSL framework has been detected yet
Validation Behavior
Validate Current Grammar is intentionally non-AI.
Validation priority:
dslforge.validation.command
- supported
package.json script auto-detection
- supported
gradlew task auto-detection
- supported
mvnw goal auto-detection
- setup guidance
This keeps DSLForge aligned with the workspace's real build and CI behavior instead of inventing an internal validation path that does not match the project.
AI Limits
The following commands require GitHub Copilot or another supported VS Code model environment:
Explain Current Grammar
Create DSL Scaffold
Generate Sample DSL
If model access is unavailable, DSLForge:
- stops before making any model request
- shows setup or sign-in guidance
- records the AI gate result in the Output channel
- does not create a fake preview document
Adapter Scope
Current implemented adapters in this branch:
Current responsibilities:
- project detection
- context selection
- validation orchestration
- diagnostics presentation
Next adapter work after this branch:
- later target: Generic mode
Settings
Current extension settings:
dslforge.validation.command
dslforge.validation.maxCapturedOutputCharacters
dslforge.ai.maxContextFiles
dslforge.ai.maxCharactersPerFile
dslforge.ai.maxContextCharacters
dslforge.telemetry.enabled
dslforge.telemetry.endpointOverride
Telemetry
DSLForge can send minimal product telemetry through a server-side proxy when telemetry is enabled.
Telemetry behavior:
- DSLForge always respects VS Code telemetry enablement
dslforge.telemetry.enabled can further disable extension telemetry
- released builds can embed a proxy endpoint through
DSLFORGE_TELEMETRY_PROXY_ENDPOINT at package time
dslforge.telemetry.endpointOverride or runtime DSLFORGE_TELEMETRY_ENDPOINT can override that endpoint for local validation
- the client never stores the PostHog project key directly
Telemetry scope:
- command and workflow events such as extension activation, AI gate results, validation runs, AI document generation, and reviewed preview apply flows
- coarse counts such as context file count, issue count, duration, and apply target count
- no grammar file content, prompts, workspace file paths, or raw validation output are intentionally sent
Proxy deployment:
- deploy this repository to Vercel
- set the Vercel environment variable
POSTHOG_PROJECT_API_KEY
- optionally set
POSTHOG_HOST, TELEMETRY_RATE_LIMIT_WINDOW_MS, and TELEMETRY_RATE_LIMIT_MAX_EVENTS
- set the GitHub repository variable
DSLFORGE_TELEMETRY_PROXY_ENDPOINT to your production URL such as https://your-project.vercel.app/api/telemetry
- publish the extension from CI so the packaged VSIX embeds that proxy endpoint
Development
Useful commands:
npm run build
npm run typecheck
npm run test
npm run test:diagnostics
npm run test:projects
npm run test:manifest
npm exec -- vsce package
Release notes live in CHANGELOG.md.