Skip to content

Commit 631260c

Browse files
authored
Merge pull request #58 from mikoto2000/langium-firststep
Langium firststep
2 parents 12d1663 + 17c3dad commit 631260c

5,884 files changed

Lines changed: 1620440 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"plugins": [
9+
"@typescript-eslint"
10+
],
11+
"rules": {
12+
}
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
3+
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4+
5+
// List of extensions which should be recommended for users of this workspace.
6+
"recommendations": [
7+
"langium.langium-vscode"
8+
]
9+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// A launch configuration that launches the extension inside a new window
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
{
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run Extension",
10+
"type": "extensionHost",
11+
"request": "launch",
12+
"args": [
13+
"--extensionDevelopmentPath=${workspaceFolder}"
14+
]
15+
},
16+
{
17+
"name": "Attach to Language Server",
18+
"type": "pwa-node",
19+
"port": 6009,
20+
"request": "attach",
21+
"skipFiles": [
22+
"<node_internals>/**"
23+
],
24+
"sourceMaps": true,
25+
"outFiles": [
26+
"${workspaceFolder}/out/**/*.js"
27+
]
28+
}
29+
]
30+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.vscode/**
2+
.vscode-test/**
3+
.gitignore
4+
langium-quickstart.md
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env node
2+
3+
require("../out/cli").default();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"projectName": "Firststep",
3+
"languages": [{
4+
"id": "firststep",
5+
"grammar": "src/language-server/firststep.langium",
6+
"fileExtensions": [".firststep"],
7+
"textMate": {
8+
"out": "syntaxes/firststep.tmLanguage.json"
9+
}
10+
}],
11+
"out": "src/language-server/generated"
12+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Welcome to your Langium VS Code Extension
2+
3+
## What's in the folder
4+
5+
This folder contains all necessary files for your language extension.
6+
* `package.json` - the manifest file in which you declare your language support.
7+
* `language-configuration.json` - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets.
8+
* `src/extension.ts` - the main code of the extension, which is responsible for launching a language server and client.
9+
* `src/language-server/firststep.langium` - the grammar definition of your language.
10+
* `src/language-server/main.ts` - the entry point of the language server process.
11+
* `src/language-server/firststep-module.ts` - the dependency injection module of your language implementation. Use this to register overridden and added services.
12+
* `src/language-server/firststep-validator.ts` - an example validator. You should change it to reflect the semantics of your language.
13+
* `src/cli/index.ts` - the entry point of the command line interface (CLI) of your language.
14+
* `src/cli/generator.ts` - the code generator used by the CLI to write output files from DSL documents.
15+
* `src/cli/cli-util.ts` - utility code for the CLI.
16+
17+
## Get up and running straight away
18+
19+
* Run `npm run langium:generate` to generate TypeScript code from the grammar definition.
20+
* Run `npm run build` to compile all TypeScript code.
21+
* Press `F5` to open a new window with your extension loaded.
22+
* Create a new file with a file name suffix matching your language.
23+
* Verify that syntax highlighting, validation, completion etc. are working as expected.
24+
* Run `./bin/cli` to see options for the CLI; `./bin/cli generate <file>` generates code for a given DSL file.
25+
26+
## Make changes
27+
28+
* Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files.
29+
* Run `npm run langium:watch` to have the Langium generator run automatically afer every change of the grammar declaration.
30+
* You can relaunch the extension from the debug toolbar after making changes to the files listed above.
31+
* You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes.
32+
33+
## Install your extension
34+
35+
* To start using your extension with VS Code, copy it into the `<user home>/.vscode/extensions` folder and restart Code.
36+
* To share your extension with the world, read the [VS Code documentation](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) about publishing an extension.
37+
38+
## To Go Further
39+
40+
Documentation about the Langium framework is available at https://langium.org
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
4+
"lineComment": "//",
5+
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6+
"blockComment": [ "/*", "*/" ]
7+
},
8+
// symbols used as brackets
9+
"brackets": [
10+
["{", "}"],
11+
["[", "]"],
12+
["(", ")"]
13+
],
14+
// symbols that are auto closed when typing
15+
"autoClosingPairs": [
16+
["{", "}"],
17+
["[", "]"],
18+
["(", ")"],
19+
["\"", "\""],
20+
["'", "'"]
21+
],
22+
// symbols that can be used to surround a selection
23+
"surroundingPairs": [
24+
["{", "}"],
25+
["[", "]"],
26+
["(", ")"],
27+
["\"", "\""],
28+
["'", "'"]
29+
]
30+
}

Langium/firststep/firststep/node_modules/.bin/acorn

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Langium/firststep/firststep/node_modules/.bin/eslint

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)