Skip to content

Commit c439c19

Browse files
feat: Langium grammar (#470)
Closes partially #433. ### Summary of Changes * Recreate grammar in [Langium](https://github.com/langium/langium) ### TODOs - [x] More grammar tests - [x] declarations - [x] expressions - [x] keywords as names - [x] modules - [x] schema - [x] statements - [x] trailing commas - [x] types - [x] Document how to write grammar tests - [X] Resolve the grammar ambiguity warning - [X] Fix error when hovering over modules members or class members --------- Co-authored-by: megalinter-bot <129584137+megalinter-bot@users.noreply.github.com>
1 parent e82240e commit c439c19

File tree

597 files changed

+4738
-2086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

597 files changed

+4738
-2086
lines changed

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
build/
33
dist/
44
out/
5+
6+
# DSL-langium
7+
/DSL-langium/vitest.config.ts

.github/workflows/main.yml

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ jobs:
8080
- name: Install dependencies
8181
run: npm ci
8282

83+
- name: Generate Langium files
84+
run: npm run langium:generate
85+
86+
- name: Compile TypeScript
87+
run: npm run build
88+
8389
- name: Test with Vitest
8490
run: npm run test-with-coverage
8591

.github/workflows/pr.yml

+6
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ jobs:
9696
- name: Install dependencies
9797
run: npm ci
9898

99+
- name: Generate Langium files
100+
run: npm run langium:generate
101+
102+
- name: Compile TypeScript
103+
run: npm run build
104+
99105
- name: Test with Vitest
100106
run: npm run test-with-coverage
101107

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ coverage/
1818
dist/
1919
dist-ssr/
2020
out/
21+
/DSL-langium/syntaxes/safe-ds.tmLanguage.json
2122

2223
# Gradle
2324
.gradle/

DSL-langium/bin/cli

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22

3-
require("../out/cli").default();
3+
require("../out/src/cli").default();

DSL-langium/langium-config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{
55
"id": "safe-ds",
66
"grammar": "src/language-server/grammar/safe-ds.langium",
7-
"fileExtensions": [".sdspipe", ".sdsschema", ".sdsstub", ".sdstest"],
7+
"fileExtensions": [".sdspipe", ".sdsstub", ".sdstest"],
88
"textMate": {
99
"out": "syntaxes/safe-ds.tmLanguage.json"
1010
}

DSL-langium/language-configuration.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,24 @@
66
"brackets": [
77
["{", "}"],
88
["[", "]"],
9-
["(", ")"]
9+
["(", ")"],
10+
["»", "«"]
1011
],
1112
"autoClosingPairs": [
1213
["{", "}"],
1314
["[", "]"],
1415
["(", ")"],
16+
["»", "«"],
1517
["\"", "\""],
16-
["'", "'"]
18+
["`", "`"]
1719
],
1820
"surroundingPairs": [
1921
["{", "}"],
2022
["[", "]"],
2123
["(", ")"],
24+
["<", ">"],
25+
["»", "«"],
2226
["\"", "\""],
23-
["'", "'"]
27+
["`", "`"]
2428
]
2529
}

0 commit comments

Comments
 (0)