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

Enhance grammar to support attribute mapping from sources to target #45

Merged
merged 5 commits into from
Dec 18, 2023

Conversation

martin-fleck-at
Copy link
Collaborator

  • Provide mapping grammar for source objects, joins and target mapping
  • Add new element creation for mappings in toolbar and context menu
  • Adapt custom serializer for new attributes
  • Add example for mapping

Refactorings:

  • Split grammar into multiple files
  • Replace id and id references with unquoted text
  • Fix auto completion in text files through completion lexer and parser
  • Enhance auto-completion for string, number, and boolean

Please note this PR is based on #44 to avoid conflicts but only the last commit serves the functionality described above. I'd suggest to merge the other PR first and then this one after a rebase.

Copy link

github-actions bot commented Dec 7, 2023

Unit Test Results

    3 files  ±0    30 suites  ±0   2m 32s ⏱️ -1s
  68 tests ±0    68 ✔️ ±0  0 💤 ±0  0 ±0 
207 runs  ±0  207 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 8460854. ± Comparison against base commit bf4c2c0.

♻️ This comment has been updated with latest results.

- Provide mapping grammar for source objects, joins and target mapping
- Add new element creation for mappings in toolbar and context menu
- Adapt custom serializer for new attributes
- Add example for mapping

Refactorings:
- Split grammar into multiple files
- Replace id and id references with unquoted text
- Fix auto completion in text files through completion lexer and parser
- Enhance auto-completion for string, number, and boolean
Copy link
Contributor

@harmen-xb harmen-xb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martin-fleck-at

I completed the other PR and rebased this branch onto latest main where I had to solve some conflicts. I think I did it the right way, but maybe you can double check.

I reviewed the code, where I put some comments on.

I also ran the tests and I see some Jest tests are failing. Could you have a look at these?

Also when I start CrossModel now the diagrams are not working anymore.

- Only export root nodes and entity attributes for external reference
- Properly check exported ids and local ids
- Workspace initialization was cancelled when a document was opened
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Thank you for your review! I addressed all your concerns in a follow up commit.

@harmen-xb
Copy link
Contributor

@martin-fleck-at Thanks for the update, sorry it took a while for me to have time to look at it.

Some observations:

Everything works fine if I only have one workspace open, but when I first open the examples/yaml-example workspace and then the e2e-tests/src/resources/sample-workspace, in the yaml-example workspace things stop working for me.

I think it depends in which order I open the workspaces which one stops working.

In this example I first openend yaml-example, and it all worked fine. Then I opended e2e-tests/src/resources/sample-workspace in the same browser on a second tab and things stopped working for the yaml-example workspace, while it works fine in the sample-workspace.

Examples within the yaml-example workspace:

  1. When I open the form editor, it doesn't automatically update the model when changing any value. It does update when I press CTRL+S, but this was not how this perspective used to work. I have autosave enabled.
  2. When I now click on an entity in the diagram it throws an error while trying to update the property widget:
2023-12-14T20:03:22.671Z root ERROR Request requestDiagramNodeEntityModel failed with error: Request server/requestModelDiagramNode failed with message: AST node has no document. Error: Request server/requestModelDiagramNode failed with message: AST node has no document.
    at handleResponse (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:565:48)
    at handleMessage (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:345:13)
    at processMessageQueue (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:362:17)
    at Immediate.<anonymous> (/workspaces/crossmodel/node_modules/vscode-jsonrpc/lib/common/connection.js:334:13)
    at processImmediate (node:internal/timers:466:21)

When I close and re-open the perspectives the within that single workspace the problems remain.

- Create one ModelServiceImpl per frontend connection
- Improve connection reporting for server clients
- Replace temporary workspace files with port commands
-- Query command contributed by extension
-- Extension forwards command execution to language server
@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Good catch! I think that was a problem that was always present but with the new commit everything should work much more stabler.

@harmen-xb
Copy link
Contributor

@martin-fleck-at Thanks for the update! It all works quite well, functionaly I don't see any issues, but I do get error message in the console while opening a workspace:

2023-12-15T16:43:46.902Z root ERROR Request executeCommand failed with error: The command 'glsp:port' cannot be executed. There are no active handlers available for the command. Error: The command 'glsp:port' cannot be executed. There are no active handlers available for the command.
    at CommandRegistry.executeCommand (http://localhost:3000/bundle.js:64979:29)
    at RpcProxyFactory.onRequest (http://localhost:3000/bundle.js:70028:49)
    at RpcProtocol.requestHandler (http://localhost:3000/bundle.js:70009:80)
    at RpcProtocol.handleRequest (http://localhost:3000/bundle.js:69185:39)
    at RpcProtocol.handleMessage (http://localhost:3000/bundle.js:69087:26)
    at http://localhost:3000/bundle.js:69070:66
    at http://localhost:3000/bundle.js:66120:69
    at CallbackList.invoke (http://localhost:3000/bundle.js:66126:26)
    at Emitter.fire (http://localhost:3000/bundle.js:66241:36)
    at ChannelMultiplexer.handleData (http://localhost:3000/bundle.js:68743:38)
2023-12-15T16:50:21.859Z root ERROR Request executeCommand failed with error: Unhandled method modelserver:port Error: Unhandled method modelserver:port
    at handleResponse (/workspaces/crossmodel/extensions/crossmodel-lang/out/extension.cjs:5360:40)
    at handleMessage (/workspaces/crossmodel/extensions/crossmodel-lang/out/extension.cjs:5169:11)
    at processMessageQueue (/workspaces/crossmodel/extensions/crossmodel-lang/out/extension.cjs:5184:13)
    at Immediate.<anonymous> (/workspaces/crossmodel/extensions/crossmodel-lang/out/extension.cjs:5160:11)
    at processImmediate (node:internal/timers:466:21)

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Yeah, I saw that too but unfortunately it is a log statement that automatically happens in Theia, see https://github.com/eclipse-theia/theia/blob/c30a79f90d9393e392cabfebbce612695cbe0d40/packages/core/src/common/messaging/proxy-factory.ts#L177. Even though it re-throws the error and we catch and ignore it the log already happens. If it is a big issue, I can definitely see how to best fix it.

@harmen-xb
Copy link
Contributor

It's not a big issue, it's just something I didn't see before. And the console was all nice and clean lately :).

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb If everything else works, could you please approve the PR so we can merge it or is there anything else I should have a look at?

@harmen-xb harmen-xb self-requested a review December 18, 2023 06:26
Copy link
Contributor

@harmen-xb harmen-xb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes all look good. For the mentioned issue in the comment I will make an issue on repo level. Is there an issue in Theia already for this port error message?

@harmen-xb harmen-xb merged commit 0e252e7 into main Dec 18, 2023
5 checks passed
@harmen-xb harmen-xb deleted the feature/mapping branch December 18, 2023 06:31
@harmen-xb
Copy link
Contributor

@martin-fleck-at Yes, PR is merged.

The port error message should be an issue on the Theia repo I assume?

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb Yes, that is correct.

@martin-fleck-at
Copy link
Collaborator Author

@harmen-xb I opened a ticket on the Theia side for it: eclipse-theia/theia#13189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants