@eclipse-glsp/server 1.1.0-next.3d7585d.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +642 -0
- package/README.md +8 -0
- package/browser.d.ts +16 -0
- package/browser.js +18 -0
- package/lib/browser/di/app-module.d.ts +24 -0
- package/lib/browser/di/app-module.d.ts.map +1 -0
- package/lib/browser/di/app-module.js +55 -0
- package/lib/browser/di/app-module.js.map +1 -0
- package/lib/browser/di/console-logger.d.ts +29 -0
- package/lib/browser/di/console-logger.d.ts.map +1 -0
- package/lib/browser/di/console-logger.js +81 -0
- package/lib/browser/di/console-logger.js.map +1 -0
- package/lib/browser/index.d.ts +20 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +36 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/launch/worker-server-launcher.d.ts +26 -0
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -0
- package/lib/browser/launch/worker-server-launcher.js +65 -0
- package/lib/browser/launch/worker-server-launcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.d.ts +74 -0
- package/lib/common/actions/action-dispatcher.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.js +128 -0
- package/lib/common/actions/action-dispatcher.js.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts +2 -0
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +1 -0
- package/lib/common/actions/action-dispatcher.spec.js +264 -0
- package/lib/common/actions/action-dispatcher.spec.js.map +1 -0
- package/lib/common/actions/action-handler-registry.d.ts +40 -0
- package/lib/common/actions/action-handler-registry.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.js +65 -0
- package/lib/common/actions/action-handler-registry.js.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts +2 -0
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/actions/action-handler-registry.spec.js +50 -0
- package/lib/common/actions/action-handler-registry.spec.js.map +1 -0
- package/lib/common/actions/action-handler.d.ts +55 -0
- package/lib/common/actions/action-handler.d.ts.map +1 -0
- package/lib/common/actions/action-handler.js +7 -0
- package/lib/common/actions/action-handler.js.map +1 -0
- package/lib/common/actions/client-action-handler.d.ts +30 -0
- package/lib/common/actions/client-action-handler.d.ts.map +1 -0
- package/lib/common/actions/client-action-handler.js +56 -0
- package/lib/common/actions/client-action-handler.js.map +1 -0
- package/lib/common/actions/global-action-provider.d.ts +30 -0
- package/lib/common/actions/global-action-provider.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.js +81 -0
- package/lib/common/actions/global-action-provider.js.map +1 -0
- package/lib/common/actions/global-action-provider.spec.d.ts +2 -0
- package/lib/common/actions/global-action-provider.spec.d.ts.map +1 -0
- package/lib/common/actions/global-action-provider.spec.js +70 -0
- package/lib/common/actions/global-action-provider.spec.js.map +1 -0
- package/lib/common/command/command-stack.d.ts +37 -0
- package/lib/common/command/command-stack.d.ts.map +1 -0
- package/lib/common/command/command-stack.js +48 -0
- package/lib/common/command/command-stack.js.map +1 -0
- package/lib/common/command/command.d.ts +37 -0
- package/lib/common/command/command.d.ts.map +1 -0
- package/lib/common/command/command.js +18 -0
- package/lib/common/command/command.js.map +1 -0
- package/lib/common/di/binding-target.d.ts +73 -0
- package/lib/common/di/binding-target.d.ts.map +1 -0
- package/lib/common/di/binding-target.js +143 -0
- package/lib/common/di/binding-target.js.map +1 -0
- package/lib/common/di/binding-target.spec.d.ts +2 -0
- package/lib/common/di/binding-target.spec.d.ts.map +1 -0
- package/lib/common/di/binding-target.spec.js +121 -0
- package/lib/common/di/binding-target.spec.js.map +1 -0
- package/lib/common/di/client-session-module.d.ts +19 -0
- package/lib/common/di/client-session-module.d.ts.map +1 -0
- package/lib/common/di/client-session-module.js +34 -0
- package/lib/common/di/client-session-module.js.map +1 -0
- package/lib/common/di/diagram-module.d.ts +127 -0
- package/lib/common/di/diagram-module.d.ts.map +1 -0
- package/lib/common/di/diagram-module.js +283 -0
- package/lib/common/di/diagram-module.js.map +1 -0
- package/lib/common/di/glsp-module.d.ts +47 -0
- package/lib/common/di/glsp-module.d.ts.map +1 -0
- package/lib/common/di/glsp-module.js +59 -0
- package/lib/common/di/glsp-module.js.map +1 -0
- package/lib/common/di/multi-binding.d.ts +41 -0
- package/lib/common/di/multi-binding.d.ts.map +1 -0
- package/lib/common/di/multi-binding.js +82 -0
- package/lib/common/di/multi-binding.js.map +1 -0
- package/lib/common/di/multi-bindings.spec.d.ts +2 -0
- package/lib/common/di/multi-bindings.spec.d.ts.map +1 -0
- package/lib/common/di/multi-bindings.spec.js +137 -0
- package/lib/common/di/multi-bindings.spec.js.map +1 -0
- package/lib/common/di/server-module.d.ts +73 -0
- package/lib/common/di/server-module.d.ts.map +1 -0
- package/lib/common/di/server-module.js +103 -0
- package/lib/common/di/server-module.js.map +1 -0
- package/lib/common/di/service-identifiers.d.ts +29 -0
- package/lib/common/di/service-identifiers.d.ts.map +1 -0
- package/lib/common/di/service-identifiers.js +14 -0
- package/lib/common/di/service-identifiers.js.map +1 -0
- package/lib/common/diagram/diagram-configuration.d.ts +89 -0
- package/lib/common/diagram/diagram-configuration.d.ts.map +1 -0
- package/lib/common/diagram/diagram-configuration.js +30 -0
- package/lib/common/diagram/diagram-configuration.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts +25 -0
- package/lib/common/diagram/request-type-hints-action-handler.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.js +53 -0
- package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +2 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +1 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +57 -0
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts +26 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.d.ts.map +1 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +61 -0
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts +63 -0
- package/lib/common/features/contextactions/command-palette-action-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js +72 -0
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts +12 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js +70 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +2 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +34 -0
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts +34 -0
- package/lib/common/features/contextactions/context-actions-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-actions-provider.js +5 -0
- package/lib/common/features/contextactions/context-actions-provider.js.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts +43 -0
- package/lib/common/features/contextactions/context-menu-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js +36 -0
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts +24 -0
- package/lib/common/features/contextactions/request-context-actions-handler.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js +53 -0
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +2 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +63 -0
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts +50 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js +88 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +2 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +1 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +48 -0
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts +14 -0
- package/lib/common/features/directediting/context-edit-validator-registry.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js +57 -0
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +2 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +44 -0
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts +25 -0
- package/lib/common/features/directediting/context-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/context-edit-validator.js +40 -0
- package/lib/common/features/directediting/context-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts +32 -0
- package/lib/common/features/directediting/label-edit-validator.d.ts.map +1 -0
- package/lib/common/features/directediting/label-edit-validator.js +21 -0
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts +26 -0
- package/lib/common/features/directediting/request-edit-validation-handler.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js +61 -0
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +2 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +1 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +97 -0
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +1 -0
- package/lib/common/features/layout/layout-engine.d.ts +29 -0
- package/lib/common/features/layout/layout-engine.d.ts.map +1 -0
- package/lib/common/features/layout/layout-engine.js +20 -0
- package/lib/common/features/layout/layout-engine.js.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts +28 -0
- package/lib/common/features/layout/layout-operation-handler.d.ts.map +1 -0
- package/lib/common/features/layout/layout-operation-handler.js +66 -0
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -0
- package/lib/common/features/model/gmodel-factory.d.ts +39 -0
- package/lib/common/features/model/gmodel-factory.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-factory.js +39 -0
- package/lib/common/features/model/gmodel-factory.js.map +1 -0
- package/lib/common/features/model/gmodel-index.d.ts +107 -0
- package/lib/common/features/model/gmodel-index.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-index.js +193 -0
- package/lib/common/features/model/gmodel-index.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.d.ts +67 -0
- package/lib/common/features/model/gmodel-serializer.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.js +143 -0
- package/lib/common/features/model/gmodel-serializer.js.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +2 -0
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +1 -0
- package/lib/common/features/model/gmodel-serializer.spec.js +124 -0
- package/lib/common/features/model/gmodel-serializer.spec.js.map +1 -0
- package/lib/common/features/model/model-state.d.ts +53 -0
- package/lib/common/features/model/model-state.d.ts.map +1 -0
- package/lib/common/features/model/model-state.js +75 -0
- package/lib/common/features/model/model-state.js.map +1 -0
- package/lib/common/features/model/model-submission-handler.d.ts +56 -0
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -0
- package/lib/common/features/model/model-submission-handler.js +97 -0
- package/lib/common/features/model/model-submission-handler.js.map +1 -0
- package/lib/common/features/model/request-model-action-handler.d.ts +37 -0
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/request-model-action-handler.js +83 -0
- package/lib/common/features/model/request-model-action-handler.js.map +1 -0
- package/lib/common/features/model/save-model-action-handler.d.ts +26 -0
- package/lib/common/features/model/save-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/model/save-model-action-handler.js +54 -0
- package/lib/common/features/model/save-model-action-handler.js.map +1 -0
- package/lib/common/features/model/source-model-storage.d.ts +47 -0
- package/lib/common/features/model/source-model-storage.d.ts.map +1 -0
- package/lib/common/features/model/source-model-storage.js +5 -0
- package/lib/common/features/model/source-model-storage.js.map +1 -0
- package/lib/common/features/navigation/json-opener-options.d.ts +36 -0
- package/lib/common/features/navigation/json-opener-options.d.ts.map +1 -0
- package/lib/common/features/navigation/json-opener-options.js +60 -0
- package/lib/common/features/navigation/json-opener-options.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts +12 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js +47 -0
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts +48 -0
- package/lib/common/features/navigation/navigation-target-provider.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-provider.js +5 -0
- package/lib/common/features/navigation/navigation-target-provider.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts +23 -0
- package/lib/common/features/navigation/navigation-target-resolution.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolution.js +12 -0
- package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts +31 -0
- package/lib/common/features/navigation/navigation-target-resolver.d.ts.map +1 -0
- package/lib/common/features/navigation/navigation-target-resolver.js +49 -0
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts +24 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +55 -0
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts +26 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.d.ts.map +1 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +59 -0
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -0
- package/lib/common/features/popup/popup-model-factory.d.ts +36 -0
- package/lib/common/features/popup/popup-model-factory.d.ts.map +1 -0
- package/lib/common/features/popup/popup-model-factory.js +20 -0
- package/lib/common/features/popup/popup-model-factory.js.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts +31 -0
- package/lib/common/features/popup/request-popup-model-action-handler.d.ts.map +1 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js +77 -0
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -0
- package/lib/common/features/validation/model-validator.d.ts +33 -0
- package/lib/common/features/validation/model-validator.d.ts.map +1 -0
- package/lib/common/features/validation/model-validator.js +5 -0
- package/lib/common/features/validation/model-validator.js.map +1 -0
- package/lib/common/features/validation/request-markers-handler.d.ts +11 -0
- package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -0
- package/lib/common/features/validation/request-markers-handler.js +70 -0
- package/lib/common/features/validation/request-markers-handler.js.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts +9 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +55 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts +2 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.spec.d.ts.map +1 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js +38 -0
- package/lib/common/gmodel/apply-label-edit-operation-handler.spec.js.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts +10 -0
- package/lib/common/gmodel/change-bounds-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js +71 -0
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts +24 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js +53 -0
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -0
- package/lib/common/gmodel/computed-bounds-action-handler.d.ts +29 -0
- package/lib/common/gmodel/computed-bounds-action-handler.d.ts.map +1 -0
- package/lib/common/gmodel/computed-bounds-action-handler.js +50 -0
- package/lib/common/gmodel/computed-bounds-action-handler.js.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts +32 -0
- package/lib/common/gmodel/delete-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/delete-operation-handler.js +116 -0
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts +31 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +65 -0
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts +31 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +58 -0
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts +31 -0
- package/lib/common/gmodel/gmodel-diagram-module.d.ts.map +1 -0
- package/lib/common/gmodel/gmodel-diagram-module.js +86 -0
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -0
- package/lib/common/gmodel/index.d.ts +26 -0
- package/lib/common/gmodel/index.d.ts.map +1 -0
- package/lib/common/gmodel/index.js +42 -0
- package/lib/common/gmodel/index.js.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts +35 -0
- package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/paste-operation-handler.js +131 -0
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts +9 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.d.ts.map +1 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +67 -0
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -0
- package/lib/common/index.d.ts +88 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +104 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/launch/glsp-server-launcher.d.ts +34 -0
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -0
- package/lib/common/launch/glsp-server-launcher.js +64 -0
- package/lib/common/launch/glsp-server-launcher.js.map +1 -0
- package/lib/common/operations/compound-operation-handler.d.ts +25 -0
- package/lib/common/operations/compound-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/compound-operation-handler.js +54 -0
- package/lib/common/operations/compound-operation-handler.js.map +1 -0
- package/lib/common/operations/create-operation-handler.d.ts +64 -0
- package/lib/common/operations/create-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/create-operation-handler.js +90 -0
- package/lib/common/operations/create-operation-handler.js.map +1 -0
- package/lib/common/operations/cut-operation-handler.d.ts +25 -0
- package/lib/common/operations/cut-operation-handler.d.ts.map +1 -0
- package/lib/common/operations/cut-operation-handler.js +53 -0
- package/lib/common/operations/cut-operation-handler.js.map +1 -0
- package/lib/common/operations/operation-action-handler.d.ts +33 -0
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-action-handler.js +94 -0
- package/lib/common/operations/operation-action-handler.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.d.ts +29 -0
- package/lib/common/operations/operation-handler-registry.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.js +58 -0
- package/lib/common/operations/operation-handler-registry.js.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts +2 -0
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +1 -0
- package/lib/common/operations/operation-handler-registry.spec.js +50 -0
- package/lib/common/operations/operation-handler-registry.spec.js.map +1 -0
- package/lib/common/operations/operation-handler.d.ts +50 -0
- package/lib/common/operations/operation-handler.d.ts.map +1 -0
- package/lib/common/operations/operation-handler.js +7 -0
- package/lib/common/operations/operation-handler.js.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts +45 -0
- package/lib/common/protocol/glsp-client-proxy.d.ts.map +1 -0
- package/lib/common/protocol/glsp-client-proxy.js +53 -0
- package/lib/common/protocol/glsp-client-proxy.js.map +1 -0
- package/lib/common/protocol/glsp-server-listener.d.ts +37 -0
- package/lib/common/protocol/glsp-server-listener.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server-listener.js +5 -0
- package/lib/common/protocol/glsp-server-listener.js.map +1 -0
- package/lib/common/protocol/glsp-server.d.ts +150 -0
- package/lib/common/protocol/glsp-server.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.js +188 -0
- package/lib/common/protocol/glsp-server.js.map +1 -0
- package/lib/common/protocol/glsp-server.spec.d.ts +2 -0
- package/lib/common/protocol/glsp-server.spec.d.ts.map +1 -0
- package/lib/common/protocol/glsp-server.spec.js +119 -0
- package/lib/common/protocol/glsp-server.spec.js.map +1 -0
- package/lib/common/session/client-session-factory.d.ts +42 -0
- package/lib/common/session/client-session-factory.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.js +54 -0
- package/lib/common/session/client-session-factory.js.map +1 -0
- package/lib/common/session/client-session-factory.spec.d.ts +2 -0
- package/lib/common/session/client-session-factory.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-factory.spec.js +56 -0
- package/lib/common/session/client-session-factory.spec.js.map +1 -0
- package/lib/common/session/client-session-initializer.d.ts +26 -0
- package/lib/common/session/client-session-initializer.d.ts.map +1 -0
- package/lib/common/session/client-session-initializer.js +5 -0
- package/lib/common/session/client-session-initializer.js.map +1 -0
- package/lib/common/session/client-session-listener.d.ts +40 -0
- package/lib/common/session/client-session-listener.d.ts.map +1 -0
- package/lib/common/session/client-session-listener.js +3 -0
- package/lib/common/session/client-session-listener.js.map +1 -0
- package/lib/common/session/client-session-manager.d.ts +102 -0
- package/lib/common/session/client-session-manager.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.js +116 -0
- package/lib/common/session/client-session-manager.js.map +1 -0
- package/lib/common/session/client-session-manager.spec.d.ts +2 -0
- package/lib/common/session/client-session-manager.spec.d.ts.map +1 -0
- package/lib/common/session/client-session-manager.spec.js +74 -0
- package/lib/common/session/client-session-manager.spec.js.map +1 -0
- package/lib/common/session/client-session.d.ts +52 -0
- package/lib/common/session/client-session.d.ts.map +1 -0
- package/lib/common/session/client-session.js +34 -0
- package/lib/common/session/client-session.js.map +1 -0
- package/lib/common/test/mock-util.d.ts +110 -0
- package/lib/common/test/mock-util.d.ts.map +1 -0
- package/lib/common/test/mock-util.js +211 -0
- package/lib/common/test/mock-util.js.map +1 -0
- package/lib/common/utils/args-util.d.ts +38 -0
- package/lib/common/utils/args-util.d.ts.map +1 -0
- package/lib/common/utils/args-util.js +81 -0
- package/lib/common/utils/args-util.js.map +1 -0
- package/lib/common/utils/client-options-util.d.ts +20 -0
- package/lib/common/utils/client-options-util.d.ts.map +1 -0
- package/lib/common/utils/client-options-util.js +26 -0
- package/lib/common/utils/client-options-util.js.map +1 -0
- package/lib/common/utils/glsp-server-error.d.ts +21 -0
- package/lib/common/utils/glsp-server-error.d.ts.map +1 -0
- package/lib/common/utils/glsp-server-error.js +33 -0
- package/lib/common/utils/glsp-server-error.js.map +1 -0
- package/lib/common/utils/layout-util.d.ts +74 -0
- package/lib/common/utils/layout-util.d.ts.map +1 -0
- package/lib/common/utils/layout-util.js +166 -0
- package/lib/common/utils/layout-util.js.map +1 -0
- package/lib/common/utils/logger.d.ts +27 -0
- package/lib/common/utils/logger.d.ts.map +1 -0
- package/lib/common/utils/logger.js +67 -0
- package/lib/common/utils/logger.js.map +1 -0
- package/lib/common/utils/promise-queue.d.ts +48 -0
- package/lib/common/utils/promise-queue.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.js +93 -0
- package/lib/common/utils/promise-queue.js.map +1 -0
- package/lib/common/utils/promise-queue.spec.d.ts +2 -0
- package/lib/common/utils/promise-queue.spec.d.ts.map +1 -0
- package/lib/common/utils/promise-queue.spec.js +117 -0
- package/lib/common/utils/promise-queue.spec.js.map +1 -0
- package/lib/common/utils/registry.d.ts +73 -0
- package/lib/common/utils/registry.d.ts.map +1 -0
- package/lib/common/utils/registry.js +160 -0
- package/lib/common/utils/registry.js.map +1 -0
- package/lib/common/utils/registry.spec.d.ts +2 -0
- package/lib/common/utils/registry.spec.d.ts.map +1 -0
- package/lib/common/utils/registry.spec.js +199 -0
- package/lib/common/utils/registry.spec.js.map +1 -0
- package/lib/node/abstract-json-model-storage.d.ts +45 -0
- package/lib/node/abstract-json-model-storage.d.ts.map +1 -0
- package/lib/node/abstract-json-model-storage.js +103 -0
- package/lib/node/abstract-json-model-storage.js.map +1 -0
- package/lib/node/di/app-module.d.ts +36 -0
- package/lib/node/di/app-module.d.ts.map +1 -0
- package/lib/node/di/app-module.js +91 -0
- package/lib/node/di/app-module.js.map +1 -0
- package/lib/node/di/winston-logger.d.ts +32 -0
- package/lib/node/di/winston-logger.d.ts.map +1 -0
- package/lib/node/di/winston-logger.js +57 -0
- package/lib/node/di/winston-logger.js.map +1 -0
- package/lib/node/gmodel/gmodel-storage.d.ts +34 -0
- package/lib/node/gmodel/gmodel-storage.d.ts.map +1 -0
- package/lib/node/gmodel/gmodel-storage.js +68 -0
- package/lib/node/gmodel/gmodel-storage.js.map +1 -0
- package/lib/node/index.d.ts +24 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +40 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/launch/cli-parser.d.ts +34 -0
- package/lib/node/launch/cli-parser.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.js +71 -0
- package/lib/node/launch/cli-parser.js.map +1 -0
- package/lib/node/launch/cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/cli-parser.spec.js +56 -0
- package/lib/node/launch/cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.d.ts +9 -0
- package/lib/node/launch/socket-cli-parser.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.js +43 -0
- package/lib/node/launch/socket-cli-parser.js.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts +2 -0
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-cli-parser.spec.js +66 -0
- package/lib/node/launch/socket-cli-parser.spec.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.d.ts +34 -0
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.js +104 -0
- package/lib/node/launch/socket-server-launcher.js.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts +17 -0
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +1 -0
- package/lib/node/launch/socket-server-launcher.spec.js +70 -0
- package/lib/node/launch/socket-server-launcher.spec.js.map +1 -0
- package/node.d.ts +16 -0
- package/node.js +18 -0
- package/package.json +76 -0
- package/src/browser/di/app-module.ts +55 -0
- package/src/browser/di/console-logger.ts +71 -0
- package/src/browser/index.ts +19 -0
- package/src/browser/launch/worker-server-launcher.ts +58 -0
- package/src/common/actions/action-dispatcher.spec.ts +290 -0
- package/src/common/actions/action-dispatcher.ts +152 -0
- package/src/common/actions/action-handler-registry.spec.ts +52 -0
- package/src/common/actions/action-handler-registry.ts +60 -0
- package/src/common/actions/action-handler.ts +62 -0
- package/src/common/actions/client-action-handler.ts +50 -0
- package/src/common/actions/global-action-provider.spec.ts +79 -0
- package/src/common/actions/global-action-provider.ts +72 -0
- package/src/common/command/command-stack.ts +74 -0
- package/src/common/command/command.ts +39 -0
- package/src/common/di/binding-target.spec.ts +147 -0
- package/src/common/di/binding-target.ts +188 -0
- package/src/common/di/client-session-module.ts +29 -0
- package/src/common/di/diagram-module.ts +397 -0
- package/src/common/di/glsp-module.ts +66 -0
- package/src/common/di/multi-binding.ts +89 -0
- package/src/common/di/multi-bindings.spec.ts +133 -0
- package/src/common/di/server-module.ts +131 -0
- package/src/common/di/service-identifiers.ts +39 -0
- package/src/common/diagram/diagram-configuration.ts +97 -0
- package/src/common/diagram/request-type-hints-action-handler.spec.ts +59 -0
- package/src/common/diagram/request-type-hints-action-handler.ts +36 -0
- package/src/common/features/clipboard/request-clipboard-data-action-handler.ts +51 -0
- package/src/common/features/contextactions/command-palette-action-provider.ts +94 -0
- package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +69 -0
- package/src/common/features/contextactions/context-actions-provider-registry.ts +47 -0
- package/src/common/features/contextactions/context-actions-provider.ts +36 -0
- package/src/common/features/contextactions/context-menu-item-provider.ts +52 -0
- package/src/common/features/contextactions/request-context-actions-handler.spec.ts +75 -0
- package/src/common/features/contextactions/request-context-actions-handler.ts +37 -0
- package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +46 -0
- package/src/common/features/contextactions/tool-palette-item-provider.ts +90 -0
- package/src/common/features/directediting/context-edit-validator-registry.spec.ts +54 -0
- package/src/common/features/directediting/context-edit-validator-registry.ts +43 -0
- package/src/common/features/directediting/context-edit-validator.ts +55 -0
- package/src/common/features/directediting/label-edit-validator.ts +35 -0
- package/src/common/features/directediting/request-edit-validation-handler.spec.ts +131 -0
- package/src/common/features/directediting/request-edit-validation-handler.ts +43 -0
- package/src/common/features/layout/layout-engine.ts +31 -0
- package/src/common/features/layout/layout-operation-handler.ts +47 -0
- package/src/common/features/model/gmodel-factory.ts +60 -0
- package/src/common/features/model/gmodel-index.ts +195 -0
- package/src/common/features/model/gmodel-serializer.spec.ts +141 -0
- package/src/common/features/model/gmodel-serializer.ts +175 -0
- package/src/common/features/model/model-state.ts +101 -0
- package/src/common/features/model/model-submission-handler.ts +106 -0
- package/src/common/features/model/request-model-action-handler.ts +67 -0
- package/src/common/features/model/save-model-action-handler.ts +38 -0
- package/src/common/features/model/source-model-storage.ts +49 -0
- package/src/common/features/navigation/json-opener-options.ts +69 -0
- package/src/common/features/navigation/navigation-target-provider-registry.ts +36 -0
- package/src/common/features/navigation/navigation-target-provider.ts +50 -0
- package/src/common/features/navigation/navigation-target-resolution.ts +22 -0
- package/src/common/features/navigation/navigation-target-resolver.ts +61 -0
- package/src/common/features/navigation/request-navigation-targets-action-handler.ts +39 -0
- package/src/common/features/navigation/resolve-navigation-targets-action-handler.ts +42 -0
- package/src/common/features/popup/popup-model-factory.ts +38 -0
- package/src/common/features/popup/request-popup-model-action-handler.ts +60 -0
- package/src/common/features/validation/model-validator.ts +34 -0
- package/src/common/features/validation/request-markers-handler.ts +51 -0
- package/src/common/gmodel/README.md +7 -0
- package/src/common/gmodel/apply-label-edit-operation-handler.spec.ts +40 -0
- package/src/common/gmodel/apply-label-edit-operation-handler.ts +38 -0
- package/src/common/gmodel/change-bounds-operation-handler.ts +58 -0
- package/src/common/gmodel/change-routing-points-operation-handler.ts +39 -0
- package/src/common/gmodel/computed-bounds-action-handler.ts +51 -0
- package/src/common/gmodel/delete-operation-handler.ts +115 -0
- package/src/common/gmodel/gmodel-create-edge-operation-handler.ts +58 -0
- package/src/common/gmodel/gmodel-create-node-operation-handler.ts +47 -0
- package/src/common/gmodel/gmodel-diagram-module.ts +81 -0
- package/src/common/gmodel/index.ts +26 -0
- package/src/common/gmodel/paste-operation-handler.ts +119 -0
- package/src/common/gmodel/reconnect-edge-operation-handler.ts +55 -0
- package/src/common/index.ts +88 -0
- package/src/common/launch/glsp-server-launcher.ts +70 -0
- package/src/common/operations/compound-operation-handler.ts +38 -0
- package/src/common/operations/create-operation-handler.ts +106 -0
- package/src/common/operations/cut-operation-handler.ts +38 -0
- package/src/common/operations/operation-action-handler.ts +69 -0
- package/src/common/operations/operation-handler-registry.spec.ts +50 -0
- package/src/common/operations/operation-handler-registry.ts +51 -0
- package/src/common/operations/operation-handler.ts +57 -0
- package/src/common/protocol/glsp-client-proxy.ts +65 -0
- package/src/common/protocol/glsp-server-listener.ts +39 -0
- package/src/common/protocol/glsp-server.spec.ts +150 -0
- package/src/common/protocol/glsp-server.ts +320 -0
- package/src/common/session/client-session-factory.spec.ts +60 -0
- package/src/common/session/client-session-factory.ts +70 -0
- package/src/common/session/client-session-initializer.ts +27 -0
- package/src/common/session/client-session-listener.ts +41 -0
- package/src/common/session/client-session-manager.spec.ts +82 -0
- package/src/common/session/client-session-manager.ts +182 -0
- package/src/common/session/client-session.ts +62 -0
- package/src/common/test/mock-util.ts +256 -0
- package/src/common/utils/args-util.ts +98 -0
- package/src/common/utils/client-options-util.ts +22 -0
- package/src/common/utils/glsp-server-error.ts +27 -0
- package/src/common/utils/layout-util.ts +164 -0
- package/src/common/utils/logger.ts +72 -0
- package/src/common/utils/promise-queue.spec.ts +138 -0
- package/src/common/utils/promise-queue.ts +103 -0
- package/src/common/utils/registry.spec.ts +223 -0
- package/src/common/utils/registry.ts +154 -0
- package/src/node/abstract-json-model-storage.ts +114 -0
- package/src/node/di/app-module.ts +102 -0
- package/src/node/di/winston-logger.ts +76 -0
- package/src/node/gmodel/gmodel-storage.ts +53 -0
- package/src/node/index.ts +23 -0
- package/src/node/launch/cli-parser.spec.ts +61 -0
- package/src/node/launch/cli-parser.ts +86 -0
- package/src/node/launch/socket-cli-parser.spec.ts +73 -0
- package/src/node/launch/socket-cli-parser.ts +52 -0
- package/src/node/launch/socket-server-launcher.spec.ts +68 -0
- package/src/node/launch/socket-server-launcher.ts +90 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ContainerModule, interfaces } from 'inversify';
|
|
17
|
+
import { AbstractMultiBinding } from './multi-binding';
|
|
18
|
+
/**
|
|
19
|
+
* A wrapper interface to get access to the binding related functions
|
|
20
|
+
* for a inversify container.
|
|
21
|
+
*/
|
|
22
|
+
export interface ModuleContext {
|
|
23
|
+
bind: interfaces.Bind;
|
|
24
|
+
unbind: interfaces.Unbind;
|
|
25
|
+
isBound: interfaces.IsBound;
|
|
26
|
+
rebind: interfaces.Rebind;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Common super class for GLSP {@link ContainerModule}s.
|
|
30
|
+
*/
|
|
31
|
+
export declare abstract class GLSPModule extends ContainerModule {
|
|
32
|
+
static CLIENT_ACTIONS: string;
|
|
33
|
+
protected context: ModuleContext;
|
|
34
|
+
constructor();
|
|
35
|
+
protected abstract configure(bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind): void;
|
|
36
|
+
/**
|
|
37
|
+
* Configuration method for multibound values. The passed configurator is typically a submethod of this module. This
|
|
38
|
+
* means
|
|
39
|
+
* that subclasses can customize the {@link MultiBinding} object before the actual {@link MultiBinding} is created.
|
|
40
|
+
*
|
|
41
|
+
* @param <T> Type of the {@link MultiBinding}
|
|
42
|
+
* @param binding The multi binding configuration object
|
|
43
|
+
* @param configurator The consumer that should be used to configure the given {@link MultiBinding}
|
|
44
|
+
*/
|
|
45
|
+
protected configureMultiBinding<T>(binding: AbstractMultiBinding<T>, configurator: (binding: AbstractMultiBinding<T>) => void): void;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=glsp-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glsp-module.d.ts","sourceRoot":"","sources":["../../../src/common/di/glsp-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,eAAe,EAAc,UAAU,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;IAC1B,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,8BACsB,UAAW,SAAQ,eAAe;IACpD,OAAc,cAAc,SAAmB;IAE/C,SAAS,CAAC,OAAO,EAAE,aAAa,CAAC;;IASjC,SAAS,CAAC,QAAQ,CAAC,SAAS,CACxB,IAAI,EAAE,UAAU,CAAC,IAAI,EACrB,MAAM,EAAE,UAAU,CAAC,MAAM,EACzB,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,UAAU,CAAC,MAAM,GAC1B,IAAI;IAEP;;;;;;;;OAQG;IACH,SAAS,CAAC,qBAAqB,CAAC,CAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI;CAIvI"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GLSPModule = void 0;
|
|
13
|
+
/********************************************************************************
|
|
14
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
15
|
+
*
|
|
16
|
+
* This program and the accompanying materials are made available under the
|
|
17
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
18
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
19
|
+
*
|
|
20
|
+
* This Source Code may also be made available under the following Secondary
|
|
21
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
22
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
23
|
+
* with the GNU Classpath Exception which is available at
|
|
24
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
25
|
+
*
|
|
26
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
27
|
+
********************************************************************************/
|
|
28
|
+
const inversify_1 = require("inversify");
|
|
29
|
+
/**
|
|
30
|
+
* Common super class for GLSP {@link ContainerModule}s.
|
|
31
|
+
*/
|
|
32
|
+
let GLSPModule = class GLSPModule extends inversify_1.ContainerModule {
|
|
33
|
+
constructor() {
|
|
34
|
+
super((bind, unbind, isBound, rebind) => {
|
|
35
|
+
this.context = { bind, unbind, isBound, rebind };
|
|
36
|
+
this.configure(bind, unbind, isBound, rebind);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Configuration method for multibound values. The passed configurator is typically a submethod of this module. This
|
|
41
|
+
* means
|
|
42
|
+
* that subclasses can customize the {@link MultiBinding} object before the actual {@link MultiBinding} is created.
|
|
43
|
+
*
|
|
44
|
+
* @param <T> Type of the {@link MultiBinding}
|
|
45
|
+
* @param binding The multi binding configuration object
|
|
46
|
+
* @param configurator The consumer that should be used to configure the given {@link MultiBinding}
|
|
47
|
+
*/
|
|
48
|
+
configureMultiBinding(binding, configurator) {
|
|
49
|
+
configurator(binding);
|
|
50
|
+
binding.applyBindings(this.context);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
GLSPModule.CLIENT_ACTIONS = 'ClientActions';
|
|
54
|
+
GLSPModule = __decorate([
|
|
55
|
+
(0, inversify_1.injectable)(),
|
|
56
|
+
__metadata("design:paramtypes", [])
|
|
57
|
+
], GLSPModule);
|
|
58
|
+
exports.GLSPModule = GLSPModule;
|
|
59
|
+
//# sourceMappingURL=glsp-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glsp-module.js","sourceRoot":"","sources":["../../../src/common/di/glsp-module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yCAAoE;AAcpE;;GAEG;AAEI,IAAe,UAAU,GAAzB,MAAe,UAAW,SAAQ,2BAAe;IAKpD;QACI,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;YACpC,IAAI,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YACjD,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACP,CAAC;IASD;;;;;;;;OAQG;IACO,qBAAqB,CAAI,OAAgC,EAAE,YAAwD;QACzH,YAAY,CAAC,OAAO,CAAC,CAAC;QACtB,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;;AA9Ba,yBAAc,GAAG,eAAe,CAAC;AAD7B,UAAU;IAD/B,IAAA,sBAAU,GAAE;;GACS,UAAU,CAgC/B;AAhCqB,gCAAU"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BindingTarget } from './binding-target';
|
|
2
|
+
import { ModuleContext } from './glsp-module';
|
|
3
|
+
/**
|
|
4
|
+
* A helper class used in `GLSPModules` to ease the configuration of multi-injected service identifiers.
|
|
5
|
+
* Instead of directly binding to the service identifier a new multi binding object can be created. This object
|
|
6
|
+
* should then be passed to a overridable configuration-function (i.e. configure(binding:V)=>void). This gives subclasses of the
|
|
7
|
+
* `GLSPModule` the chance to manipulate the binding configuration using the provided manipulation methods (e.g. add,remove, rebind).
|
|
8
|
+
* Once the configuration is finished the binding can be finalized using the {@link AbstractMultiBinding.applyBindings} method.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class AbstractMultiBinding<T> {
|
|
11
|
+
readonly identifier: string | symbol;
|
|
12
|
+
protected bindings: T[];
|
|
13
|
+
constructor(identifier: string | symbol);
|
|
14
|
+
abstract applyBindings(context: ModuleContext): void;
|
|
15
|
+
add(newBinding: T): void;
|
|
16
|
+
addAll(newBindings: T[]): void;
|
|
17
|
+
addAll(...newBindings: T[]): void;
|
|
18
|
+
remove(toRemove: T): void;
|
|
19
|
+
removeAll(toRemove: T[]): void;
|
|
20
|
+
rebind(oldBinding: T, newBinding: T): void;
|
|
21
|
+
contains(binding: T): boolean;
|
|
22
|
+
getAll(): T[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Implementation of {@link AbstractMultiBinding} for multi-injected values that using an arbitrary {@link BindingTarget}.
|
|
26
|
+
*
|
|
27
|
+
* @typeparam T the base type of {@link BindingTarget}.
|
|
28
|
+
*/
|
|
29
|
+
export declare class MultiBinding<T> extends AbstractMultiBinding<BindingTarget<T>> {
|
|
30
|
+
applyBindings(context: ModuleContext): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Implementation of {@link AbstractMultiBinding} for multi-injected values that should be bound to concrete instance using the
|
|
34
|
+
* `bind(serviceIdentifier).toConstantValue(MyCustomBinding) syntax.
|
|
35
|
+
*
|
|
36
|
+
* * @typeparam T the type of the instances
|
|
37
|
+
*/
|
|
38
|
+
export declare class InstanceMultiBinding<T> extends AbstractMultiBinding<T> {
|
|
39
|
+
applyBindings(context: ModuleContext): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=multi-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-binding.d.ts","sourceRoot":"","sources":["../../../src/common/di/multi-binding.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAsB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;GAMG;AACH,8BAAsB,oBAAoB,CAAC,CAAC;IAG5B,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAFhD,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAM;gBAER,UAAU,EAAE,MAAM,GAAG,MAAM;IAEhD,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAEpD,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,IAAI;IAIxB,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,GAAG,IAAI;IAC9B,MAAM,CAAC,GAAG,WAAW,EAAE,CAAC,EAAE,GAAG,IAAI;IAOjC,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,IAAI;IAIzB,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,IAAI;IAI9B,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,IAAI;IAK1C,QAAQ,CAAC,OAAO,EAAE,CAAC,GAAG,OAAO;IAI7B,MAAM,IAAI,CAAC,EAAE;CAGhB;AAED;;;;GAIG;AACH,qBAAa,YAAY,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACvE,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAG9C;AAED;;;;;GAKG;AACH,qBAAa,oBAAoB,CAAC,CAAC,CAAE,SAAQ,oBAAoB,CAAC,CAAC,CAAC;IAChE,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAG9C"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InstanceMultiBinding = exports.MultiBinding = exports.AbstractMultiBinding = void 0;
|
|
4
|
+
/********************************************************************************
|
|
5
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
6
|
+
*
|
|
7
|
+
* This program and the accompanying materials are made available under the
|
|
8
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
9
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
10
|
+
*
|
|
11
|
+
* This Source Code may also be made available under the following Secondary
|
|
12
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
13
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
14
|
+
* with the GNU Classpath Exception which is available at
|
|
15
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
16
|
+
*
|
|
17
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
18
|
+
********************************************************************************/
|
|
19
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
20
|
+
const binding_target_1 = require("./binding-target");
|
|
21
|
+
/**
|
|
22
|
+
* A helper class used in `GLSPModules` to ease the configuration of multi-injected service identifiers.
|
|
23
|
+
* Instead of directly binding to the service identifier a new multi binding object can be created. This object
|
|
24
|
+
* should then be passed to a overridable configuration-function (i.e. configure(binding:V)=>void). This gives subclasses of the
|
|
25
|
+
* `GLSPModule` the chance to manipulate the binding configuration using the provided manipulation methods (e.g. add,remove, rebind).
|
|
26
|
+
* Once the configuration is finished the binding can be finalized using the {@link AbstractMultiBinding.applyBindings} method.
|
|
27
|
+
*/
|
|
28
|
+
class AbstractMultiBinding {
|
|
29
|
+
constructor(identifier) {
|
|
30
|
+
this.identifier = identifier;
|
|
31
|
+
this.bindings = [];
|
|
32
|
+
}
|
|
33
|
+
add(newBinding) {
|
|
34
|
+
(0, protocol_1.distinctAdd)(this.bindings, newBinding);
|
|
35
|
+
}
|
|
36
|
+
addAll(...newBindings) {
|
|
37
|
+
const result = [];
|
|
38
|
+
(0, protocol_1.flatPush)(result, newBindings);
|
|
39
|
+
result.forEach(newBinding => this.add(newBinding));
|
|
40
|
+
}
|
|
41
|
+
remove(toRemove) {
|
|
42
|
+
(0, protocol_1.remove)(this.bindings, toRemove);
|
|
43
|
+
}
|
|
44
|
+
removeAll(toRemove) {
|
|
45
|
+
return toRemove.forEach(binding => this.remove(binding));
|
|
46
|
+
}
|
|
47
|
+
rebind(oldBinding, newBinding) {
|
|
48
|
+
this.remove(oldBinding);
|
|
49
|
+
this.add(newBinding);
|
|
50
|
+
}
|
|
51
|
+
contains(binding) {
|
|
52
|
+
return this.bindings.includes(binding);
|
|
53
|
+
}
|
|
54
|
+
getAll() {
|
|
55
|
+
return this.bindings;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.AbstractMultiBinding = AbstractMultiBinding;
|
|
59
|
+
/**
|
|
60
|
+
* Implementation of {@link AbstractMultiBinding} for multi-injected values that using an arbitrary {@link BindingTarget}.
|
|
61
|
+
*
|
|
62
|
+
* @typeparam T the base type of {@link BindingTarget}.
|
|
63
|
+
*/
|
|
64
|
+
class MultiBinding extends AbstractMultiBinding {
|
|
65
|
+
applyBindings(context) {
|
|
66
|
+
this.bindings.forEach(binding => (0, binding_target_1.applyBindingTarget)(context, this.identifier, binding));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.MultiBinding = MultiBinding;
|
|
70
|
+
/**
|
|
71
|
+
* Implementation of {@link AbstractMultiBinding} for multi-injected values that should be bound to concrete instance using the
|
|
72
|
+
* `bind(serviceIdentifier).toConstantValue(MyCustomBinding) syntax.
|
|
73
|
+
*
|
|
74
|
+
* * @typeparam T the type of the instances
|
|
75
|
+
*/
|
|
76
|
+
class InstanceMultiBinding extends AbstractMultiBinding {
|
|
77
|
+
applyBindings(context) {
|
|
78
|
+
context.bind(this.identifier).toConstantValue(this.bindings);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.InstanceMultiBinding = InstanceMultiBinding;
|
|
82
|
+
//# sourceMappingURL=multi-binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-binding.js","sourceRoot":"","sources":["../../../src/common/di/multi-binding.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAmF;AACnF,qDAAqE;AAGrE;;;;;;GAMG;AACH,MAAsB,oBAAoB;IAGtC,YAAqB,UAA2B;QAA3B,eAAU,GAAV,UAAU,CAAiB;QAFtC,aAAQ,GAAQ,EAAE,CAAC;IAEsB,CAAC;IAIpD,GAAG,CAAC,UAAa;QACb,IAAA,sBAAW,EAA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AAC,IAAI,CAAC,UAAU,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;CACJ;AAJD,oDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-bindings.spec.d.ts","sourceRoot":"","sources":["../../../src/common/di/multi-bindings.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
/********************************************************************************
|
|
10
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
11
|
+
*
|
|
12
|
+
* This program and the accompanying materials are made available under the
|
|
13
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
14
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
15
|
+
*
|
|
16
|
+
* This Source Code may also be made available under the following Secondary
|
|
17
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
18
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
19
|
+
* with the GNU Classpath Exception which is available at
|
|
20
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
21
|
+
*
|
|
22
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
23
|
+
********************************************************************************/
|
|
24
|
+
const chai_1 = require("chai");
|
|
25
|
+
const inversify_1 = require("inversify");
|
|
26
|
+
const multi_binding_1 = require("./multi-binding");
|
|
27
|
+
let TestClass = class TestClass {
|
|
28
|
+
};
|
|
29
|
+
TestClass = __decorate([
|
|
30
|
+
(0, inversify_1.injectable)()
|
|
31
|
+
], TestClass);
|
|
32
|
+
let TestClass1 = class TestClass1 extends TestClass {
|
|
33
|
+
};
|
|
34
|
+
TestClass1 = __decorate([
|
|
35
|
+
(0, inversify_1.injectable)()
|
|
36
|
+
], TestClass1);
|
|
37
|
+
let TestClass2 = class TestClass2 extends TestClass {
|
|
38
|
+
};
|
|
39
|
+
TestClass2 = __decorate([
|
|
40
|
+
(0, inversify_1.injectable)()
|
|
41
|
+
], TestClass2);
|
|
42
|
+
let TestClass3 = class TestClass3 extends TestClass {
|
|
43
|
+
};
|
|
44
|
+
TestClass3 = __decorate([
|
|
45
|
+
(0, inversify_1.injectable)()
|
|
46
|
+
], TestClass3);
|
|
47
|
+
describe('test implementations of MultiBinding', () => {
|
|
48
|
+
describe('test basic functionaly (ClassMultiBinding) ', () => {
|
|
49
|
+
const binding = new multi_binding_1.MultiBinding('TestClass');
|
|
50
|
+
it('add - new binding', () => {
|
|
51
|
+
binding.add(TestClass1);
|
|
52
|
+
(0, chai_1.expect)(binding.contains(TestClass1)).true;
|
|
53
|
+
const result = binding.getAll();
|
|
54
|
+
(0, chai_1.expect)(result.length).to.be.equal(1);
|
|
55
|
+
(0, chai_1.expect)(result[0]).to.be.equal(TestClass1);
|
|
56
|
+
});
|
|
57
|
+
it('add - existing binding', () => {
|
|
58
|
+
binding.add(TestClass1);
|
|
59
|
+
(0, chai_1.expect)(binding.getAll().length).to.be.equal(1);
|
|
60
|
+
(0, chai_1.expect)(binding.getAll()[0]).to.be.equal(TestClass1);
|
|
61
|
+
});
|
|
62
|
+
it('remove - existing binding', () => {
|
|
63
|
+
(0, chai_1.expect)(binding.contains(TestClass1)).true;
|
|
64
|
+
binding.remove(TestClass1);
|
|
65
|
+
(0, chai_1.expect)(binding.contains(TestClass1)).false;
|
|
66
|
+
(0, chai_1.expect)(binding.getAll()).to.have.length(0);
|
|
67
|
+
});
|
|
68
|
+
it('remove - non-existing binding', () => {
|
|
69
|
+
const previousSize = binding.getAll().length;
|
|
70
|
+
binding.remove(TestClass2);
|
|
71
|
+
(0, chai_1.expect)(binding.getAll()).to.have.length(previousSize);
|
|
72
|
+
});
|
|
73
|
+
it('addAll - TestClass1 & TestClass2', () => {
|
|
74
|
+
binding.addAll([TestClass1, TestClass2]);
|
|
75
|
+
const result = binding.getAll();
|
|
76
|
+
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
77
|
+
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
78
|
+
(0, chai_1.expect)(result.includes(TestClass2)).true;
|
|
79
|
+
});
|
|
80
|
+
it('rebind- TestClass2 to TestClass3', () => {
|
|
81
|
+
binding.rebind(TestClass2, TestClass3);
|
|
82
|
+
const result = binding.getAll();
|
|
83
|
+
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
84
|
+
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
85
|
+
(0, chai_1.expect)(result.includes(TestClass3)).true;
|
|
86
|
+
});
|
|
87
|
+
it('rebind- TestClass2 to TestClass3- should fail', () => {
|
|
88
|
+
binding.rebind(TestClass2, TestClass3);
|
|
89
|
+
const result = binding.getAll();
|
|
90
|
+
(0, chai_1.expect)(result.length).to.be.equal(2);
|
|
91
|
+
(0, chai_1.expect)(result.includes(TestClass1)).true;
|
|
92
|
+
(0, chai_1.expect)(result.includes(TestClass3)).true;
|
|
93
|
+
});
|
|
94
|
+
it('removeAll- TestClass1 & TestClass3', () => {
|
|
95
|
+
binding.removeAll([TestClass1, TestClass3]);
|
|
96
|
+
const result = binding.getAll();
|
|
97
|
+
(0, chai_1.expect)(result).to.have.length(0);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
describe('test applyBinding', () => {
|
|
101
|
+
it('apply binding of ClassMultiBinding', () => {
|
|
102
|
+
const testContainer = new inversify_1.Container();
|
|
103
|
+
const testModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
104
|
+
const context = { bind, unbind, isBound, rebind };
|
|
105
|
+
const binding = new multi_binding_1.MultiBinding('TestClass');
|
|
106
|
+
binding.addAll([TestClass1, TestClass2, TestClass3]);
|
|
107
|
+
binding.applyBindings(context);
|
|
108
|
+
});
|
|
109
|
+
testContainer.load(testModule);
|
|
110
|
+
const result = testContainer.getAll('TestClass');
|
|
111
|
+
(0, chai_1.expect)(result).to.have.length(3);
|
|
112
|
+
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass1)).to.not.be.undefined;
|
|
113
|
+
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass2)).to.not.be.undefined;
|
|
114
|
+
(0, chai_1.expect)(result.find(instance => instance instanceof TestClass3)).to.not.be.undefined;
|
|
115
|
+
});
|
|
116
|
+
it('apply binding of InstanceMultiBinding', () => {
|
|
117
|
+
const t1 = 't1';
|
|
118
|
+
const t2 = 't2';
|
|
119
|
+
const t3 = 't3';
|
|
120
|
+
const identifier = 'myStrings';
|
|
121
|
+
const testContainer = new inversify_1.Container();
|
|
122
|
+
const testModule = new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
123
|
+
const context = { bind, unbind, isBound, rebind };
|
|
124
|
+
const binding = new multi_binding_1.InstanceMultiBinding(identifier);
|
|
125
|
+
binding.addAll([t1, t2, t3]);
|
|
126
|
+
binding.applyBindings(context);
|
|
127
|
+
});
|
|
128
|
+
testContainer.load(testModule);
|
|
129
|
+
const result = testContainer.get(identifier);
|
|
130
|
+
(0, chai_1.expect)(result).to.have.length(3);
|
|
131
|
+
(0, chai_1.expect)(result.includes(t1)).true;
|
|
132
|
+
(0, chai_1.expect)(result.includes(t2)).true;
|
|
133
|
+
(0, chai_1.expect)(result.includes(t3)).true;
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
//# sourceMappingUR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IAAA,aAAM,EAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,IAAA,aAAM,EAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ContainerModule, interfaces } from 'inversify';
|
|
17
|
+
import { GlobalActionProvider } from '../actions/global-action-provider';
|
|
18
|
+
import { GLSPClientProxy, JsonRpcGLSPClientProxy } from '../protocol/glsp-client-proxy';
|
|
19
|
+
import { GLSPServer, JsonRpcGLSPServer } from '../protocol/glsp-server';
|
|
20
|
+
import { GLSPServerListener } from '../protocol/glsp-server-listener';
|
|
21
|
+
import { ClientSessionFactory } from '../session/client-session-factory';
|
|
22
|
+
import { ClientSessionManager } from '../session/client-session-manager';
|
|
23
|
+
import { BindingTarget } from './binding-target';
|
|
24
|
+
import { DiagramModule } from './diagram-module';
|
|
25
|
+
import { GLSPModule } from './glsp-module';
|
|
26
|
+
import { MultiBinding } from './multi-binding';
|
|
27
|
+
/**
|
|
28
|
+
* The server module is the central configuration artifact for configuring the server container (i.e. main container). For
|
|
29
|
+
* each application connecting to the server process a new server container is created. The server module provides the
|
|
30
|
+
* base bindings necessary for setting up the base {@link GLSPServer} infrastructure. In addition, it is used to
|
|
31
|
+
* configure the set of {@link DiagramModule}s. Diagram modules are used to create the diagram-session-specific child
|
|
32
|
+
* container when the
|
|
33
|
+
* {@link GLSPServer.initializeClientSession()}
|
|
34
|
+
* method is called.
|
|
35
|
+
*
|
|
36
|
+
* The following bindings are provided:
|
|
37
|
+
*
|
|
38
|
+
* * {@link Map<String, Module>} annotated with `@named("Diagram_Modules")`
|
|
39
|
+
* * {@link GLSPServer}
|
|
40
|
+
* * {@link ClientSessionFactory}
|
|
41
|
+
* * {@link ClientSessionManager}
|
|
42
|
+
* * {@link GlobalActionProvider}
|
|
43
|
+
* * {@link GLSPClientProxy}
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
export declare class ServerModule extends GLSPModule {
|
|
47
|
+
static DIAGRAM_MODULES: string;
|
|
48
|
+
protected readonly diagramModules: Map<string, ContainerModule[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Configure a new {@link DiagramModule} for this server. A diagram module represents the base configuration artifact
|
|
51
|
+
* for configuring a diagram-language-specific client session container. The diagram type provided
|
|
52
|
+
* {@link DiagramModule.diagramType} is used to retrieve the correct diagram module when the {@link GLSPServer}
|
|
53
|
+
* initializes a new client session.
|
|
54
|
+
*
|
|
55
|
+
* @param diagramModule The base diagram module
|
|
56
|
+
* @param additionalModules Additional modules
|
|
57
|
+
* @returns The server module itself. This enables a builder-pattern like chaining of multiple diagram configuration
|
|
58
|
+
* calls.
|
|
59
|
+
*/
|
|
60
|
+
configureDiagramModule(diagramModule: DiagramModule, ...additionalModules: ContainerModule[]): ServerModule;
|
|
61
|
+
configure(bind: interfaces.Bind, unbind: interfaces.Unbind, isBound: interfaces.IsBound, rebind: interfaces.Rebind): void;
|
|
62
|
+
protected bindDiagramModules(): BindingTarget<Map<string, ContainerModule[]>>;
|
|
63
|
+
protected bindGLSPServer(): BindingTarget<GLSPServer>;
|
|
64
|
+
protected bindJsonRpcGLSPServer(): BindingTarget<JsonRpcGLSPServer>;
|
|
65
|
+
protected bindClientSessionFactory(): BindingTarget<ClientSessionFactory>;
|
|
66
|
+
protected bindClientSessionManager(): BindingTarget<ClientSessionManager>;
|
|
67
|
+
protected bindGlobalActionProvider(): BindingTarget<GlobalActionProvider>;
|
|
68
|
+
protected bindInjectionContainer(): BindingTarget<interfaces.Container>;
|
|
69
|
+
protected bindGLSPClientProxy(): BindingTarget<GLSPClientProxy>;
|
|
70
|
+
protected bindJsonRpcGLSPClientProxy(): BindingTarget<JsonRpcGLSPClientProxy>;
|
|
71
|
+
protected configureGLSPServerListeners(binding: MultiBinding<GLSPServerListener>): void;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=server-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-module.d.ts","sourceRoot":"","sources":["../../../src/common/di/server-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAA+B,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACtG,OAAO,EAA0B,eAAe,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAChH,OAAO,EAAqB,UAAU,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAA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IAAI,aAAa,CAAC,eAAe,CAAC;IAI/D,SAAS,CAAC,0BAA0B,IAAI,aAAa,CAAC,sBAAsB,CAAC;IAI7E,SAAS,CAAC,4BAA4B,CAAC,OAAO,EAAE,YAAY,CAAC,kBAAkB,CAAC,GAAG,IAAI;CAG1F"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerModule = void 0;
|
|
4
|
+
const global_action_provider_1 = require("../actions/global-action-provider");
|
|
5
|
+
const glsp_client_proxy_1 = require("../protocol/glsp-client-proxy");
|
|
6
|
+
const glsp_server_1 = require("../protocol/glsp-server");
|
|
7
|
+
const glsp_server_listener_1 = require("../protocol/glsp-server-listener");
|
|
8
|
+
const client_session_factory_1 = require("../session/client-session-factory");
|
|
9
|
+
const client_session_manager_1 = require("../session/client-session-manager");
|
|
10
|
+
const binding_target_1 = require("./binding-target");
|
|
11
|
+
const glsp_module_1 = require("./glsp-module");
|
|
12
|
+
const multi_binding_1 = require("./multi-binding");
|
|
13
|
+
const service_identifiers_1 = require("./service-identifiers");
|
|
14
|
+
/**
|
|
15
|
+
* The server module is the central configuration artifact for configuring the server container (i.e. main container). For
|
|
16
|
+
* each application connecting to the server process a new server container is created. The server module provides the
|
|
17
|
+
* base bindings necessary for setting up the base {@link GLSPServer} infrastructure. In addition, it is used to
|
|
18
|
+
* configure the set of {@link DiagramModule}s. Diagram modules are used to create the diagram-session-specific child
|
|
19
|
+
* container when the
|
|
20
|
+
* {@link GLSPServer.initializeClientSession()}
|
|
21
|
+
* method is called.
|
|
22
|
+
*
|
|
23
|
+
* The following bindings are provided:
|
|
24
|
+
*
|
|
25
|
+
* * {@link Map<String, Module>} annotated with `@named("Diagram_Modules")`
|
|
26
|
+
* * {@link GLSPServer}
|
|
27
|
+
* * {@link ClientSessionFactory}
|
|
28
|
+
* * {@link ClientSessionManager}
|
|
29
|
+
* * {@link GlobalActionProvider}
|
|
30
|
+
* * {@link GLSPClientProxy}
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
class ServerModule extends glsp_module_1.GLSPModule {
|
|
34
|
+
constructor() {
|
|
35
|
+
super(...arguments);
|
|
36
|
+
this.diagramModules = new Map();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Configure a new {@link DiagramModule} for this server. A diagram module represents the base configuration artifact
|
|
40
|
+
* for configuring a diagram-language-specific client session container. The diagram type provided
|
|
41
|
+
* {@link DiagramModule.diagramType} is used to retrieve the correct diagram module when the {@link GLSPServer}
|
|
42
|
+
* initializes a new client session.
|
|
43
|
+
*
|
|
44
|
+
* @param diagramModule The base diagram module
|
|
45
|
+
* @param additionalModules Additional modules
|
|
46
|
+
* @returns The server module itself. This enables a builder-pattern like chaining of multiple diagram configuration
|
|
47
|
+
* calls.
|
|
48
|
+
*/
|
|
49
|
+
configureDiagramModule(diagramModule, ...additionalModules) {
|
|
50
|
+
const diagramType = diagramModule.diagramType;
|
|
51
|
+
if (this.diagramModules.has(diagramType)) {
|
|
52
|
+
throw new Error(`A module configuration is already present for diagram type: '${diagramType}'`);
|
|
53
|
+
}
|
|
54
|
+
this.diagramModules.set(diagramType, [diagramModule, ...additionalModules]);
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
57
|
+
configure(bind, unbind, isBound, rebind) {
|
|
58
|
+
const context = this.context;
|
|
59
|
+
(0, binding_target_1.applyBindingTarget)(context, service_identifiers_1.DiagramModules, this.bindDiagramModules());
|
|
60
|
+
(0, binding_target_1.applyBindingTarget)(context, glsp_server_1.GLSPServer, this.bindGLSPServer()).inSingletonScope();
|
|
61
|
+
(0, binding_target_1.applyBindingTarget)(context, glsp_server_1.JsonRpcGLSPServer, this.bindJsonRpcGLSPServer());
|
|
62
|
+
(0, binding_target_1.applyBindingTarget)(context, client_session_factory_1.ClientSessionFactory, this.bindClientSessionFactory()).inSingletonScope();
|
|
63
|
+
(0, binding_target_1.applyBindingTarget)(context, client_session_manager_1.ClientSessionManager, this.bindClientSessionManager()).inSingletonScope();
|
|
64
|
+
this.configureMultiBinding(new multi_binding_1.MultiBinding(glsp_server_listener_1.GLSPServerListener), binding => this.configureGLSPServerListeners(binding));
|
|
65
|
+
(0, binding_target_1.applyBindingTarget)(context, global_action_provider_1.GlobalActionProvider, this.bindGlobalActionProvider()).inSingletonScope();
|
|
66
|
+
(0, binding_target_1.applyBindingTarget)(context, service_identifiers_1.InjectionContainer, this.bindInjectionContainer());
|
|
67
|
+
(0, binding_target_1.applyBindingTarget)(context, glsp_client_proxy_1.GLSPClientProxy, this.bindGLSPClientProxy()).inSingletonScope();
|
|
68
|
+
(0, binding_target_1.applyBindingTarget)(context, glsp_client_proxy_1.JsonRpcGLSPClientProxy, this.bindJsonRpcGLSPClientProxy());
|
|
69
|
+
}
|
|
70
|
+
bindDiagramModules() {
|
|
71
|
+
return { constantValue: this.diagramModules };
|
|
72
|
+
}
|
|
73
|
+
bindGLSPServer() {
|
|
74
|
+
return glsp_server_1.DefaultGLSPServer;
|
|
75
|
+
}
|
|
76
|
+
bindJsonRpcGLSPServer() {
|
|
77
|
+
return { service: glsp_server_1.GLSPServer };
|
|
78
|
+
}
|
|
79
|
+
bindClientSessionFactory() {
|
|
80
|
+
return client_session_factory_1.DefaultClientSessionFactory;
|
|
81
|
+
}
|
|
82
|
+
bindClientSessionManager() {
|
|
83
|
+
return client_session_manager_1.DefaultClientSessionManager;
|
|
84
|
+
}
|
|
85
|
+
bindGlobalActionProvider() {
|
|
86
|
+
return global_action_provider_1.DefaultGlobalActionProvider;
|
|
87
|
+
}
|
|
88
|
+
bindInjectionContainer() {
|
|
89
|
+
return { dynamicValue: context => context.container };
|
|
90
|
+
}
|
|
91
|
+
bindGLSPClientProxy() {
|
|
92
|
+
return glsp_client_proxy_1.DefaultGLSPClientProxy;
|
|
93
|
+
}
|
|
94
|
+
bindJsonRpcGLSPClientProxy() {
|
|
95
|
+
return { service: glsp_client_proxy_1.GLSPClientProxy };
|
|
96
|
+
}
|
|
97
|
+
configureGLSPServerListeners(binding) {
|
|
98
|
+
binding.add({ service: client_session_manager_1.ClientSessionManager });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.ServerModule = ServerModule;
|
|
102
|
+
ServerModule.DIAGRAM_MODULES = 'Diagram_Modules';
|
|
103
|
+
//# sourceMappingURL=server-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-module.js","sourceRoot":"","sources":["../../../src/common/di/server-module.ts"],"names":[],"mappings":";;;AAgBA,8EAAsG;AACtG,qEAAgH;AAChH,yDAA2F;AAC3F,2EAAsE;AACtE,8EAAsG;AACtG,8EAAsG;AACtG,qDAAqE;AAErE,+CAA2C;AAC3C,mDAA+C;AAC/C,+DAA2E;AAE3E;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,YAAa,SAAQ,wBAAU;IAA5C;;QAEuB,mBAAc,GAAmC,IAAI,GAAG,EAAE,CAAC;IAiFlF,CAAC;IA/EG;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,aAA4B,EAAE,GAAG,iBAAoC;QACxF,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;QAC9C,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,gEAAgE,WAAW,GAAG,CAAC,CAAC;SACnG;QACD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,SAAS,CAAC,IAAqB,EAAE,MAAyB,EAAE,OAA2B,EAAE,MAAyB;QAC9G,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAA,mCAAkB,EAAC,OAAO,EAAE,oCAAc,EAAE,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC;QAE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,oDAA2B,CAAC;IACvC,CAAC;IAES,wBAAwB;QAC9B,OAAO,oDAA2B,CAAC;IACvC,CAAC;IAES,wBAAwB;QAC9B,OAAO,oDAA2B,CAAC;IACvC,CAAC;IAES,sBAAsB;QAC5B,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;IAC1D,CAAC;IAES,mBAAmB;QACzB,OAAO,0CAAsB,CAAC;IAClC,CAAC;IAES,0BAA0B;QAChC,OAAO,EAAE,OAAO,EAAE,mCAAe,EAAE,CAAC;IACxC,CAAC;IAES,4BAA4B,CAAC,OAAyC;QAC5E,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,6CAAoB,EAAE,CAAC,CAAC;IACnD,CAAC;;AAlFL,oCAmFC;AAlFiB,4BAAe,GAAG,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* This Source Code may also be made available under the following Secondary
|
|
9
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
* with the GNU Classpath Exception which is available at
|
|
12
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
*
|
|
14
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
|
+
********************************************************************************/
|
|
16
|
+
import { ValidateLabelEditAdapter } from '../features/directediting/context-edit-validator';
|
|
17
|
+
import { LabelEditValidator } from '../features/directediting/label-edit-validator';
|
|
18
|
+
export declare const DiagramType: unique symbol;
|
|
19
|
+
export declare const ClientId: unique symbol;
|
|
20
|
+
export declare const DiagramModules: unique symbol;
|
|
21
|
+
export declare const InjectionContainer: unique symbol;
|
|
22
|
+
export declare const ClientActionKinds: unique symbol;
|
|
23
|
+
export declare const ContextActionsProviders: unique symbol;
|
|
24
|
+
export declare const ContextEditValidators: unique symbol;
|
|
25
|
+
export declare const ValidateLabelEditAdapterFactory: unique symbol;
|
|
26
|
+
export declare const NavigationTargetProviders: unique symbol;
|
|
27
|
+
export type ValidateLabelEditAdapterFactory = (validator: LabelEditValidator) => ValidateLabelEditAdapter;
|
|
28
|
+
export declare const Operations: unique symbol;
|
|
29
|
+
//# sourceMappingURL=service-identifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-identifiers.d.ts","sourceRoot":"","sources":["../../../src/common/di/service-identifiers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAEpF,eAAO,MAAM,WAAW,eAAwB,CAAC;AAEjD,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAE3C,eAAO,MAAM,cAAc,eAA2B,CAAC;AAEvD,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAE7D,eAAO,MAAM,uBAAuB,eAAoC,CAAC;AAEzE,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,eAAO,MAAM,+BAA+B,eAA4C,CAAC;AAEzF,eAAO,MAAM,yBAAyB,eAAsC,CAAC;AAE7E,MAAM,MAAM,+BAA+B,GAAG,CAAC,SAAS,EAAE,kBAAkB,KAAK,wBAAwB,CAAC;AAE1G,eAAO,MAAM,UAAU,eAAuB,CAAC"}
|