Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use YAML-based grammar for our models #28

Merged
merged 23 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
497c7f0
New examples, + moving old examples around
ozcanxbreeze Jul 19, 2023
62ae32c
Does not work good enough yet, but it work enough to keep going
ozcanxbreeze Aug 16, 2023
a40b2b8
Implemented testing for new language
ozcanxbreeze Aug 17, 2023
ac5ea1c
GmodelFactory refactor, serailizer broken, fixing that first
ozcanxbreeze Aug 17, 2023
df6a8b9
Rewrote serializer, now dynamic and works with Yaml
ozcanxbreeze Aug 18, 2023
af49714
GModel-factory now works with new lang
ozcanxbreeze Aug 18, 2023
6348a61
Extension should be working with new language
ozcanxbreeze Aug 21, 2023
78f85bd
Fix error about character needing to be non-negative caused by '-1'
martin-fleck-at Aug 22, 2023
5e70933
Fix errors by using a specific chevrotain version
martin-fleck-at Aug 29, 2023
4bd47ab
To get it working on my machine
ozcanxbreeze Sep 1, 2023
27bf044
readme update for license
ozcanxbreeze Sep 1, 2023
19d779b
fixing tests
ozcanxbreeze Sep 1, 2023
03a1a0d
Merge branch 'main' into feature/yaml-lang-2
ozcanxbreeze Sep 4, 2023
f895231
Improve stability of cross-updates and fix edge structure
martin-fleck-at Sep 27, 2023
639466e
Update example files and fix IDs for GLSP server for better update
martin-fleck-at Oct 6, 2023
15457f9
Extend protocol with client id and improve update mechanism
martin-fleck-at Oct 11, 2023
963cf24
Fixed wrong use of name vs name_val when showing and synching the model.
harmen-xb Oct 18, 2023
c9d709b
Added missing name property on Order entity.
harmen-xb Oct 18, 2023
6c51f51
Initial gitpod setup.
harmen-xb Oct 18, 2023
d44a1f0
Added yarn test in build action.
harmen-xb Oct 18, 2023
5ae77b2
Refactored test build part into seperate action and added in feature …
harmen-xb Oct 18, 2023
6a39bd4
Disabled test action for now, since it doesn't seem to work on GitHub…
harmen-xb Oct 18, 2023
734816e
Refactored serializer so indentation and characters used are in const…
harmen-xb Oct 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,27 @@ runs: # windows-2019 # is needed because the Setup Python task does not work wit
- name: Set up yarn to use version 1.22.19
uses: Amadevus/[email protected]
with:
# PowerShell script to execute in Actions-hydrated context
script: |
yarn policies set-version 1.22.19

- name: Yarn version
uses: Amadevus/[email protected]
with:
# PowerShell script to execute in Actions-hydrated context
script: |
yarn --version | Write-Host

- name: Yarn build
uses: Amadevus/[email protected]
with:
# PowerShell script to execute in Actions-hydrated context
script: |
yarn

- name: Yarn test
uses: Amadevus/[email protected]
with:
script: |
yarn test

#- name: Yarn start browser
# run: |
# yarn start:browser
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: test
description: 'Test CrossModel'

runs: # windows-2019 # is needed because the Setup Python task does not work with ubuntu
using: 'composite'
steps:
- name: Yarn test
uses: Amadevus/[email protected]
with:
script: |
yarn test
18 changes: 10 additions & 8 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: feature

on:
push:
branches:
- feature/*
push:
branches:
- feature/*

jobs:
build:
runs-on: windows-2019 # is needed because the Setup Python task does not work with ubuntu
steps:
# Checkout the code.
- name: check out # is needed to read the files on the root folder of the repo
uses: actions/checkout@v3
# Use the build-addin action.
- uses: ./.github/actions/build
# Checkout the code.
- name: check out # is needed to read the files on the root folder of the repo
uses: actions/checkout@v3
# Use the build action.
- uses: ./.github/actions/build
# Use the test action.
# - uses: ./.github/actions/test
17 changes: 17 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

# To have the dependencies for Theia installed execute the following commands in the GitPod workspace once:
# sudo apt-get install libsecret-1-dev libxkbfile-dev
# nvm install 16.20.0
# pyenv install -s 3.11.4
# pyenv global 3.11.4

tasks:
- init: yarn install && yarn run build
command: yarn run watch


16 changes: 15 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"--loglevel=debug",
"--hostname=localhost",
"--no-cluster",
"--root-dir=${workspaceRoot}/examples/workspace",
"--root-dir=${workspaceRoot}/examples/yaml-example",
"--app-project-path=${workspaceFolder}/applications/electron-app",
"--remote-debugging-port=9222",
"--no-app-auto-install",
Expand Down Expand Up @@ -114,6 +114,20 @@
"${workspaceFolder}/node_modules/vscode-languageclient/**/*.js",
"${workspaceFolder}/node_modules/vscode-jsonrpc/**/*.js"
]
},
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/jest/bin/jest.js",
"--runInBand",
"--config=extensions/crossmodel-lang/jest.config.js",
"--testPathPattern=extensions/crossmodel-lang/test/language-server/util/name-util.test.ts"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ The repository itself contains the following components structured as follows:

## Used libraries and license

- mui-x : MUI X is open core—base components are MIT-licensed, while more advanced features require a Pro or Premium commercial license. We are
currently only using core-base
- mui-x : MUI X is open core—base components are MIT-licensed, while more advanced features require a Pro or Premium commercial license. We are currently only using core-base
- react-tabs: MIT
- chevotain: This library is a dependency of langium. To get the Yaml language working in crossmodel an example implementation of the python language of chevrotrain has been used. This example has been modified to make it work for the yaml language.
- https://github.com/Chevrotain/chevrotain
- example that has been used: https://github.com/Chevrotain/chevrotain/tree/master/examples/lexer/python_indentation
5 changes: 5 additions & 0 deletions configs/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node'
};
8 changes: 8 additions & 0 deletions examples/cross-model-project-example/.theia/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
"version": "0.2.0",
"configurations": [

]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
entity Aantal {
description := "Test description";
attributes {
nope := 'Float';
test123456 := 'Bool';
test3 := 'Float';
test4 := 'Char';
}
}
10 changes: 10 additions & 0 deletions examples/cross-model-project-example/systemA/entities/Klant.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
entity Klant {
description := "test123";
attributes {
werk := 'Float';
test49999912somsdit := 'Char';
wat111234 := 'Varchar';
hall1123 := 'Integer';
ditwerktdusnietaltijd := 'test1234';
}
}
17 changes: 17 additions & 0 deletions examples/cross-model-project-example/systemA/entities/Order.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
entity Order {
description := "Orders geplaatst door de klant";
attributes {
test49999912somsdit := 'Varchar';
werk := 'Integer';
wat111234 := 'Varchar';
hall1123 := 'Integer';
ditwerktdusnietaltijd := 'test1234';
empty_attribute5 := 'Float';
empty_attribute6 := 'Float';
empty_attribute7 := 'Float';
empty_attribute8 := 'Float';
empty_attribute9 := 'Float';
empty_attribute10 := 'Float';
empty_attribute11 := 'Float';
}
}
10 changes: 10 additions & 0 deletions examples/cross-model-project-example/systemA/entities/Product.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
entity Product {
description := "Producten die verkocht worden";
attributes {
test1 := 'test2';
test2 := 'test3';
test3 := 'test';
test4 := 'test';
test5 := 'test';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship AantalToProduct {
source := Aantal;
target := Product ;
type := 1:1;
properties {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship AantalToProduct0 {
source := Aantal;
target := Product;
type := 1:1;
properties {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship KlantToOrder {
source := Klant;
target := Order;
type := 1:1;
properties {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship KlantToOrder0 {
source := Klant;
target := Order;
type := 1:1;
properties {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship OrderToAantal {
source := Order;
target := Aantal;
type := 1:1;
properties {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
relationship OrderToProduct {
source := Order;
target := Product;
type := 1:1;
properties {

}
}
Loading