langium

Explains Langium-based DSL tooling grammar-to-LSP integration and debugging workflows.

28|4|Updated Apr 10, 2025
One-click install
npx skills add https://github.com/eclipse-langium/langium-ai --skill langium
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: langium
Source: https://github.com/eclipse-langium/langium-ai/tree/main/skills/langium
Command: npx skills add https://github.com/eclipse-langium/langium-ai --skill langium

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Langium-based projects can be difficult to navigate because behavior is spread across grammar syntax, generated artifacts, a dependency-injection runtime, document state processing, linking, validation, and LSP wiring.

Core Features & Use Cases

  • End-to-end project comprehension: Covers the full lifecycle from .langium grammar to runtime parsing, linking, validation, and LSP integration.
  • Build-time artifact literacy: Explains how ast.ts, grammar.ts, and module.ts are produced and how they affect runtime behavior.
  • Operational runtime understanding: Details the DocumentState pipeline, scope computation, scope provider/name resolution, and linking/indexing mechanics so you can debug behavior efficiently.
  • Customization patterns: Shows how DI module composition and service overrides change parsing, validation, and IDE features.

Quick Start

Ask an agent to use this guide to explain how a specific Langium DSL file is parsed, linked, validated, and surfaced through LSP in your project.

Frequently Asked Questions about langium

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does Langium parse and link a DSL file end to end?

Langium parses a DSL file by applying grammar syntax to generate runtime artifacts, which then drive scope computation, cross-reference resolution, and document state transitions to produce a linked AST.

How do I override Langium validation and parsing services via dependency injection?

You override Langium validation and parsing services by composing custom dependency injection modules that replace or extend default generated services in module.ts, directly altering runtime behavior and IDE features.

What is the Langium DocumentState pipeline and how does it affect scope computation?

The Langium DocumentState pipeline tracks document processing transitions from parsing through indexing, controlling when scope computation and name resolution execute to resolve cross-references accurately during linking.

How are ast.ts and grammar.ts generated artifacts used in a Langium LSP integration?

Langium generated artifacts like ast.ts and grammar.ts provide typed AST interfaces and parser logic that the module.ts file wires into the LSP server to surface validation diagnostics and IDE features.

Why is my Langium cross-reference resolution not working during linking?

Langium cross-reference resolution fails when scope computation returns no valid candidates or document state has not reached the indexed phase. Debugging scope provider implementation and indexing mechanics identifies missing name resolution mappings.

Can I use Langium to build a custom DSL with LSP support?

Langium builds custom DSLs with full LSP support by defining grammar syntax in a .langium file, generating parser and AST artifacts, and wiring validation and linking services through dependency injection for end-to-end IDE features.