Skip to content

Commit

Permalink
Update hugo/content/docs/recipes/scoping/file-based.md
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Sujew <[email protected]>
  • Loading branch information
Lotes and msujew authored Aug 6, 2024
1 parent b1defac commit 131196b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hugo/content/docs/recipes/scoping/file-based.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ weight: 300

## Goal

Our goal here is to mimic the TypeScript import/export mechanism. By that I mean:
By default, Langium will always expose all top-level AST elements to the global scope. That means they are visible to all other documents in your workspace. However, a lot of languages are better served with a JavaScript-like `import`/`export` mechanism:

* you can export certain symbols using an `export` keyword from your current file to make it available to the other files
* you can import certain symbols using the `import` keyword from a different file
* Using `export` makes a symbol from the current file available for referencing from another file.
* Using `import` allows to reference symbols for a different file.

To make things easier I will modify the "Hello World" example from the [learning section](/docs/learn/workflow).

Expand Down

0 comments on commit 131196b

Please sign in to comment.