-
Notifications
You must be signed in to change notification settings - Fork 30
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-1349 Improve container configuration #355
Conversation
- Add `replace` property to `ModulConfiguration` interface. When resolving feature modules of the replace property, any potential already configured module with the same id will be replaced with the defined module. If there is nothing to replace, the module will be added to the end of the resolved configuration - Add check for non-unique feature module ids to `resolveContainerConfiguration` function. - Add option to enable additional debug logging when loading feature modules. This is usefull during development to get insights about why the container modules are not loaded as expected - Add dedicated `featureIds` to all default modules. If no featureId is provided the number id of the module is reused for creating the featureId. While this works perfectly fine, it makes debugging harder because feature modules are hard to indentify based on their featureid. With this change its now easier to derive the corresponding feature module from the featureid. Fixes eclipse-glsp/glsp#1349
There was a problem hiding this 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 and I really like the semantics that replace
brings with it. Just two minor comments inline.
@@ -46,5 +46,5 @@ export const standaloneExportModule = new FeatureModule( | |||
bind(ExportSvgActionHandler).toSelf().inSingletonScope(); | |||
configureActionHandler(context, ExportSvgAction.KIND, ExportSvgActionHandler); | |||
}, | |||
{ requires: exportModule } | |||
{ featureId: Symbol('standaloneExport'), requires: exportModule } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The exportModule
a few lines up could also profit from an actual Symbol because currently it just gets a number assigned.
if (existingIndex >= 0) { | ||
modules[existingIndex] = replace; | ||
} else { | ||
distinctAdd(modules, replace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you defined this as the intended behavior in the function comments but I feel that the replace
behavior should still log a warning if it does not actually replace another module but defaults to the adding behavior. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
- Update `onSelect` method of autocomplete Widget to dispatch a `input` event instead of a `keyup` event. (Since autocompleter 8.x the suggestion update uses `input` instead of `keyup` - Enable task editor in standalone example by adding an explicit standaloneTaskEditorModule. Fixes eclipse-glsp/glsp#1347 In addition: - Update dependencies and align with sprotty - Use fixed version of vscode-jsonrpc to avoid conflicts with Theia - Restore original container configuration order in `workflow-diagram-module` (was changed on accident in #355)
- Update `onSelect` method of autocomplete Widget to dispatch a `input` event instead of a `keyup` event. (Since autocompleter 8.x the suggestion update uses `input` instead of `keyup` - Enable task editor in standalone example by adding an explicit standaloneTaskEditorModule. Fixes eclipse-glsp/glsp#1347 In addition: - Update dependencies and align with sprotty - Use fixed version of vscode-jsonrpc to avoid conflicts with Theia - Restore original container configuration order in `workflow-diagram-module` (was changed on accident in #355)
What it does
replace
property toModulConfiguration
interface. When resolving feature modules of the replace property, any potential already configured module with the same id will be replaced with the defined module. If there is nothing to replace, the module will be added to the end of the resolved configurationresolveContainerConfiguration
function.featureIds
to all default modules. If no featureId is provided the number id of the module is reused for creating the featureId. While this works perfectly fine, it makes debugging harder because feature modules are hard to indentify based on their featureid. With this change its now easier to derive the corresponding feature module from the featureid.Fixes eclipse-glsp/glsp#1349
How to test
resolveContainerConfiguration
function are inplace and they are also testing the replace behaviordi.config
file of the workflow-standalone example:Follow-ups
Changelog