Skip to content

Commit

Permalink
feat: Langium grammar (#470)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lars-reimann and megalinter-bot authored Apr 13, 2023
1 parent e82240e commit c439c19
Show file tree
Hide file tree
Showing 597 changed files with 4,738 additions and 2,086 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
build/
dist/
out/

# DSL-langium
/DSL-langium/vitest.config.ts
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Generate Langium files
run: npm run langium:generate

- name: Compile TypeScript
run: npm run build

- name: Test with Vitest
run: npm run test-with-coverage

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Generate Langium files
run: npm run langium:generate

- name: Compile TypeScript
run: npm run build

- name: Test with Vitest
run: npm run test-with-coverage

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ coverage/
dist/
dist-ssr/
out/
/DSL-langium/syntaxes/safe-ds.tmLanguage.json

# Gradle
.gradle/
Expand Down
2 changes: 1 addition & 1 deletion DSL-langium/bin/cli
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node

require("../out/cli").default();
require("../out/src/cli").default();
2 changes: 1 addition & 1 deletion DSL-langium/langium-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"id": "safe-ds",
"grammar": "src/language-server/grammar/safe-ds.langium",
"fileExtensions": [".sdspipe", ".sdsschema", ".sdsstub", ".sdstest"],
"fileExtensions": [".sdspipe", ".sdsstub", ".sdstest"],
"textMate": {
"out": "syntaxes/safe-ds.tmLanguage.json"
}
Expand Down
10 changes: 7 additions & 3 deletions DSL-langium/language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,24 @@
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
["(", ")"],
["»", "«"]
],
"autoClosingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["»", "«"],
["\"", "\""],
["'", "'"]
["`", "`"]
],
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"],
["»", "«"],
["\"", "\""],
["'", "'"]
["`", "`"]
]
}
Loading

0 comments on commit c439c19

Please sign in to comment.