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.
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 Grammaris 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
- 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.jsonscript - auto-detected
gradlewtask - auto-detected
mvnwgoal - 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
- 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
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.2.vsixin VS Code
- Open a Langium, ANTLR4, or Xtext workspace.
- Open the grammar file you are working on.
- Run
DSLForge: Explain Current Grammar,Create DSL Scaffold, orGenerate Sample DSLwhen GitHub Copilot or another supported model is available. - Run
DSLForge: Validate Current Grammarto check the grammar through the workspace's real validation command path. - If DSLForge cannot resolve validation, set
dslforge.validation.commandor add a supportedpackage.jsonscript,gradlewtask, ormvnwgoal.
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
Non-AI:
DSLForge: Validate Current Grammar
AI-backed authoring assistance:
DSLForge: Explain Current GrammarDSLForge: Create DSL ScaffoldDSLForge: 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
Validate Current Grammar is intentionally non-AI.
Validation priority:
dslforge.validation.command- supported
package.jsonscript auto-detection - supported
gradlewtask auto-detection - supported
mvnwgoal 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.
The following commands require GitHub Copilot or another supported VS Code model environment:
Explain Current GrammarCreate DSL ScaffoldGenerate 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
Current implemented adapters in this branch:
- Langium
- ANTLR4
- Xtext
Current responsibilities:
- project detection
- context selection
- validation orchestration
- diagnostics presentation
Next adapter work after this branch:
- later target: Generic mode
Current extension settings:
dslforge.validation.commanddslforge.validation.maxCapturedOutputCharactersdslforge.ai.maxContextFilesdslforge.ai.maxCharactersPerFiledslforge.ai.maxContextCharactersdslforge.telemetry.enableddslforge.telemetry.endpointOverride
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.enabledcan further disable extension telemetry- released builds can embed a proxy endpoint through
DSLFORGE_TELEMETRY_PROXY_ENDPOINTat package time dslforge.telemetry.endpointOverrideor runtimeDSLFORGE_TELEMETRY_ENDPOINTcan 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, andTELEMETRY_RATE_LIMIT_MAX_EVENTS - set the GitHub repository variable
DSLFORGE_TELEMETRY_PROXY_ENDPOINTto your production URL such ashttps://your-project.vercel.app/api/telemetry - publish the extension from CI so the packaged VSIX embeds that proxy endpoint
Useful commands:
npm run buildnpm run typechecknpm run testnpm run test:diagnosticsnpm run test:projectsnpm run test:manifestnpm exec -- vsce package
Contributions are welcome. Read CONTRIBUTING.md before opening an issue or pull request. Everyone participating in the project must follow the Code of Conduct.
Release notes live in CHANGELOG.md.