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-865: Align client model namespace with server model #291

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Conversation

tortmayr
Copy link
Contributor

@tortmayr tortmayr commented Oct 9, 2023

Also export all SModel elements (and releated) as aliased/augmented classes in the GModel namespace. This means we now can consistently use the GModel syntax on both server and client side.

Move package-internal glsp-sprotty reexport into dedicated package. The package-internal reexport required overhead with tsc-alias which did not play well with the test setup and ide support (auto-import). Using a dedicated package also improved DevXP in glsp-client as auto-import now longer suggests imports from sprotty or sprotty-protocol.

Sprotty and GLSP use different definitions of Action. While they are fully compatible this kind of breaks the IDE support for API that uses Action. e.g. Implementing an IActionHandler would have always auto-imported the wrong Action type (from sprotty-protocol). To bypass this issue we extend the sprotty core API classes in question and reexport them instead (see action-override.ts).

Also:

  • reexport sprotty modules that are used in glsp as FeatureModules.
  • Refactor Argumentable interface to a model feature and rename to ArgsAware and ensure that the argsFeature gets added to each element per default
  • Augment all actions directly provided by sprotty-protocol to provide a typeguard via namespace
  • Move all reusable autocomplete compontens into base package
  • Remove "baseUrl" from tsconfig to avoid breaking "src" auto imports in vscode

Part of eclipse-glsp/glsp/issues/865

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.

Change looks good to me overall but there are a few classes still exported with SModel.... Other than that, I could not identify any issues, thank you Tobias!

packages/client/src/features/tools/edge-creation/test.ts Outdated Show resolved Hide resolved
Also export all SModel elements (and releated) as aliased/augmented classes in the `GModel` namespace.
This means we now can consistently use the GModel syntax on both server and client side.

Move package-internal glsp-sprotty reexport into dedicated package. The package-internal reexport
required overhead with `tsc-alias` which did not play well with the test setup and ide support (auto-import).
Using a dedicated package also improved DevXP in glsp-client as auto-import now longer suggests imports from sprotty
or sprotty-protocol.

Sprotty and GLSP use different definitions of `Action`. While they are fully compatible this kind of breaks the 
IDE support for API that uses `Action`. e.g. Implementing an `IActionHandler` would have always auto-imported the wrong `Action` type
(from sprotty-protocol). To bypass this issue we extend the sprotty core API classes in question and reexport them instead (see action-override.ts).

Also: 
- reexport sprotty modules that are used in glsp as `FeatureModules`.
- Refactor `Argumentable` interface to a model feature and rename to `ArgsAware` and ensure that the argsFeature gets added
to each element per default
- Augment all actions directly provided by sprotty-protocol to provide a typeguard via namespace
- Move all reusable autocomplete compontens into base package
- Remove "baseUrl" from tsconfig to avoid breaking "src" auto imports in vscode

Part of eclipse-glsp/glsp/issues/865
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.

Great, now the changes look good ot me!

@tortmayr tortmayr merged commit eb15d1c into master Oct 9, 2023
6 checks passed
@tortmayr tortmayr deleted the glsp-856 branch October 9, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants