From 8b7ea7ea44ea9b9357f07705cba227f48120f16a Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Wed, 6 Nov 2024 10:34:25 +0100 Subject: [PATCH] Fix reference to TypeFox orga projects (#262) --- .../docs/learn/minilogo/building_an_extension/_index.md | 2 +- hugo/content/docs/learn/minilogo/customizing_cli.md | 2 +- hugo/content/docs/learn/minilogo/generation.md | 2 +- hugo/content/docs/learn/minilogo/generation_in_the_web.md | 2 +- hugo/content/docs/learn/minilogo/langium_and_monaco.md | 2 +- hugo/content/docs/learn/minilogo/validation.md | 2 +- hugo/content/docs/learn/minilogo/writing_a_grammar.md | 2 +- hugo/content/docs/recipes/scoping/class-member.md | 4 ++-- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hugo/content/docs/learn/minilogo/building_an_extension/_index.md b/hugo/content/docs/learn/minilogo/building_an_extension/_index.md index b50c7a1c..8cb1a189 100644 --- a/hugo/content/docs/learn/minilogo/building_an_extension/_index.md +++ b/hugo/content/docs/learn/minilogo/building_an_extension/_index.md @@ -11,7 +11,7 @@ In this tutorial we'll be going over how to build a VSIX extension (VSCode exten ## Setting up the Scripts -To get started, you'll want to have a language expressed in Langium, such as [Lox](https://github.com/langium/langium-lox) or [MiniLogo](https://github.com/langium/langium-minilogo). If you have been following along with these tutorials, you should already have something ready. If you don't you can also use the default language generated by the yeoman generator for Langium, presented in the [workflow](/docs/learn/workflow/) section. +To get started, you'll want to have a language expressed in Langium, such as [Lox](https://github.com/TypeFox/langium-lox) or [MiniLogo](https://github.com/TypeFox/langium-minilogo). If you have been following along with these tutorials, you should already have something ready. If you don't you can also use the default language generated by the yeoman generator for Langium, presented in the [workflow](/docs/learn/workflow/) section. Regardless of what you're working with, you'll want to make sure you have the following scripts in your **package.json**. diff --git a/hugo/content/docs/learn/minilogo/customizing_cli.md b/hugo/content/docs/learn/minilogo/customizing_cli.md index d2894308..89bf5b46 100644 --- a/hugo/content/docs/learn/minilogo/customizing_cli.md +++ b/hugo/content/docs/learn/minilogo/customizing_cli.md @@ -7,7 +7,7 @@ aliases: {{< toc format=html >}} -In this tutorial, we'll be talking about customizing the command line interface for your language. We recommend reading through previous tutorials about [writing a grammar](/docs/learn/minilogo/writing_a_grammar) and [validation](/docs/learn/minilogo/validation). Once you have a good grasp on those concepts, then you should be all set for setting up a CLI. We will also continue to use the [MiniLogo](https://github.com/langium/langium-minilogo) language as a motivating example. +In this tutorial, we'll be talking about customizing the command line interface for your language. We recommend reading through previous tutorials about [writing a grammar](/docs/learn/minilogo/writing_a_grammar) and [validation](/docs/learn/minilogo/validation). Once you have a good grasp on those concepts, then you should be all set for setting up a CLI. We will also continue to use the [MiniLogo](https://github.com/TypeFox/langium-minilogo) language as a motivating example. ## Overview diff --git a/hugo/content/docs/learn/minilogo/generation.md b/hugo/content/docs/learn/minilogo/generation.md index 7b47d670..3fe147ff 100644 --- a/hugo/content/docs/learn/minilogo/generation.md +++ b/hugo/content/docs/learn/minilogo/generation.md @@ -373,7 +373,7 @@ our JSON output should be: ] ``` -If you're looking at the implementation of [MiniLogo that we've already written in the Langium organization on Github](https://github.com/langium/langium-minilogo), you may notice that the program and output there are *slightly* different. This interpretation of MiniLogo has gone through some iterations, and so there are some slight differences here and there. What's most important is that your version produces the generated output that you expect. +If you're looking at the implementation of [MiniLogo that we've already written in the Langium organization on Github](https://github.com/TypeFox/langium-minilogo), you may notice that the program and output there are *slightly* different. This interpretation of MiniLogo has gone through some iterations, and so there are some slight differences here and there. What's most important is that your version produces the generated output that you expect. We could continue to extend on this with new features, and generate new sorts of output using a given input language. In this tutorial, we're able to take a MiniLogo program and convert it into some simple JSON drawing instructions that can be consumed by another program. This opens the door for us to write such a program in another language, such as Python or Javascript, and draw with these results. In later tutorials, we'll be talking about how to run Langium in the web with generation, so that we can immediately verify our results by drawing on an HTML5 canvas. diff --git a/hugo/content/docs/learn/minilogo/generation_in_the_web.md b/hugo/content/docs/learn/minilogo/generation_in_the_web.md index c8db7cdb..6553a57b 100644 --- a/hugo/content/docs/learn/minilogo/generation_in_the_web.md +++ b/hugo/content/docs/learn/minilogo/generation_in_the_web.md @@ -13,7 +13,7 @@ In this tutorial we'll be talking about how to perform generation in the web by *(This tutorial previously utilized custom LSP commands to achieve the same goal of generation. This is still a valid approach, but we've found setting up listening for notifications this way is much more straightforward. We've implemented this in our own example languages as well, and would recommend it going forward.)* -We'll assume that you've already looked over most of the other tutorials at this point. It is particularly important that you have a language with working generation, and have a working instance of Langium + Monaco for your language (or another editor of your choice). In the case that you don't have a language to work with, you can follow along with [MiniLogo](https://github.com/langium/langium-minilogo), which is the example language used throughout many of these tutorials. +We'll assume that you've already looked over most of the other tutorials at this point. It is particularly important that you have a language with working generation, and have a working instance of Langium + Monaco for your language (or another editor of your choice). In the case that you don't have a language to work with, you can follow along with [MiniLogo](https://github.com/TypeFox/langium-minilogo), which is the example language used throughout many of these tutorials. Since we're working with MiniLogo here, we already know that our generated output is in the form of drawing instructions that transform some drawing context. The generated output that we've implemented so far consists of a JSON array of commands, making it very easy to interpret. Now that we're working in a web-based context, this approach lends itself naturally towards manipulating an HTML5 canvas. diff --git a/hugo/content/docs/learn/minilogo/langium_and_monaco.md b/hugo/content/docs/learn/minilogo/langium_and_monaco.md index 4dcee7b3..a0e90220 100644 --- a/hugo/content/docs/learn/minilogo/langium_and_monaco.md +++ b/hugo/content/docs/learn/minilogo/langium_and_monaco.md @@ -23,7 +23,7 @@ Without further ado, let's jump into getting your web-based Langium experience s ## Getting your Language Setup for the Web -To begin, you're going to need a Langium-based language to work with. We have already written [MiniLogo](https://github.com/langium/langium-minilogo) in Langium as an example for deploying a language in the web. However, if you've been following along with these tutorials so far, you should be ready to move your own language into a web-based context. +To begin, you're going to need a Langium-based language to work with. We have already written [MiniLogo](https://github.com/TypeFox/langium-minilogo) in Langium as an example for deploying a language in the web. However, if you've been following along with these tutorials so far, you should be ready to move your own language into a web-based context. Per usual, we'll be using MiniLogo as the motivating example here. diff --git a/hugo/content/docs/learn/minilogo/validation.md b/hugo/content/docs/learn/minilogo/validation.md index c37a5189..a2b543dd 100644 --- a/hugo/content/docs/learn/minilogo/validation.md +++ b/hugo/content/docs/learn/minilogo/validation.md @@ -9,7 +9,7 @@ aliases: In this tutorial, we will be talking about implementing validation for your Langium-based language. We recommend first reading the previous tutorial about [writing a grammar](/docs/learn/minilogo/writing_a_grammar/), as we will assume you're familiar with the topics covered there. We'll also assume that you have a working language to add validation to, so double check that `npm run langium:generate` succeeds without errors before you proceed. -For this tutorial, we'll be implementing validation for the [MiniLogo language](https://github.com/langium/langium-minilogo), but you can use your own language to follow along as well. +For this tutorial, we'll be implementing validation for the [MiniLogo language](https://github.com/TypeFox/langium-minilogo), but you can use your own language to follow along as well. ## Overview diff --git a/hugo/content/docs/learn/minilogo/writing_a_grammar.md b/hugo/content/docs/learn/minilogo/writing_a_grammar.md index 84b50b0b..e08558a1 100644 --- a/hugo/content/docs/learn/minilogo/writing_a_grammar.md +++ b/hugo/content/docs/learn/minilogo/writing_a_grammar.md @@ -10,7 +10,7 @@ aliases: In this tutorial we will be talking about writing a grammar for your language in Langium. As a motivating example, we'll be describing how to write a grammar for the MiniLogo language. If you're not familiar with MiniLogo, it's a smaller implementation of the Logo programming language. Logo itself is a lot like Turtle from Python. Ultimately, we'll be using MiniLogo to express drawing instructions that can be used to draw on a canvas. -We've already written an implementation of [MiniLogo on Github using Langium](https://github.com/langium/langium-minilogo). This tutorial will be following along with this project, by walking through the grammar implementation step by step. Later tutorials will also follow along with MiniLogo to create an easy to follow series. +We've already written an implementation of [MiniLogo on Github using Langium](https://github.com/TypeFox/langium-minilogo). This tutorial will be following along with this project, by walking through the grammar implementation step by step. Later tutorials will also follow along with MiniLogo to create an easy to follow series. ## Planning diff --git a/hugo/content/docs/recipes/scoping/class-member.md b/hugo/content/docs/recipes/scoping/class-member.md index 2051ceb8..62cbd88b 100644 --- a/hugo/content/docs/recipes/scoping/class-member.md +++ b/hugo/content/docs/recipes/scoping/class-member.md @@ -25,7 +25,7 @@ function test(): void { Member based scoping like this requires not only a modification of the default scoping provider, but also some other prerequisites. This includes adding a member call mechanism in your grammar and a rudimentary type system. -For this guide, we will use excerpts from the [langium-lox](https://github.com/langium/langium-lox) project to demonstrate how you can set this up yourself. +For this guide, we will use excerpts from the [langium-lox](https://github.com/TypeFox/langium-lox) project to demonstrate how you can set this up yourself. This project implements a strongly-typed version of the [Lox language](https://craftinginterpreters.com/the-lox-language.html) from the popular book [Crafting Interpreters](https://craftinginterpreters.com/). We'll first start with the `MemberCall` grammar rule, which references one of our `NamedElements`. These elements could be variable declarations, functions, classes or methods and fields of those classes. Additionally, we want to allow function calls on elements. Note that the grammar has no notion of whether these elements can actually be executed as functions. Instead, we always allow function calls on every named element, and simply provide validation errors in case an element is called erroneously. After parsing the first member call, we continue parsing further members as long as the input text provides us with further references to elements; which are separated by dots. @@ -99,7 +99,7 @@ export class LoxScopeProvider extends DefaultScopeProvider { } ``` -When trying to compute the type of an expression, we are only interested in the final piece of the member call. However, to derive the type and scope of the final member call, we have to recursively identify the type of the previous member call. This is done by looking at the member call stored in the `previous` property and inferring its type. See [here for the full implementation of the type inference system in Lox](https://github.com/langium/langium-lox/blob/main/src/language-server/type-system/infer.ts). This kind of type inference requires scoping. +When trying to compute the type of an expression, we are only interested in the final piece of the member call. However, to derive the type and scope of the final member call, we have to recursively identify the type of the previous member call. This is done by looking at the member call stored in the `previous` property and inferring its type. See [here for the full implementation of the type inference system in Lox](https://github.com/TypeFox/langium-lox/blob/main/langium/src/language-server/type-system/infer.ts). This kind of type inference requires scoping. To illustrate this behavior a bit better, take a look at the following code snippet: