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

GLSP-1398: Properly configure default types #245

Merged
merged 2 commits into from
Aug 30, 2024
Merged

GLSP-1398: Properly configure default types #245

merged 2 commits into from
Aug 30, 2024

Conversation

tortmayr
Copy link
Contributor

What it does

  • Update graph model to add missing GForeignObjectElement and corresponding builder
  • Add empty default constructor to GPreRenderedElementBuilder
  • Update default type mapping configuration
    • Add missing configuration for foreign and shaped prerendered elements
    • Remove redundant registration of subtypes with the same eclass as the parent type
    • Extend deserialization test cases to ensure that all default types are properly deserialized

Fixes eclipse-glsp/glsp#1398

How to test

Follow-ups

Changelog

  • This PR should be mentioned in the changelog
  • This PR introduces a breaking change (if yes, provide more details below for the changelog and the migration guide)

- Update graph model to add missing `GForeignObjectElement` and corresponding builder
- Add empty default constructor to `GPreRenderedElementBuilder`
- Update default type mapping configuration
  - Add missing configuration for foreign and shaped prerendered elements
  - Remove redundant registration of subtypes with the same eclass as the parent type
  - Extend deserialization test cases to ensure that all default types are properly deserialized

Fixes eclipse-glsp/glsp#1398
Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

Besides some minor nitpicks, everything looks good to me and works well! Thank you very much, Tobias!


// shapes
public static final String NODE_CIRCLE = "node:circle";
public static final String NODE_RECTANGLE = "node:rectangle";
public static final String NODE_DIAMOND = "node:diamond";
public static final String FOREIGN_OBJECT = "foreign-object";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: If we are already touching this file, I'd love to align the structuring with https://github.com/eclipse-glsp/glsp-client/blob/master/packages/protocol/src/model/default-types.ts

assertType(nodeChidlren.get(1), GCompartment.class, DefaultTypes.COMPARTMENT);
assertType(nodeChidlren.get(2), GLabel.class, DefaultTypes.LABEL);
assertType(nodeChidlren.get(3), GPort.class, DefaultTypes.PORT);

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: unnecessary empty line.

Copy link
Contributor

@martin-fleck-at martin-fleck-at left a comment

Choose a reason for hiding this comment

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

LGTM!

@tortmayr tortmayr merged commit 80bda42 into master Aug 30, 2024
6 checks passed
@tortmayr tortmayr deleted the glsp-1398 branch August 30, 2024 07:32
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.

Default Type mappings configuration is incomplete
2 participants