Langium 0.2 Is Released

Wed Nov 03 2021 by Mark Sujew, Christian Schneider

We are pleased to announce the release of Langium 0.2

Our initial release of Langium back in June has garnered a lot of positive feedback. Members of language engineering communities were eager to try the framework, propose new feature ideas and report bugs. Additionally, we had our first opportunity to speak publicly about Langium at the Strumenta Community Meetup.

New and Shiny

The new release comes with many new features and improvements to the framework.

Workspace Management

Previously, Langium only supported working with the currently opened file. Any other files in your workspace were ignored.

With the newly introduced workspace management system you can reference elements of your DSL across multiple files within your workspace folder. After starting the language server, all files matching your custom DSL file extension are automatically loaded and available for referencing. Handling large workspaces is also now boosted by workspace indexing allowing for fast cross reference checking.

LSP Features

We continue improving the editing support for Langium which also includes new default implementations and APIs for common Language Server Protocol features.

  • Renaming
  • Code Actions/Quick Fixes
  • Code Folding
  • Hovering

As always, downstream users of Langium are encouraged to build their own implementations on top of our default implementations.

Parser Improvements

Langium has seen a lot of internal improvements for this release, most notably in regards to the parsing infrastructure.

Compared to our first version, after the new release the Langium CLI will no longer generate TypeScript code for the parser. Instead, the parser will be built completely in memory. This does not only improve parsing speed, but also allows users to overwrite our new TokenBuilder. It is in charge of building parsing token types, i.e., splitting the input string into tokens and determining their types. The tokens will then be consumed by the parser. Besides enabling more fine grained control over the lexing and parsing steps, this fixes a bunch of bugs which accompanied the old generated parser.

Other Improvements

When testing your custom service implementations, you can now rely on Langium's new unit testing infrastructure, which is available for most LSP related services.

In total, we were able to close 42 issues and merge 60 pull requests since our last release. If you're interested in everything that happened during the last months, you can take a look at our changelog.

What's next?

After the release of this version, we will focus on the Langium website, where we will publish documentation and tutorials for Langium. In the meantime, you'll find a getting started guide at the npm package documentation.

Additionally, we already have more features planned for our next release. Most of them will be related to the Langium grammar itself, like being able to embed multiple languages within a single Langium based language server.

Stay tuned for more updates on Langium by watching the repository over at GitHub. Also, if you're interested in contributing to Langium, consider joining TypeFox. We're hiring!

Thank you

Last but certainly not least, a big Thank You to the following people who contributed to this release of Langium:

  • Mark Sujew (@msujew)
    • Refactoring of the parser infrastructure
    • Listening to file system changes in the language server
    • Allow to interrupt document lifecycle after user actions
    • Hover and folding LSP services
  • Dennis Hübner (@dhuebner)
    • Workspace indexing
    • Renaming LSP service
  • Miro Spönemann (@spoenemann): Refactoring linking infrastructure
  • Irina Artemeva (@Pluralia): Implementations and examples for CLIs built with Langium
  • Jan Bicker (@jbicker): API improvements and testing
  • Christian Schneider (@sailingKieler): 'LinkingError' for unresolved references
  • Insa Fuhrmann (@insafuhrmann): API for code actions
  • Kai Salmen (@kaisalmen): Unit testing infrastructure
  • Christian Dietrich (@cdietrich): Case insensitive completion prefix matching