@eclipse-glsp/server 1.1.0-next.dc6b980.47 → 1.1.0-next.de91dcd.60
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/lib/browser/di/app-module.d.ts +2 -7
- package/lib/browser/di/app-module.d.ts.map +1 -1
- package/lib/browser/di/app-module.js +5 -30
- package/lib/browser/di/app-module.js.map +1 -1
- package/lib/browser/index.d.ts +0 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +0 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/launch/worker-server-launcher.d.ts +4 -4
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
- package/lib/browser/launch/worker-server-launcher.js +6 -13
- package/lib/browser/launch/worker-server-launcher.js.map +1 -1
- package/lib/common/actions/action-dispatcher.js +2 -3
- package/lib/common/actions/action-dispatcher.js.map +1 -1
- package/lib/common/actions/action-handler-registry.js +4 -6
- package/lib/common/actions/action-handler-registry.js.map +1 -1
- package/lib/common/actions/client-action-handler.d.ts +1 -2
- package/lib/common/actions/client-action-handler.d.ts.map +1 -1
- package/lib/common/actions/client-action-handler.js +19 -5
- package/lib/common/actions/client-action-handler.js.map +1 -1
- package/lib/common/actions/global-action-provider.js +2 -3
- package/lib/common/actions/global-action-provider.js.map +1 -1
- package/lib/common/command/command-stack.d.ts +16 -1
- package/lib/common/command/command-stack.d.ts.map +1 -1
- package/lib/common/command/command-stack.js +2 -18
- package/lib/common/command/command-stack.js.map +1 -1
- package/lib/common/command/command.js +1 -1
- package/lib/common/command/command.js.map +1 -1
- package/lib/common/command/undo-redo-action-handler.js +2 -3
- package/lib/common/command/undo-redo-action-handler.js.map +1 -1
- package/lib/common/di/binding-target.d.ts.map +1 -1
- package/lib/common/di/binding-target.js +3 -2
- package/lib/common/di/binding-target.js.map +1 -1
- package/lib/common/di/client-session-module.d.ts +1 -1
- package/lib/common/di/client-session-module.d.ts.map +1 -1
- package/lib/common/di/client-session-module.js +2 -2
- package/lib/common/di/client-session-module.js.map +1 -1
- package/lib/common/di/diagram-module.d.ts +3 -0
- package/lib/common/di/diagram-module.d.ts.map +1 -1
- package/lib/common/di/diagram-module.js +14 -5
- package/lib/common/di/diagram-module.js.map +1 -1
- package/lib/common/di/glsp-module.d.ts +3 -1
- package/lib/common/di/glsp-module.d.ts.map +1 -1
- package/lib/common/di/glsp-module.js +2 -18
- package/lib/common/di/glsp-module.js.map +1 -1
- package/lib/common/di/multi-binding.d.ts +19 -4
- package/lib/common/di/multi-binding.d.ts.map +1 -1
- package/lib/common/di/multi-binding.js.map +1 -1
- package/lib/common/di/server-module.d.ts +1 -6
- package/lib/common/di/server-module.d.ts.map +1 -1
- package/lib/common/di/server-module.js +21 -17
- package/lib/common/di/server-module.js.map +1 -1
- package/lib/common/diagram/diagram-configuration.js +1 -1
- package/lib/common/diagram/diagram-configuration.js.map +1 -1
- package/lib/common/diagram/request-type-hints-action-handler.js +2 -3
- package/lib/common/diagram/request-type-hints-action-handler.js.map +1 -1
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js +2 -3
- package/lib/common/features/clipboard/request-clipboard-data-action-handler.js.map +1 -1
- package/lib/common/features/contextactions/command-palette-action-provider.js +2 -3
- package/lib/common/features/contextactions/command-palette-action-provider.js.map +1 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.js +2 -3
- package/lib/common/features/contextactions/context-actions-provider-registry.js.map +1 -1
- package/lib/common/features/contextactions/context-menu-item-provider.js +2 -3
- package/lib/common/features/contextactions/context-menu-item-provider.js.map +1 -1
- package/lib/common/features/contextactions/request-context-actions-handler.js +2 -3
- package/lib/common/features/contextactions/request-context-actions-handler.js.map +1 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.js +4 -6
- package/lib/common/features/contextactions/tool-palette-item-provider.js.map +1 -1
- package/lib/common/features/directediting/context-edit-validator-registry.js +2 -3
- package/lib/common/features/directediting/context-edit-validator-registry.js.map +1 -1
- package/lib/common/features/directediting/label-edit-validator.js +2 -3
- package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
- package/lib/common/features/directediting/request-edit-validation-handler.js +2 -3
- package/lib/common/features/directediting/request-edit-validation-handler.js.map +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js +2 -3
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/features/layout/layout-operation-handler.js +2 -3
- package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
- package/lib/common/features/model/gmodel-factory.js +2 -3
- package/lib/common/features/model/gmodel-factory.js.map +1 -1
- package/lib/common/features/model/gmodel-index.js +2 -3
- package/lib/common/features/model/gmodel-index.js.map +1 -1
- package/lib/common/features/model/gmodel-serializer.js +2 -3
- package/lib/common/features/model/gmodel-serializer.js.map +1 -1
- package/lib/common/features/model/model-state.js +2 -3
- package/lib/common/features/model/model-state.js.map +1 -1
- package/lib/common/features/model/model-submission-handler.d.ts +2 -0
- package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
- package/lib/common/features/model/model-submission-handler.js +12 -3
- package/lib/common/features/model/model-submission-handler.js.map +1 -1
- package/lib/common/features/model/request-model-action-handler.d.ts +4 -6
- package/lib/common/features/model/request-model-action-handler.d.ts.map +1 -1
- package/lib/common/features/model/request-model-action-handler.js +16 -14
- package/lib/common/features/model/request-model-action-handler.js.map +1 -1
- package/lib/common/features/model/save-model-action-handler.js +2 -3
- package/lib/common/features/model/save-model-action-handler.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-provider-registry.js +2 -3
- package/lib/common/features/navigation/navigation-target-provider-registry.js.map +1 -1
- package/lib/common/features/navigation/navigation-target-resolver.js +2 -3
- package/lib/common/features/navigation/navigation-target-resolver.js.map +1 -1
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js +2 -3
- package/lib/common/features/navigation/request-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js +2 -3
- package/lib/common/features/navigation/resolve-navigation-targets-action-handler.js.map +1 -1
- package/lib/common/features/popup/request-popup-model-action-handler.js +2 -3
- package/lib/common/features/popup/request-popup-model-action-handler.js.map +1 -1
- package/lib/common/features/progress/progress-service.d.ts +44 -0
- package/lib/common/features/progress/progress-service.d.ts.map +1 -0
- package/lib/common/{protocol/glsp-client-proxy.js → features/progress/progress-service.js} +19 -22
- package/lib/common/features/progress/progress-service.js.map +1 -0
- package/lib/common/features/validation/model-validator.d.ts +47 -2
- package/lib/common/features/validation/model-validator.d.ts.map +1 -1
- package/lib/common/features/validation/model-validator.js +79 -1
- package/lib/common/features/validation/model-validator.js.map +1 -1
- package/lib/common/features/validation/request-markers-handler.d.ts +15 -0
- package/lib/common/features/validation/request-markers-handler.d.ts.map +1 -1
- package/lib/common/features/validation/request-markers-handler.js +5 -12
- package/lib/common/features/validation/request-markers-handler.js.map +1 -1
- package/lib/common/gmodel/apply-label-edit-operation-handler.js +2 -3
- package/lib/common/gmodel/apply-label-edit-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-bounds-operation-handler.js +2 -3
- package/lib/common/gmodel/change-bounds-operation-handler.js.map +1 -1
- package/lib/common/gmodel/change-routing-points-operation-handler.js +2 -3
- package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
- package/lib/common/gmodel/cut-operation-handler.js +2 -3
- package/lib/common/gmodel/cut-operation-handler.js.map +1 -1
- package/lib/common/gmodel/delete-operation-handler.js +2 -3
- package/lib/common/gmodel/delete-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js +2 -3
- package/lib/common/gmodel/gmodel-create-edge-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js +2 -3
- package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
- package/lib/common/gmodel/gmodel-diagram-module.js +2 -3
- package/lib/common/gmodel/gmodel-diagram-module.js.map +1 -1
- package/lib/common/gmodel/gmodel-operation-handler.js +1 -1
- package/lib/common/gmodel/gmodel-operation-handler.js.map +1 -1
- package/lib/common/gmodel/paste-operation-handler.js +2 -3
- package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
- package/lib/common/gmodel/reconnect-edge-operation-handler.js +2 -3
- package/lib/common/gmodel/reconnect-edge-operation-handler.js.map +1 -1
- package/lib/common/index.d.ts +1 -2
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -2
- package/lib/common/index.js.map +1 -1
- package/lib/common/launch/glsp-server-launcher.d.ts +1 -1
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
- package/lib/common/launch/glsp-server-launcher.js +4 -5
- package/lib/common/launch/glsp-server-launcher.js.map +1 -1
- package/lib/common/launch/jsonrpc-server-launcher.d.ts +38 -0
- package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -0
- package/lib/common/launch/jsonrpc-server-launcher.js +83 -0
- package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
- package/lib/common/operations/compound-operation-handler.js +6 -12
- package/lib/common/operations/compound-operation-handler.js.map +1 -1
- package/lib/common/operations/create-operation-handler.js +1 -1
- package/lib/common/operations/create-operation-handler.js.map +1 -1
- package/lib/common/operations/operation-action-handler.js +2 -3
- package/lib/common/operations/operation-action-handler.js.map +1 -1
- package/lib/common/operations/operation-handler-registry.js +4 -6
- package/lib/common/operations/operation-handler-registry.js.map +1 -1
- package/lib/common/operations/operation-handler.js +2 -3
- package/lib/common/operations/operation-handler.js.map +1 -1
- package/lib/common/protocol/glsp-server.d.ts +4 -104
- package/lib/common/protocol/glsp-server.d.ts.map +1 -1
- package/lib/common/protocol/glsp-server.js +15 -23
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/session/client-session-factory.d.ts +1 -2
- package/lib/common/session/client-session-factory.d.ts.map +1 -1
- package/lib/common/session/client-session-factory.js +19 -5
- package/lib/common/session/client-session-factory.js.map +1 -1
- package/lib/common/session/client-session-manager.d.ts +1 -3
- package/lib/common/session/client-session-manager.d.ts.map +1 -1
- package/lib/common/session/client-session-manager.js +2 -3
- package/lib/common/session/client-session-manager.js.map +1 -1
- package/lib/common/utils/args-util.js +2 -2
- package/lib/common/utils/args-util.js.map +1 -1
- package/lib/{browser/di → common/utils}/console-logger.d.ts +7 -1
- package/lib/common/utils/console-logger.d.ts.map +1 -0
- package/lib/{browser/di → common/utils}/console-logger.js +27 -10
- package/lib/common/utils/console-logger.js.map +1 -0
- package/lib/common/utils/logger.d.ts +21 -0
- package/lib/common/utils/logger.d.ts.map +1 -1
- package/lib/common/utils/logger.js +16 -5
- package/lib/common/utils/logger.js.map +1 -1
- package/lib/common/utils/registry.js +4 -6
- package/lib/common/utils/registry.js.map +1 -1
- package/lib/node/abstract-json-model-storage.js +2 -3
- package/lib/node/abstract-json-model-storage.js.map +1 -1
- package/lib/node/di/app-module.d.ts +2 -2
- package/lib/node/di/app-module.d.ts.map +1 -1
- package/lib/node/di/app-module.js +10 -35
- package/lib/node/di/app-module.js.map +1 -1
- package/lib/node/gmodel/gmodel-storage.js +2 -3
- package/lib/node/gmodel/gmodel-storage.js.map +1 -1
- package/lib/node/launch/cli-parser.d.ts +2 -3
- package/lib/node/launch/cli-parser.d.ts.map +1 -1
- package/lib/node/launch/cli-parser.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.d.ts +2 -23
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
- package/lib/node/launch/socket-server-launcher.js +9 -30
- package/lib/node/launch/socket-server-launcher.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.d.ts +2 -8
- package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
- package/lib/node/launch/websocket-server-launcher.js +5 -30
- package/lib/node/launch/websocket-server-launcher.js.map +1 -1
- package/package.json +6 -4
- package/src/browser/di/app-module.ts +4 -32
- package/src/browser/index.ts +0 -1
- package/src/browser/launch/worker-server-launcher.ts +7 -13
- package/src/common/actions/client-action-handler.ts +1 -2
- package/src/common/command/command-stack.ts +1 -1
- package/src/common/di/binding-target.ts +1 -0
- package/src/common/di/client-session-module.ts +1 -1
- package/src/common/di/diagram-module.ts +20 -7
- package/src/common/di/glsp-module.ts +3 -1
- package/src/common/di/multi-binding.ts +4 -5
- package/src/common/di/server-module.ts +6 -21
- package/src/common/features/model/model-submission-handler.ts +12 -0
- package/src/common/features/model/request-model-action-handler.ts +16 -15
- package/src/common/features/progress/progress-service.ts +74 -0
- package/src/common/features/validation/model-validator.ts +75 -3
- package/src/common/features/validation/request-markers-handler.ts +4 -10
- package/src/common/index.ts +1 -2
- package/src/common/launch/glsp-server-launcher.ts +2 -2
- package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
- package/src/common/protocol/glsp-server.spec.ts +7 -4
- package/src/common/protocol/glsp-server.ts +17 -132
- package/src/common/session/client-session-factory.spec.ts +1 -1
- package/src/common/session/client-session-factory.ts +1 -2
- package/src/common/session/client-session-manager.ts +1 -3
- package/src/common/test/mock-util.ts +5 -5
- package/src/common/utils/args-util.ts +1 -1
- package/src/{browser/di → common/utils}/console-logger.ts +19 -1
- package/src/common/utils/logger.ts +17 -1
- package/src/node/di/app-module.ts +4 -13
- package/src/node/launch/cli-parser.ts +2 -3
- package/src/node/launch/socket-server-launcher.spec.ts +6 -0
- package/src/node/launch/socket-server-launcher.ts +8 -30
- package/src/node/launch/websocket-server-launcher.ts +5 -31
- package/lib/browser/di/console-logger.d.ts.map +0 -1
- package/lib/browser/di/console-logger.js.map +0 -1
- package/lib/common/actions/action-dispatcher.spec.d.ts +0 -2
- package/lib/common/actions/action-dispatcher.spec.d.ts.map +0 -1
- package/lib/common/actions/action-dispatcher.spec.js +0 -264
- package/lib/common/actions/action-dispatcher.spec.js.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.d.ts +0 -2
- package/lib/common/actions/action-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/actions/action-handler-registry.spec.js +0 -50
- package/lib/common/actions/action-handler-registry.spec.js.map +0 -1
- package/lib/common/actions/global-action-provider.spec.d.ts +0 -2
- package/lib/common/actions/global-action-provider.spec.d.ts.map +0 -1
- package/lib/common/actions/global-action-provider.spec.js +0 -70
- package/lib/common/actions/global-action-provider.spec.js.map +0 -1
- package/lib/common/command/command-stack.spec.d.ts +0 -2
- package/lib/common/command/command-stack.spec.d.ts.map +0 -1
- package/lib/common/command/command-stack.spec.js +0 -207
- package/lib/common/command/command-stack.spec.js.map +0 -1
- package/lib/common/command/command.spec.d.ts +0 -2
- package/lib/common/command/command.spec.d.ts.map +0 -1
- package/lib/common/command/command.spec.js +0 -86
- package/lib/common/command/command.spec.js.map +0 -1
- package/lib/common/command/recording-command.spec.d.ts +0 -17
- package/lib/common/command/recording-command.spec.d.ts.map +0 -1
- package/lib/common/command/recording-command.spec.js +0 -62
- package/lib/common/command/recording-command.spec.js.map +0 -1
- package/lib/common/di/binding-target.spec.d.ts +0 -2
- package/lib/common/di/binding-target.spec.d.ts.map +0 -1
- package/lib/common/di/binding-target.spec.js +0 -121
- package/lib/common/di/binding-target.spec.js.map +0 -1
- package/lib/common/di/multi-bindings.spec.d.ts +0 -2
- package/lib/common/di/multi-bindings.spec.d.ts.map +0 -1
- package/lib/common/di/multi-bindings.spec.js +0 -137
- package/lib/common/di/multi-bindings.spec.js.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts +0 -2
- package/lib/common/diagram/request-type-hints-action-handler.spec.d.ts.map +0 -1
- package/lib/common/diagram/request-type-hints-action-handler.spec.js +0 -57
- package/lib/common/diagram/request-type-hints-action-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts +0 -2
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js +0 -34
- package/lib/common/features/contextactions/context-actions-provider-registry.spec.js.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts +0 -2
- package/lib/common/features/contextactions/request-context-actions-handler.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js +0 -63
- package/lib/common/features/contextactions/request-context-actions-handler.spec.js.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts +0 -2
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.d.ts.map +0 -1
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js +0 -48
- package/lib/common/features/contextactions/tool-palette-item-provider.spec.js.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts +0 -2
- package/lib/common/features/directediting/context-edit-validator-registry.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js +0 -44
- package/lib/common/features/directediting/context-edit-validator-registry.spec.js.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts +0 -2
- package/lib/common/features/directediting/request-edit-validation-handler.spec.d.ts.map +0 -1
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js +0 -97
- package/lib/common/features/directediting/request-edit-validation-handler.spec.js.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.d.ts +0 -2
- package/lib/common/features/model/gmodel-serializer.spec.d.ts.map +0 -1
- package/lib/common/features/model/gmodel-serializer.spec.js +0 -124
- package/lib/common/features/model/gmodel-serializer.spec.js.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.d.ts +0 -2
- package/lib/common/operations/operation-handler-registry.spec.d.ts.map +0 -1
- package/lib/common/operations/operation-handler-registry.spec.js +0 -50
- package/lib/common/operations/operation-handler-registry.spec.js.map +0 -1
- package/lib/common/protocol/glsp-client-proxy.d.ts +0 -45
- package/lib/common/protocol/glsp-client-proxy.d.ts.map +0 -1
- package/lib/common/protocol/glsp-client-proxy.js.map +0 -1
- package/lib/common/protocol/glsp-server-listener.d.ts +0 -37
- package/lib/common/protocol/glsp-server-listener.d.ts.map +0 -1
- package/lib/common/protocol/glsp-server-listener.js +0 -5
- package/lib/common/protocol/glsp-server-listener.js.map +0 -1
- package/lib/common/protocol/glsp-server.spec.d.ts +0 -2
- package/lib/common/protocol/glsp-server.spec.d.ts.map +0 -1
- package/lib/common/protocol/glsp-server.spec.js +0 -119
- package/lib/common/protocol/glsp-server.spec.js.map +0 -1
- package/lib/common/session/client-session-factory.spec.d.ts +0 -2
- package/lib/common/session/client-session-factory.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-factory.spec.js +0 -56
- package/lib/common/session/client-session-factory.spec.js.map +0 -1
- package/lib/common/session/client-session-manager.spec.d.ts +0 -2
- package/lib/common/session/client-session-manager.spec.d.ts.map +0 -1
- package/lib/common/session/client-session-manager.spec.js +0 -74
- package/lib/common/session/client-session-manager.spec.js.map +0 -1
- package/lib/common/test/mock-util.d.ts +0 -123
- package/lib/common/test/mock-util.d.ts.map +0 -1
- package/lib/common/test/mock-util.js +0 -216
- package/lib/common/test/mock-util.js.map +0 -1
- package/lib/common/utils/promise-queue.spec.d.ts +0 -2
- package/lib/common/utils/promise-queue.spec.d.ts.map +0 -1
- package/lib/common/utils/promise-queue.spec.js +0 -117
- package/lib/common/utils/promise-queue.spec.js.map +0 -1
- package/lib/common/utils/registry.spec.d.ts +0 -2
- package/lib/common/utils/registry.spec.d.ts.map +0 -1
- package/lib/common/utils/registry.spec.js +0 -199
- package/lib/common/utils/registry.spec.js.map +0 -1
- package/lib/node/launch/cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/cli-parser.spec.js +0 -56
- package/lib/node/launch/cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.d.ts +0 -2
- package/lib/node/launch/socket-cli-parser.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-cli-parser.spec.js +0 -66
- package/lib/node/launch/socket-cli-parser.spec.js.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.d.ts +0 -17
- package/lib/node/launch/socket-server-launcher.spec.d.ts.map +0 -1
- package/lib/node/launch/socket-server-launcher.spec.js +0 -70
- package/lib/node/launch/socket-server-launcher.spec.js.map +0 -1
- package/src/common/protocol/glsp-client-proxy.ts +0 -65
- package/src/common/protocol/glsp-server-listener.ts +0 -39
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-glsp/server",
|
|
3
|
-
"version": "1.1.0-next.
|
|
3
|
+
"version": "1.1.0-next.de91dcd.60+de91dcd",
|
|
4
4
|
"description": "A js server framework for Eclipse GLSP",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eclipse",
|
|
@@ -59,12 +59,11 @@
|
|
|
59
59
|
"watch": "tsc -w"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@eclipse-glsp/graph": "1.1.0-next.
|
|
62
|
+
"@eclipse-glsp/graph": "1.1.0-next.de91dcd.60+de91dcd",
|
|
63
63
|
"@eclipse-glsp/protocol": "next",
|
|
64
64
|
"@types/uuid": "8.3.1",
|
|
65
65
|
"commander": "^8.3.0",
|
|
66
66
|
"fast-json-patch": "^3.1.0",
|
|
67
|
-
"inversify": "^5.1.1",
|
|
68
67
|
"winston": "^3.3.3",
|
|
69
68
|
"ws": "^8.12.1"
|
|
70
69
|
},
|
|
@@ -72,8 +71,11 @@
|
|
|
72
71
|
"@types/fs-extra": "^9.0.13",
|
|
73
72
|
"@types/ws": "^8.5.4"
|
|
74
73
|
},
|
|
74
|
+
"peerDependencies": {
|
|
75
|
+
"inversify": "^6.0.0"
|
|
76
|
+
},
|
|
75
77
|
"publishConfig": {
|
|
76
78
|
"access": "public"
|
|
77
79
|
},
|
|
78
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "de91dcd22122b3f46536a9581dd9ed498b311659"
|
|
79
81
|
}
|
|
@@ -14,42 +14,14 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import { ContainerModule
|
|
18
|
-
import { InjectionContainer,
|
|
19
|
-
import { ConsoleLogger } from './console-logger';
|
|
17
|
+
import { ContainerModule } from 'inversify';
|
|
18
|
+
import { InjectionContainer, LogLevel, LoggerConfigOptions, configureConsoleLogger } from '../../common/';
|
|
20
19
|
|
|
21
|
-
export
|
|
22
|
-
consoleLog
|
|
23
|
-
logLevel?: LogLevel;
|
|
24
|
-
}
|
|
25
|
-
export function createAppModule(options: LaunchOptions = {}): ContainerModule {
|
|
26
|
-
const resolvedOptions: LaunchOptions = { consoleLog: true, logLevel: LogLevel.info, ...options };
|
|
20
|
+
export function createAppModule(options: LoggerConfigOptions = {}): ContainerModule {
|
|
21
|
+
const resolvedOptions: LoggerConfigOptions = { consoleLog: true, logLevel: LogLevel.info, ...options };
|
|
27
22
|
return new ContainerModule((bind, unbind, isBound, rebind) => {
|
|
28
23
|
bind(InjectionContainer).toDynamicValue(dynamicContext => dynamicContext.container);
|
|
29
24
|
const context = { bind, unbind, isBound, rebind };
|
|
30
25
|
configureConsoleLogger(context, resolvedOptions);
|
|
31
26
|
});
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
export function configureConsoleLogger<T extends LaunchOptions>(context: ModuleContext, options: T): void {
|
|
35
|
-
if (!options.consoleLog) {
|
|
36
|
-
context.bind(Logger).to(NullLogger).inSingletonScope();
|
|
37
|
-
} else {
|
|
38
|
-
context.bind(Logger).toDynamicValue(ctx => new ConsoleLogger(options.logLevel, getRequestParentName(ctx)));
|
|
39
|
-
}
|
|
40
|
-
context.bind(LoggerFactory).toFactory(dynamicContext => (caller: string) => {
|
|
41
|
-
const logger = dynamicContext.container.get(Logger);
|
|
42
|
-
logger.caller = caller;
|
|
43
|
-
return logger;
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getRequestParentName(context: interfaces.Context): string | undefined {
|
|
48
|
-
if (context.currentRequest.parentRequest) {
|
|
49
|
-
const bindings = context.currentRequest.parentRequest.bindings;
|
|
50
|
-
if (bindings.length > 0) {
|
|
51
|
-
return bindings[0].implementationType?.name;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
package/src/browser/index.ts
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
-
import {
|
|
17
|
+
import { injectable } from 'inversify';
|
|
18
18
|
import * as jsonrpc from 'vscode-jsonrpc/browser';
|
|
19
|
-
import {
|
|
19
|
+
import { MaybePromise } from '../../common/index';
|
|
20
|
+
import { JsonRpcGLSPServerLauncher, JsonRpcServerInstance } from '../../common/launch/jsonrpc-server-launcher';
|
|
20
21
|
export interface WorkerLaunchOptions {
|
|
21
22
|
context?: Worker;
|
|
22
23
|
}
|
|
@@ -24,22 +25,16 @@ export interface WorkerLaunchOptions {
|
|
|
24
25
|
export const START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed.';
|
|
25
26
|
|
|
26
27
|
@injectable()
|
|
27
|
-
export class WorkerServerLauncher extends
|
|
28
|
+
export class WorkerServerLauncher extends JsonRpcGLSPServerLauncher<WorkerLaunchOptions> {
|
|
28
29
|
protected connection?: jsonrpc.MessageConnection;
|
|
29
30
|
|
|
30
31
|
protected run(options: WorkerLaunchOptions): MaybePromise<void> {
|
|
31
32
|
if (this.connection) {
|
|
32
33
|
throw new Error('Error during launch. Server already has an active client connection');
|
|
33
34
|
}
|
|
34
|
-
const container = this.createContainer();
|
|
35
35
|
this.connection = this.createConnection(options);
|
|
36
|
-
|
|
37
|
-
glspServer.connect(this.connection);
|
|
38
|
-
this.connection.onDispose(() => this.disposeClientConnection(container, glspServer));
|
|
39
|
-
|
|
36
|
+
this.createServerInstance(this.connection);
|
|
40
37
|
this.logger.info('GLSP server worker connection established');
|
|
41
|
-
this.connection.listen();
|
|
42
|
-
this.toDispose.push(this.connection);
|
|
43
38
|
postMessage(START_UP_COMPLETE_MSG);
|
|
44
39
|
return new Promise((resolve, rejects) => {
|
|
45
40
|
this.connection?.onClose(() => resolve(undefined));
|
|
@@ -47,9 +42,8 @@ export class WorkerServerLauncher extends GLSPServerLauncher<WorkerLaunchOptions
|
|
|
47
42
|
});
|
|
48
43
|
}
|
|
49
44
|
|
|
50
|
-
protected
|
|
51
|
-
|
|
52
|
-
container.unbindAll();
|
|
45
|
+
protected override disposeServerInstance(instance: JsonRpcServerInstance): void {
|
|
46
|
+
super.disposeServerInstance(instance);
|
|
53
47
|
this.connection = undefined;
|
|
54
48
|
}
|
|
55
49
|
|
|
@@ -13,10 +13,9 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, ActionMessage } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { Action, ActionMessage, GLSPClientProxy } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable, optional } from 'inversify';
|
|
18
18
|
import { ClientActionKinds, ClientId } from '../di/service-identifiers';
|
|
19
|
-
import { GLSPClientProxy } from '../protocol/glsp-client-proxy';
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
* The client action handler is responsible of handling action kinds that are intended for the
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { MaybePromise } from '@eclipse-glsp/protocol';
|
|
16
17
|
import { inject, injectable } from 'inversify';
|
|
17
|
-
import { MaybePromise } from '..';
|
|
18
18
|
import { Logger } from '../utils/logger';
|
|
19
19
|
import { Command } from './command';
|
|
20
20
|
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { GLSPClientProxy } from '@eclipse-glsp/protocol';
|
|
16
17
|
import { ContainerModule } from 'inversify';
|
|
17
|
-
import { GLSPClientProxy } from '../protocol/glsp-client-proxy';
|
|
18
18
|
import { ClientId } from './service-identifiers';
|
|
19
19
|
|
|
20
20
|
export function createClientSessionModule(clientId: string, glspClient: GLSPClientProxy): ContainerModule {
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import {
|
|
17
17
|
CenterAction,
|
|
18
18
|
DeleteMarkersAction,
|
|
19
|
+
EndProgressAction,
|
|
19
20
|
ExportSvgAction,
|
|
20
21
|
FitToScreenAction,
|
|
21
22
|
NavigateToExternalTargetAction,
|
|
@@ -39,9 +40,11 @@ import {
|
|
|
39
40
|
SetTypeHintsAction,
|
|
40
41
|
SetViewportAction,
|
|
41
42
|
SourceModelChangedAction,
|
|
43
|
+
StartProgressAction,
|
|
42
44
|
TriggerEdgeCreationAction,
|
|
43
45
|
TriggerNodeCreationAction,
|
|
44
|
-
UpdateModelAction
|
|
46
|
+
UpdateModelAction,
|
|
47
|
+
UpdateProgressAction
|
|
45
48
|
} from '@eclipse-glsp/protocol';
|
|
46
49
|
import { interfaces } from 'inversify';
|
|
47
50
|
import { ActionDispatcher, DefaultActionDispatcher } from '../actions/action-dispatcher';
|
|
@@ -86,6 +89,7 @@ import { RequestNavigationTargetsActionHandler } from '../features/navigation/re
|
|
|
86
89
|
import { ResolveNavigationTargetsActionHandler } from '../features/navigation/resolve-navigation-targets-action-handler';
|
|
87
90
|
import { PopupModelFactory } from '../features/popup/popup-model-factory';
|
|
88
91
|
import { RequestPopupModelActionHandler } from '../features/popup/request-popup-model-action-handler';
|
|
92
|
+
import { DefaultProgressService, ProgressService } from '../features/progress/progress-service';
|
|
89
93
|
import { ModelValidator } from '../features/validation/model-validator';
|
|
90
94
|
import { RequestMarkersHandler } from '../features/validation/request-markers-handler';
|
|
91
95
|
import { CompoundOperationHandler } from '../operations/compound-operation-handler';
|
|
@@ -93,7 +97,7 @@ import { OperationActionHandler } from '../operations/operation-action-handler';
|
|
|
93
97
|
import { OperationHandlerConstructor, OperationHandlerFactory } from '../operations/operation-handler';
|
|
94
98
|
import { OperationHandlerRegistry, OperationHandlerRegistryInitializer } from '../operations/operation-handler-registry';
|
|
95
99
|
import { ClientSessionInitializer } from '../session/client-session-initializer';
|
|
96
|
-
import { applyBindingTarget, applyOptionalBindingTarget
|
|
100
|
+
import { BindingTarget, applyBindingTarget, applyOptionalBindingTarget } from './binding-target';
|
|
97
101
|
import { GLSPModule } from './glsp-module';
|
|
98
102
|
import { InstanceMultiBinding, MultiBinding } from './multi-binding';
|
|
99
103
|
import {
|
|
@@ -133,6 +137,7 @@ import {
|
|
|
133
137
|
* - {@link ContextActionsProviders} as {@link ClassMultiBinding<ContextActionsProvider>} (empty)
|
|
134
138
|
* - {@link ContextActionsProviderRegistry}
|
|
135
139
|
* - {@link ActionDispatcher}
|
|
140
|
+
* - {@link ProgressService}
|
|
136
141
|
* - {@link ClientActionKinds} as {@link InstanceMultiBinding<string>}
|
|
137
142
|
* - {@link ActionHandler} as {@link InstanceMultiBinding<ActionHandlerConstructor>}
|
|
138
143
|
* - {@link ActionHandlerFactory}
|
|
@@ -217,6 +222,7 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
217
222
|
this.configureMultiBinding(new MultiBinding<ClientSessionInitializer>(ClientSessionInitializer), binding =>
|
|
218
223
|
this.configureClientSessionInitializers(binding)
|
|
219
224
|
);
|
|
225
|
+
applyBindingTarget(context, ProgressService, this.bindProgressService()).inSingletonScope();
|
|
220
226
|
applyOptionalBindingTarget(context, PopupModelFactory, this.bindPopupModelFactory());
|
|
221
227
|
applyOptionalBindingTarget(context, LayoutEngine, this.bindLayoutEngine?.());
|
|
222
228
|
}
|
|
@@ -308,6 +314,10 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
308
314
|
binding.add(LayoutOperationHandler);
|
|
309
315
|
}
|
|
310
316
|
|
|
317
|
+
protected bindProgressService(): BindingTarget<ProgressService> {
|
|
318
|
+
return DefaultProgressService;
|
|
319
|
+
}
|
|
320
|
+
|
|
311
321
|
protected configureContextActionProviders(binding: MultiBinding<ContextActionsProvider>): void {
|
|
312
322
|
// empty as default
|
|
313
323
|
}
|
|
@@ -322,16 +332,17 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
322
332
|
|
|
323
333
|
protected configureClientActions(binding: InstanceMultiBinding<string>): void {
|
|
324
334
|
binding.add(CenterAction.KIND);
|
|
325
|
-
binding.add(ExportSvgAction.KIND);
|
|
326
335
|
binding.add(DeleteMarkersAction.KIND);
|
|
336
|
+
binding.add(EndProgressAction.KIND);
|
|
337
|
+
binding.add(ExportSvgAction.KIND);
|
|
327
338
|
binding.add(FitToScreenAction.KIND);
|
|
328
|
-
binding.add(SourceModelChangedAction.KIND);
|
|
329
|
-
binding.add(NavigateToTargetAction.KIND);
|
|
330
339
|
binding.add(NavigateToExternalTargetAction.KIND);
|
|
340
|
+
binding.add(NavigateToTargetAction.KIND);
|
|
331
341
|
binding.add(RequestBoundsAction.KIND);
|
|
332
342
|
binding.add(SelectAction.KIND);
|
|
333
343
|
binding.add(SelectAllAction.KIND);
|
|
334
344
|
binding.add(ServerMessageAction.KIND);
|
|
345
|
+
binding.add(ServerStatusAction.KIND);
|
|
335
346
|
binding.add(SetBoundsAction.KIND);
|
|
336
347
|
binding.add(SetClipboardDataAction.KIND);
|
|
337
348
|
binding.add(SetContextActions.KIND);
|
|
@@ -345,10 +356,12 @@ export abstract class DiagramModule extends GLSPModule {
|
|
|
345
356
|
binding.add(SetResolvedNavigationTargetAction.KIND);
|
|
346
357
|
binding.add(SetTypeHintsAction.KIND);
|
|
347
358
|
binding.add(SetViewportAction.KIND);
|
|
348
|
-
binding.add(
|
|
349
|
-
binding.add(
|
|
359
|
+
binding.add(SourceModelChangedAction.KIND);
|
|
360
|
+
binding.add(StartProgressAction.KIND);
|
|
350
361
|
binding.add(TriggerEdgeCreationAction.KIND);
|
|
362
|
+
binding.add(TriggerNodeCreationAction.KIND);
|
|
351
363
|
binding.add(UpdateModelAction.KIND);
|
|
364
|
+
binding.add(UpdateProgressAction.KIND);
|
|
352
365
|
}
|
|
353
366
|
|
|
354
367
|
protected bindContextActionsProviderRegistry(): BindingTarget<ContextActionsProviderRegistry> {
|
|
@@ -13,12 +13,14 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { BindingContext } from '@eclipse-glsp/protocol';
|
|
16
17
|
import { ContainerModule, injectable, interfaces } from 'inversify';
|
|
17
18
|
import { AbstractMultiBinding } from './multi-binding';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* A wrapper interface to get access to the binding related functions
|
|
21
22
|
* for a inversify container.
|
|
23
|
+
* @deprecated Use `BindingContext` from `@eclipse-glsp/protocol` instead
|
|
22
24
|
*/
|
|
23
25
|
export interface ModuleContext {
|
|
24
26
|
bind: interfaces.Bind;
|
|
@@ -34,7 +36,7 @@ export interface ModuleContext {
|
|
|
34
36
|
export abstract class GLSPModule extends ContainerModule {
|
|
35
37
|
public static CLIENT_ACTIONS = 'ClientActions';
|
|
36
38
|
|
|
37
|
-
protected context:
|
|
39
|
+
protected context: BindingContext;
|
|
38
40
|
|
|
39
41
|
constructor() {
|
|
40
42
|
super((bind, unbind, isBound, rebind) => {
|
|
@@ -13,9 +13,8 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { distinctAdd, flatPush, MaybeArray, remove } from '@eclipse-glsp/protocol';
|
|
16
|
+
import { BindingContext, distinctAdd, flatPush, MaybeArray, remove } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { applyBindingTarget, BindingTarget } from './binding-target';
|
|
18
|
-
import { ModuleContext } from './glsp-module';
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* A helper class used in `GLSPModules` to ease the configuration of multi-injected service identifiers.
|
|
@@ -29,7 +28,7 @@ export abstract class AbstractMultiBinding<T> {
|
|
|
29
28
|
|
|
30
29
|
constructor(readonly identifier: string | symbol) {}
|
|
31
30
|
|
|
32
|
-
abstract applyBindings(context:
|
|
31
|
+
abstract applyBindings(context: BindingContext): void;
|
|
33
32
|
|
|
34
33
|
add(newBinding: T): void {
|
|
35
34
|
distinctAdd(this.bindings, newBinding);
|
|
@@ -71,7 +70,7 @@ export abstract class AbstractMultiBinding<T> {
|
|
|
71
70
|
* @typeparam T the base type of {@link BindingTarget}.
|
|
72
71
|
*/
|
|
73
72
|
export class MultiBinding<T> extends AbstractMultiBinding<BindingTarget<T>> {
|
|
74
|
-
applyBindings(context:
|
|
73
|
+
applyBindings(context: BindingContext): void {
|
|
75
74
|
this.bindings.forEach(binding => applyBindingTarget(context, this.identifier, binding));
|
|
76
75
|
}
|
|
77
76
|
}
|
|
@@ -83,7 +82,7 @@ export class MultiBinding<T> extends AbstractMultiBinding<BindingTarget<T>> {
|
|
|
83
82
|
* * @typeparam T the type of the instances
|
|
84
83
|
*/
|
|
85
84
|
export class InstanceMultiBinding<T> extends AbstractMultiBinding<T> {
|
|
86
|
-
applyBindings(context:
|
|
85
|
+
applyBindings(context: BindingContext): void {
|
|
87
86
|
context.bind(this.identifier).toConstantValue(this.bindings);
|
|
88
87
|
}
|
|
89
88
|
}
|
|
@@ -13,14 +13,13 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
+
import { GLSPServer, GLSPServerListener } from '@eclipse-glsp/protocol';
|
|
16
17
|
import { ContainerModule, interfaces } from 'inversify';
|
|
17
18
|
import { DefaultGlobalActionProvider, GlobalActionProvider } from '../actions/global-action-provider';
|
|
18
|
-
import {
|
|
19
|
-
import { DefaultGLSPServer, GLSPServer, JsonRpcGLSPServer } from '../protocol/glsp-server';
|
|
20
|
-
import { GLSPServerListener } from '../protocol/glsp-server-listener';
|
|
19
|
+
import { DefaultGLSPServer } from '../protocol/glsp-server';
|
|
21
20
|
import { ClientSessionFactory, DefaultClientSessionFactory } from '../session/client-session-factory';
|
|
22
21
|
import { ClientSessionManager, DefaultClientSessionManager } from '../session/client-session-manager';
|
|
23
|
-
import {
|
|
22
|
+
import { BindingTarget, applyBindingTarget } from './binding-target';
|
|
24
23
|
import { DiagramModule } from './diagram-module';
|
|
25
24
|
import { GLSPModule } from './glsp-module';
|
|
26
25
|
import { MultiBinding } from './multi-binding';
|
|
@@ -74,7 +73,6 @@ export class ServerModule extends GLSPModule {
|
|
|
74
73
|
applyBindingTarget(context, DiagramModules, this.bindDiagramModules());
|
|
75
74
|
|
|
76
75
|
applyBindingTarget(context, GLSPServer, this.bindGLSPServer()).inSingletonScope();
|
|
77
|
-
applyBindingTarget(context, JsonRpcGLSPServer, this.bindJsonRpcGLSPServer());
|
|
78
76
|
applyBindingTarget(context, ClientSessionFactory, this.bindClientSessionFactory()).inSingletonScope();
|
|
79
77
|
applyBindingTarget(context, ClientSessionManager, this.bindClientSessionManager()).inSingletonScope();
|
|
80
78
|
this.configureMultiBinding(new MultiBinding<GLSPServerListener>(GLSPServerListener), binding =>
|
|
@@ -83,10 +81,9 @@ export class ServerModule extends GLSPModule {
|
|
|
83
81
|
|
|
84
82
|
applyBindingTarget(context, GlobalActionProvider, this.bindGlobalActionProvider()).inSingletonScope();
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
applyBindingTarget(context, JsonRpcGLSPClientProxy, this.bindJsonRpcGLSPClientProxy());
|
|
84
|
+
if (!isBound(InjectionContainer)) {
|
|
85
|
+
applyBindingTarget(context, InjectionContainer, this.bindInjectionContainer());
|
|
86
|
+
}
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
protected bindDiagramModules(): BindingTarget<Map<string, ContainerModule[]>> {
|
|
@@ -97,10 +94,6 @@ export class ServerModule extends GLSPModule {
|
|
|
97
94
|
return DefaultGLSPServer;
|
|
98
95
|
}
|
|
99
96
|
|
|
100
|
-
protected bindJsonRpcGLSPServer(): BindingTarget<JsonRpcGLSPServer> {
|
|
101
|
-
return { service: GLSPServer };
|
|
102
|
-
}
|
|
103
|
-
|
|
104
97
|
protected bindClientSessionFactory(): BindingTarget<ClientSessionFactory> {
|
|
105
98
|
return DefaultClientSessionFactory;
|
|
106
99
|
}
|
|
@@ -117,14 +110,6 @@ export class ServerModule extends GLSPModule {
|
|
|
117
110
|
return { dynamicValue: context => context.container };
|
|
118
111
|
}
|
|
119
112
|
|
|
120
|
-
protected bindGLSPClientProxy(): BindingTarget<GLSPClientProxy> {
|
|
121
|
-
return DefaultGLSPClientProxy;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
protected bindJsonRpcGLSPClientProxy(): BindingTarget<JsonRpcGLSPClientProxy> {
|
|
125
|
-
return { service: GLSPClientProxy };
|
|
126
|
-
}
|
|
127
|
-
|
|
128
113
|
protected configureGLSPServerListeners(binding: MultiBinding<GLSPServerListener>): void {
|
|
129
114
|
binding.add({ service: ClientSessionManager });
|
|
130
115
|
}
|
|
@@ -17,16 +17,20 @@ import { GModelRootSchema } from '@eclipse-glsp/graph';
|
|
|
17
17
|
import {
|
|
18
18
|
Action,
|
|
19
19
|
DirtyStateChangeReason,
|
|
20
|
+
MarkersReason,
|
|
20
21
|
MaybePromise,
|
|
21
22
|
RequestBoundsAction,
|
|
22
23
|
SetDirtyStateAction,
|
|
24
|
+
SetMarkersAction,
|
|
23
25
|
SetModelAction,
|
|
24
26
|
UpdateModelAction
|
|
25
27
|
} from '@eclipse-glsp/protocol';
|
|
28
|
+
|
|
26
29
|
import { inject, injectable, optional } from 'inversify';
|
|
27
30
|
import { CommandStack } from '../../command/command-stack';
|
|
28
31
|
import { DiagramConfiguration, ServerLayoutKind } from '../../diagram/diagram-configuration';
|
|
29
32
|
import { LayoutEngine } from '../layout/layout-engine';
|
|
33
|
+
import { ModelValidator } from '../validation/model-validator';
|
|
30
34
|
import { GModelFactory } from './gmodel-factory';
|
|
31
35
|
import { GModelSerializer } from './gmodel-serializer';
|
|
32
36
|
import { ModelState } from './model-state';
|
|
@@ -52,6 +56,10 @@ export class ModelSubmissionHandler {
|
|
|
52
56
|
@inject(CommandStack)
|
|
53
57
|
protected commandStack: CommandStack;
|
|
54
58
|
|
|
59
|
+
@inject(ModelValidator)
|
|
60
|
+
@optional()
|
|
61
|
+
protected validator?: ModelValidator;
|
|
62
|
+
|
|
55
63
|
/**
|
|
56
64
|
* Returns a list of actions to update the client-side model, based on the specified <code>modelState</code>.
|
|
57
65
|
*
|
|
@@ -101,6 +109,10 @@ export class ModelSubmissionHandler {
|
|
|
101
109
|
if (!this.diagramConfiguration.needsClientLayout) {
|
|
102
110
|
result.push(SetDirtyStateAction.create(this.commandStack.isDirty, { reason }));
|
|
103
111
|
}
|
|
112
|
+
if (this.validator) {
|
|
113
|
+
const markers = await this.validator.validate([this.modelState.root], MarkersReason.LIVE);
|
|
114
|
+
result.push(SetMarkersAction.create(markers, { reason: MarkersReason.LIVE }));
|
|
115
|
+
}
|
|
104
116
|
return result;
|
|
105
117
|
}
|
|
106
118
|
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action, RequestModelAction,
|
|
16
|
+
import { Action, RequestModelAction, ServerStatusAction } from '@eclipse-glsp/protocol';
|
|
17
17
|
import { inject, injectable } from 'inversify';
|
|
18
18
|
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
19
19
|
import { ActionHandler } from '../../actions/action-handler';
|
|
20
20
|
import { Logger } from '../../utils/logger';
|
|
21
|
+
import { ProgressMonitor, ProgressService } from '../progress/progress-service';
|
|
21
22
|
import { ModelState } from './model-state';
|
|
22
23
|
import { ModelSubmissionHandler } from './model-submission-handler';
|
|
23
24
|
import { SourceModelStorage } from './source-model-storage';
|
|
@@ -41,27 +42,27 @@ export class RequestModelActionHandler implements ActionHandler {
|
|
|
41
42
|
@inject(ModelSubmissionHandler)
|
|
42
43
|
protected submissionHandler: ModelSubmissionHandler;
|
|
43
44
|
|
|
45
|
+
@inject(ProgressService)
|
|
46
|
+
protected progressService: ProgressService;
|
|
47
|
+
|
|
44
48
|
async execute(action: RequestModelAction): Promise<Action[]> {
|
|
45
49
|
this.logger.debug('Execute RequestModelAction:', action);
|
|
46
50
|
this.modelState.setAll(action.options ?? {});
|
|
47
51
|
|
|
48
|
-
this.
|
|
52
|
+
const progress = this.reportModelLoading('Model loading in progress');
|
|
49
53
|
await this.sourceModelStorage.loadSourceModel(action);
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
this.reportModelLoadingFinished(progress);
|
|
55
|
+
|
|
52
56
|
return this.submissionHandler.submitModel();
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
protected
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
ServerMessageAction.create(message, { severity }),
|
|
64
|
-
ServerStatusAction.create(message, { severity })
|
|
65
|
-
);
|
|
59
|
+
protected reportModelLoading(message: string): ProgressMonitor {
|
|
60
|
+
this.actionDispatcher.dispatch(ServerStatusAction.create(message, { severity: 'INFO' }));
|
|
61
|
+
return this.progressService.start(message);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected reportModelLoadingFinished(monitor: ProgressMonitor): void {
|
|
65
|
+
this.actionDispatcher.dispatch(ServerStatusAction.create('', { severity: 'NONE' }));
|
|
66
|
+
monitor.end();
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2023 EclipseSource 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 { EndProgressAction, StartProgressAction, UpdateProgressAction } from '@eclipse-glsp/protocol';
|
|
17
|
+
import { inject, injectable } from 'inversify';
|
|
18
|
+
import * as uuid from 'uuid';
|
|
19
|
+
import { ActionDispatcher } from '../../actions/action-dispatcher';
|
|
20
|
+
|
|
21
|
+
export const ProgressService = Symbol('ProgressService');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Service for starting and monitoring progress reporting to the client.
|
|
25
|
+
*/
|
|
26
|
+
export interface ProgressService {
|
|
27
|
+
/**
|
|
28
|
+
* Start a progress reporting.
|
|
29
|
+
* @param title The title shown in the UI for the progress reporting.
|
|
30
|
+
* @param options Additional optional options for the progress reporting.
|
|
31
|
+
* @returns a monitor to update and end the progress reporting later.
|
|
32
|
+
*/
|
|
33
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Optional progress reporting options.
|
|
38
|
+
*/
|
|
39
|
+
export interface ProgressOptions {
|
|
40
|
+
/** A message shown in the UI. */
|
|
41
|
+
message?: string;
|
|
42
|
+
/* The percentage (value range: 0 to 100) to show in the progress reporting. */
|
|
43
|
+
percentage?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The monitor of a progress reporting, which can be used to update and end the reporting.
|
|
48
|
+
*/
|
|
49
|
+
export interface ProgressMonitor {
|
|
50
|
+
/**
|
|
51
|
+
* Updates an ongoing progress reporting.
|
|
52
|
+
* @param options Updated message and/or percentage (value range: 0 to 100).
|
|
53
|
+
*/
|
|
54
|
+
update(options: { message?: string; percentage?: number }): void;
|
|
55
|
+
/**
|
|
56
|
+
* Ends an ongoing progress reporting.
|
|
57
|
+
*/
|
|
58
|
+
end(): void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@injectable()
|
|
62
|
+
export class DefaultProgressService implements ProgressService {
|
|
63
|
+
@inject(ActionDispatcher)
|
|
64
|
+
protected actionDispatcher: ActionDispatcher;
|
|
65
|
+
|
|
66
|
+
start(title: string, options?: ProgressOptions): ProgressMonitor {
|
|
67
|
+
const progressId = uuid.v4();
|
|
68
|
+
this.actionDispatcher.dispatch(StartProgressAction.create({ progressId, title, ...options }));
|
|
69
|
+
return {
|
|
70
|
+
update: updateOptions => this.actionDispatcher.dispatch(UpdateProgressAction.create(progressId, updateOptions)),
|
|
71
|
+
end: () => this.actionDispatcher.dispatch(EndProgressAction.create(progressId))
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|