-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guides on Langium</title><link>/guides/</link><description>Recent content in Guides on Langium</description><generator>Hugo -- gohugo.io</generator><atom:link href="/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Builtin Libraries</title><link>/guides/builtin-library/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/guides/builtin-library/</guid><description>Languages usually offer their users some high-level programming features that they do not have to define themselves. For example, TypeScript provides users with typings for globally accessible variables such as the window, process or console objects. They are part of the JavaScript runtime, and not defined by any user or a package they might import. Instead, these features are contributed through what we call builtin libraries. | ||
Loading a builtin library in Langium is very simple.</description></item><item><title>Formatting</title><link>/guides/formatting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/guides/formatting/</guid><description>Langium&rsquo;s formatting API allows to easily create formatters for your language. We start building a custom formatter for our language by creating a new class that inherits from AbstractFormatter. | ||
import { AbstractFormatter, AstNode, Formatting } from 'langium'; export class CustomFormatter extends AbstractFormatter { protected format(node: AstNode): void { // This method is called for every AstNode in a document } } ... // Bind the class in your module export const CustomModule: Module&lt;CustomServices, PartialLangiumServices&gt; = { lsp: { Formatter: () =&gt; new CustomFormatter() } }; The entry point for the formatter is the abstract format(AstNode) method.</description></item><item><title>Code Bundling</title><link>/guides/code-bundling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/guides/code-bundling/</guid><description>When you first create a Langium project using the Yeoman generator, it will only contain a plain TypeScript configuration, without any additional build processes. However, if you want to make your language available for consumption in a non-development context, you&rsquo;ll want to create a bundle. It is not absolutely necessary in a Node.js context, since you can always resolve local node_modules but it&rsquo;s still recommended for vscode extensions. It improves performance and decreases file size by minifying your code and only including what you actually need.</description></item></channel></rss> | ||
import { AbstractFormatter, AstNode, Formatting } from 'langium'; export class CustomFormatter extends AbstractFormatter { protected format(node: AstNode): void { // This method is called for every AstNode in a document } } ... // Bind the class in your module export const CustomModule: Module&lt;CustomServices, PartialLangiumServices&gt; = { lsp: { Formatter: () =&gt; new CustomFormatter() } }; The entry point for the formatter is the abstract format(AstNode) method.</description></item><item><title>Multiple dependent languages</title><link>/guides/multiple-languages/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/guides/multiple-languages/</guid><description>This guide is about integrating multiple dependent languages in one Langium project. | ||
One common situation where it makes sense to create dependent languages is when you only want to read concepts in one language and predefine them in another file (probably also a built-in one). Think of splitting SQL into a defining CREATE TABLE table (...)) and a reading part (SELECT * FROM table). | ||
Notice that for n independent languages, you can simply create n independent Langium projects.</description></item><item><title>Code Bundling</title><link>/guides/code-bundling/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/guides/code-bundling/</guid><description>When you first create a Langium project using the Yeoman generator, it will only contain a plain TypeScript configuration, without any additional build processes. However, if you want to make your language available for consumption in a non-development context, you&rsquo;ll want to create a bundle. It is not absolutely necessary in a Node.js context, since you can always resolve local node_modules but it&rsquo;s still recommended for vscode extensions. It improves performance and decreases file size by minifying your code and only including what you actually need.</description></item></channel></rss> |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.