@eclipse-glsp/server 1.1.0-next.44bd1e0.43 → 1.1.0-next.d07c15f.51
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 +11 -8
- package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
- package/lib/browser/launch/worker-server-launcher.js +13 -21
- package/lib/browser/launch/worker-server-launcher.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 +17 -2
- package/lib/common/actions/client-action-handler.js.map +1 -1
- package/lib/common/command/command-stack.d.ts +22 -6
- package/lib/common/command/command-stack.d.ts.map +1 -1
- package/lib/common/command/command-stack.js +6 -21
- package/lib/common/command/command-stack.js.map +1 -1
- package/lib/common/command/command-stack.spec.js +31 -31
- package/lib/common/command/command-stack.spec.js.map +1 -1
- package/lib/common/command/command.d.ts +7 -6
- package/lib/common/command/command.d.ts.map +1 -1
- package/lib/common/command/command.js +19 -15
- package/lib/common/command/command.js.map +1 -1
- package/lib/common/command/command.spec.js +8 -8
- package/lib/common/command/command.spec.js.map +1 -1
- package/lib/common/command/recording-command.d.ts +15 -15
- package/lib/common/command/recording-command.d.ts.map +1 -1
- package/lib/common/command/recording-command.js +10 -10
- package/lib/common/command/recording-command.js.map +1 -1
- package/lib/common/command/recording-command.spec.js +8 -8
- package/lib/common/command/recording-command.spec.js.map +1 -1
- package/lib/common/command/undo-redo-action-handler.d.ts +2 -2
- package/lib/common/command/undo-redo-action-handler.d.ts.map +1 -1
- package/lib/common/command/undo-redo-action-handler.js +4 -4
- package/lib/common/command/undo-redo-action-handler.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/glsp-module.d.ts +3 -1
- package/lib/common/di/glsp-module.d.ts.map +1 -1
- package/lib/common/di/glsp-module.js +0 -15
- 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/features/layout/computed-bounds-action-handler.js +1 -1
- package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
- package/lib/common/index.d.ts +4 -3
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +4 -3
- package/lib/common/index.js.map +1 -1
- package/lib/common/launch/glsp-server-launcher.d.ts +8 -7
- package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
- package/lib/common/launch/glsp-server-launcher.js +27 -4
- 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 +84 -0
- package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
- package/lib/common/operations/operation-action-handler.d.ts +1 -1
- package/lib/common/operations/operation-action-handler.d.ts.map +1 -1
- package/lib/common/operations/operation-action-handler.js +3 -3
- package/lib/common/operations/operation-action-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 +13 -20
- package/lib/common/protocol/glsp-server.js.map +1 -1
- package/lib/common/protocol/glsp-server.spec.js +18 -5
- package/lib/common/protocol/glsp-server.spec.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 +17 -2
- package/lib/common/session/client-session-factory.js.map +1 -1
- package/lib/common/session/client-session-factory.spec.js +2 -2
- package/lib/common/session/client-session-factory.spec.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.map +1 -1
- package/lib/common/test/mock-util.d.ts +9 -6
- package/lib/common/test/mock-util.d.ts.map +1 -1
- package/lib/common/test/mock-util.js +23 -1
- package/lib/common/test/mock-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 +26 -8
- package/lib/common/utils/console-logger.js.map +1 -0
- package/lib/common/utils/layout-util.d.ts +1 -1
- package/lib/common/utils/layout-util.d.ts.map +1 -1
- package/lib/common/utils/layout-util.js +3 -3
- package/lib/common/utils/layout-util.js.map +1 -1
- 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 +12 -1
- package/lib/common/utils/logger.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/index.d.ts +1 -0
- package/lib/node/index.d.ts.map +1 -1
- package/lib/node/index.js +1 -0
- package/lib/node/index.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-cli-parser.js +1 -1
- package/lib/node/launch/socket-cli-parser.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.d.ts +4 -24
- package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
- package/lib/node/launch/socket-server-launcher.js +15 -34
- package/lib/node/launch/socket-server-launcher.js.map +1 -1
- package/lib/node/launch/socket-server-launcher.spec.js +5 -0
- package/lib/node/launch/socket-server-launcher.spec.js.map +1 -1
- package/lib/node/launch/websocket-server-launcher.d.ts +53 -0
- package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -0
- package/lib/node/launch/websocket-server-launcher.js +121 -0
- package/lib/node/launch/websocket-server-launcher.js.map +1 -0
- package/package.json +7 -5
- package/src/browser/di/app-module.ts +4 -32
- package/src/browser/index.ts +0 -1
- package/src/browser/launch/worker-server-launcher.ts +20 -22
- package/src/common/actions/client-action-handler.ts +1 -2
- package/src/common/command/command-stack.spec.ts +32 -32
- package/src/common/command/command-stack.ts +10 -9
- package/src/common/command/command.spec.ts +9 -10
- package/src/common/command/command.ts +23 -19
- package/src/common/command/recording-command.spec.ts +8 -8
- package/src/common/command/recording-command.ts +19 -19
- package/src/common/command/undo-redo-action-handler.ts +4 -4
- package/src/common/di/client-session-module.ts +1 -1
- 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/layout/computed-bounds-action-handler.ts +2 -2
- package/src/common/index.ts +4 -3
- package/src/common/launch/glsp-server-launcher.ts +15 -9
- package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
- package/src/common/operations/operation-action-handler.ts +3 -3
- 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 +26 -5
- package/src/{browser/di → common/utils}/console-logger.ts +19 -1
- package/src/common/utils/layout-util.ts +1 -1
- package/src/common/utils/logger.ts +16 -1
- package/src/node/di/app-module.ts +4 -13
- package/src/node/index.ts +1 -0
- package/src/node/launch/cli-parser.ts +2 -3
- package/src/node/launch/socket-cli-parser.ts +1 -1
- package/src/node/launch/socket-server-launcher.spec.ts +6 -0
- package/src/node/launch/socket-server-launcher.ts +19 -35
- package/src/node/launch/websocket-server-launcher.ts +138 -0
- package/lib/browser/di/console-logger.d.ts.map +0 -1
- package/lib/browser/di/console-logger.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 +0 -53
- 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/src/common/protocol/glsp-client-proxy.ts +0 -65
- package/src/common/protocol/glsp-server-listener.ts +0 -39
|
@@ -14,11 +14,6 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
import { ContainerModule } from 'inversify';
|
|
17
|
-
import {
|
|
18
|
-
export
|
|
19
|
-
consoleLog?: boolean;
|
|
20
|
-
logLevel?: LogLevel;
|
|
21
|
-
}
|
|
22
|
-
export declare function createAppModule(options?: LaunchOptions): ContainerModule;
|
|
23
|
-
export declare function configureConsoleLogger<T extends LaunchOptions>(context: ModuleContext, options: T): void;
|
|
17
|
+
import { LoggerConfigOptions } from '../../common/';
|
|
18
|
+
export declare function createAppModule(options?: LoggerConfigOptions): ContainerModule;
|
|
24
19
|
//# sourceMappingURL=app-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-module.d.ts","sourceRoot":"","sources":["../../../src/browser/di/app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"app-module.d.ts","sourceRoot":"","sources":["../../../src/browser/di/app-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAgC,mBAAmB,EAA0B,MAAM,eAAe,CAAC;AAE1G,wBAAgB,eAAe,CAAC,OAAO,GAAE,mBAAwB,GAAG,eAAe,CAOlF"}
|
|
@@ -15,41 +15,16 @@
|
|
|
15
15
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
16
16
|
********************************************************************************/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.createAppModule = void 0;
|
|
19
19
|
const inversify_1 = require("inversify");
|
|
20
|
-
const
|
|
21
|
-
const console_logger_1 = require("./console-logger");
|
|
20
|
+
const common_1 = require("../../common/");
|
|
22
21
|
function createAppModule(options = {}) {
|
|
23
|
-
const resolvedOptions = Object.assign({ consoleLog: true, logLevel:
|
|
22
|
+
const resolvedOptions = Object.assign({ consoleLog: true, logLevel: common_1.LogLevel.info }, options);
|
|
24
23
|
return new inversify_1.ContainerModule((bind, unbind, isBound, rebind) => {
|
|
25
|
-
bind(
|
|
24
|
+
bind(common_1.InjectionContainer).toDynamicValue(dynamicContext => dynamicContext.container);
|
|
26
25
|
const context = { bind, unbind, isBound, rebind };
|
|
27
|
-
configureConsoleLogger(context, resolvedOptions);
|
|
26
|
+
(0, common_1.configureConsoleLogger)(context, resolvedOptions);
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
29
|
exports.createAppModule = createAppModule;
|
|
31
|
-
function configureConsoleLogger(context, options) {
|
|
32
|
-
if (!options.consoleLog) {
|
|
33
|
-
context.bind(index_1.Logger).to(index_1.NullLogger).inSingletonScope();
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
context.bind(index_1.Logger).toDynamicValue(ctx => new console_logger_1.ConsoleLogger(options.logLevel, getRequestParentName(ctx)));
|
|
37
|
-
}
|
|
38
|
-
context.bind(index_1.LoggerFactory).toFactory(dynamicContext => (caller) => {
|
|
39
|
-
const logger = dynamicContext.container.get(index_1.Logger);
|
|
40
|
-
logger.caller = caller;
|
|
41
|
-
return logger;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
exports.configureConsoleLogger = configureConsoleLogger;
|
|
45
|
-
function getRequestParentName(context) {
|
|
46
|
-
var _a;
|
|
47
|
-
if (context.currentRequest.parentRequest) {
|
|
48
|
-
const bindings = context.currentRequest.parentRequest.bindings;
|
|
49
|
-
if (bindings.length > 0) {
|
|
50
|
-
return (_a = bindings[0].implementationType) === null || _a === void 0 ? void 0 : _a.name;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return undefined;
|
|
54
|
-
}
|
|
55
30
|
//# sourceMappingURL=app-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-module.js","sourceRoot":"","sources":["../../../src/browser/di/app-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,
|
|
1
|
+
{"version":3,"file":"app-module.js","sourceRoot":"","sources":["../../../src/browser/di/app-module.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,yCAA4C;AAC5C,0CAA0G;AAE1G,SAAgB,eAAe,CAAC,UAA+B,EAAE;IAC7D,MAAM,eAAe,mBAA0B,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAQ,CAAC,IAAI,IAAK,OAAO,CAAE,CAAC;IACvG,OAAO,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;QACzD,IAAI,CAAC,2BAAkB,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACpF,MAAM,OAAO,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAClD,IAAA,+BAAsB,EAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACP,CAAC;AAPD,0CAOC"}
|
package/lib/browser/index.d.ts
CHANGED
|
@@ -15,6 +15,5 @@
|
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
export * from '../common/index';
|
|
17
17
|
export * from './di/app-module';
|
|
18
|
-
export * from './di/console-logger';
|
|
19
18
|
export * from './launch/worker-server-launcher';
|
|
20
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iCAAiC,CAAC"}
|
package/lib/browser/index.js
CHANGED
|
@@ -31,6 +31,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
31
31
|
********************************************************************************/
|
|
32
32
|
__exportStar(require("../common/index"), exports);
|
|
33
33
|
__exportStar(require("./di/app-module"), exports);
|
|
34
|
-
__exportStar(require("./di/console-logger"), exports);
|
|
35
34
|
__exportStar(require("./launch/worker-server-launcher"), exports);
|
|
36
35
|
//# sourceMappingURL=index.js.map
|
package/lib/browser/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,kDAAgC;AAChC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/browser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,kDAAgC;AAChC,kDAAgC;AAChC,kEAAgD"}
|
|
@@ -13,14 +13,17 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Container } from 'inversify';
|
|
17
16
|
import * as jsonrpc from 'vscode-jsonrpc/browser';
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
import { MaybePromise } from '../../common/index';
|
|
18
|
+
import { JsonRpcGLSPServerLauncher, JsonRpcServerInstance } from '../../common/launch/jsonrpc-server-launcher';
|
|
19
|
+
export interface WorkerLaunchOptions {
|
|
20
|
+
context?: Worker;
|
|
21
|
+
}
|
|
22
|
+
export declare const START_UP_COMPLETE_MSG = "[GLSP-Server]:Startup completed.";
|
|
23
|
+
export declare class WorkerServerLauncher extends JsonRpcGLSPServerLauncher<WorkerLaunchOptions> {
|
|
24
|
+
protected connection?: jsonrpc.MessageConnection;
|
|
25
|
+
protected run(options: WorkerLaunchOptions): MaybePromise<void>;
|
|
26
|
+
protected disposeServerInstance(instance: JsonRpcServerInstance): void;
|
|
27
|
+
protected createConnection(options: WorkerLaunchOptions): jsonrpc.MessageConnection;
|
|
25
28
|
}
|
|
26
29
|
//# sourceMappingURL=worker-server-launcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/browser/launch/worker-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;
|
|
1
|
+
{"version":3,"file":"worker-server-launcher.d.ts","sourceRoot":"","sources":["../../../src/browser/launch/worker-server-launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAC/G,MAAM,WAAW,mBAAmB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AAExE,qBACa,oBAAqB,SAAQ,yBAAyB,CAAC,mBAAmB,CAAC;IACpF,SAAS,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAEjD,SAAS,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAAC,IAAI,CAAC;cAc5C,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI;IAK/E,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB;CAMtF"}
|
|
@@ -21,41 +21,33 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
21
21
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
|
-
exports.WorkerServerLauncher = void 0;
|
|
24
|
+
exports.WorkerServerLauncher = exports.START_UP_COMPLETE_MSG = void 0;
|
|
25
25
|
const inversify_1 = require("inversify");
|
|
26
26
|
const jsonrpc = require("vscode-jsonrpc/browser");
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
const jsonrpc_server_launcher_1 = require("../../common/launch/jsonrpc-server-launcher");
|
|
28
|
+
exports.START_UP_COMPLETE_MSG = '[GLSP-Server]:Startup completed.';
|
|
29
|
+
let WorkerServerLauncher = class WorkerServerLauncher extends jsonrpc_server_launcher_1.JsonRpcGLSPServerLauncher {
|
|
30
|
+
run(options) {
|
|
30
31
|
if (this.connection) {
|
|
31
32
|
throw new Error('Error during launch. Server already has an active client connection');
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
this.
|
|
35
|
-
const glspServer = container.get(index_1.JsonRpcGLSPServer);
|
|
36
|
-
glspServer.connect(this.connection);
|
|
37
|
-
this.connection.onDispose(() => this.disposeClientConnection(container, glspServer));
|
|
34
|
+
this.connection = this.createConnection(options);
|
|
35
|
+
this.createServerInstance(this.connection);
|
|
38
36
|
this.logger.info('GLSP server worker connection established');
|
|
39
|
-
|
|
40
|
-
postMessage(index_1.START_UP_COMPLETE_MSG);
|
|
37
|
+
postMessage(exports.START_UP_COMPLETE_MSG);
|
|
41
38
|
return new Promise((resolve, rejects) => {
|
|
42
39
|
var _a, _b;
|
|
43
40
|
(_a = this.connection) === null || _a === void 0 ? void 0 : _a.onClose(() => resolve(undefined));
|
|
44
41
|
(_b = this.connection) === null || _b === void 0 ? void 0 : _b.onError(error => rejects(error));
|
|
45
42
|
});
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
container.unbindAll();
|
|
44
|
+
disposeServerInstance(instance) {
|
|
45
|
+
super.disposeServerInstance(instance);
|
|
50
46
|
this.connection = undefined;
|
|
51
47
|
}
|
|
52
|
-
|
|
53
|
-
var _a;
|
|
54
|
-
|
|
55
|
-
(_a = this.connection) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
56
|
-
}
|
|
57
|
-
createConnection() {
|
|
58
|
-
return jsonrpc.createMessageConnection(new jsonrpc.BrowserMessageReader(self), new jsonrpc.BrowserMessageWriter(self));
|
|
48
|
+
createConnection(options) {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
return jsonrpc.createMessageConnection(new jsonrpc.BrowserMessageReader((_a = options.context) !== null && _a !== void 0 ? _a : self), new jsonrpc.BrowserMessageWriter((_b = options.context) !== null && _b !== void 0 ? _b : self));
|
|
59
51
|
}
|
|
60
52
|
};
|
|
61
53
|
WorkerServerLauncher = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-server-launcher.js","sourceRoot":"","sources":["../../../src/browser/launch/worker-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,
|
|
1
|
+
{"version":3,"file":"worker-server-launcher.js","sourceRoot":"","sources":["../../../src/browser/launch/worker-server-launcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;AAElF,yCAAuC;AACvC,kDAAkD;AAElD,yFAA+G;AAKlG,QAAA,qBAAqB,GAAG,kCAAkC,CAAC;AAGjE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mDAA8C;IAG1E,GAAG,CAAC,OAA4B;QACtC,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;SAC1F;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAC;QAC9D,WAAW,CAAC,6BAAqB,CAAC,CAAC;QACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE;;YACpC,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;YACnD,MAAA,IAAI,CAAC,UAAU,0CAAE,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACP,CAAC;IAEkB,qBAAqB,CAAC,QAA+B;QACpE,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAChC,CAAC;IAES,gBAAgB,CAAC,OAA4B;;QACnD,OAAO,OAAO,CAAC,uBAAuB,CAClC,IAAI,OAAO,CAAC,oBAAoB,CAAC,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAI,CAAC,EACzD,IAAI,OAAO,CAAC,oBAAoB,CAAC,MAAA,OAAO,CAAC,OAAO,mCAAI,IAAI,CAAC,CAC5D,CAAC;IACN,CAAC;CACJ,CAAA;AA5BY,oBAAoB;IADhC,IAAA,sBAAU,GAAE;GACA,oBAAoB,CA4BhC;AA5BY,oDAAoB"}
|
|
@@ -13,8 +13,7 @@
|
|
|
13
13
|
*
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
|
-
import { Action } from '@eclipse-glsp/protocol';
|
|
17
|
-
import { GLSPClientProxy } from '../protocol/glsp-client-proxy';
|
|
16
|
+
import { Action, GLSPClientProxy } from '@eclipse-glsp/protocol';
|
|
18
17
|
/**
|
|
19
18
|
* The client action handler is responsible of handling action kinds that are intended for the
|
|
20
19
|
* GLSP client, by sending them to the client over json-rpc.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-action-handler.d.ts","sourceRoot":"","sources":["../../../src/common/actions/client-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAiB,
|
|
1
|
+
{"version":3,"file":"client-action-handler.d.ts","sourceRoot":"","sources":["../../../src/common/actions/client-action-handler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,MAAM,EAAiB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAIhF;;;GAGG;AAEH,qBACa,mBAAoB,YAAW,mBAAmB;IAQD,WAAW,EAAE,MAAM,EAAE;IAL/E,SAAS,CAAC,UAAU,CAAC,EAAE,eAAe,CAAC;IAGvC,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEsB,WAAW,GAAE,MAAM,EAAO;IAEpF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE;IAK3B,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAQvC"}
|
|
@@ -13,9 +13,24 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ClientActionHandler = void 0;
|
|
16
|
+
/********************************************************************************
|
|
17
|
+
* Copyright (c) 2022-2023 STMicroelectronics and others.
|
|
18
|
+
*
|
|
19
|
+
* This program and the accompanying materials are made available under the
|
|
20
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
21
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
22
|
+
*
|
|
23
|
+
* This Source Code may also be made available under the following Secondary
|
|
24
|
+
* Licenses when the conditions for such availability set forth in the Eclipse
|
|
25
|
+
* Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
26
|
+
* with the GNU Classpath Exception which is available at
|
|
27
|
+
* https://www.gnu.org/software/classpath/license.html.
|
|
28
|
+
*
|
|
29
|
+
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
30
|
+
********************************************************************************/
|
|
31
|
+
const protocol_1 = require("@eclipse-glsp/protocol");
|
|
16
32
|
const inversify_1 = require("inversify");
|
|
17
33
|
const service_identifiers_1 = require("../di/service-identifiers");
|
|
18
|
-
const glsp_client_proxy_1 = require("../protocol/glsp-client-proxy");
|
|
19
34
|
/**
|
|
20
35
|
* The client action handler is responsible of handling action kinds that are intended for the
|
|
21
36
|
* GLSP client, by sending them to the client over json-rpc.
|
|
@@ -38,7 +53,7 @@ let ClientActionHandler = class ClientActionHandler {
|
|
|
38
53
|
}
|
|
39
54
|
};
|
|
40
55
|
__decorate([
|
|
41
|
-
(0, inversify_1.inject)(
|
|
56
|
+
(0, inversify_1.inject)(protocol_1.GLSPClientProxy),
|
|
42
57
|
(0, inversify_1.optional)(),
|
|
43
58
|
__metadata("design:type", Object)
|
|
44
59
|
], ClientActionHandler.prototype, "glspClient", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-action-handler.js","sourceRoot":"","sources":["../../../src/common/actions/client-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"client-action-handler.js","sourceRoot":"","sources":["../../../src/common/actions/client-action-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAAgF;AAChF,yCAAyD;AACzD,mEAAwE;AAExE;;;GAGG;AAGI,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAQ5B,YAA0D,cAAwB,EAAE;QAA1B,gBAAW,GAAX,WAAW,CAAe;IAAG,CAAC;IAExF,OAAO,CAAC,MAAc;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClB,OAAO,EAAE,CAAC;IACd,CAAC;IAES,IAAI,CAAC,MAAc;QACzB,MAAM,OAAO,GAAkB,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACnE,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjC,OAAO;SACV;QACD,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACvF,CAAC;CACJ,CAAA;AAtBG;IAAC,IAAA,kBAAM,EAAC,0BAAe,CAAC;IACvB,IAAA,oBAAQ,GAAE;;uDAC4B;AAEvC;IAAC,IAAA,kBAAM,EAAC,8BAAQ,CAAC;;qDACmB;AAN3B,mBAAmB;IAD/B,IAAA,sBAAU,GAAE;IASI,WAAA,IAAA,kBAAM,EAAC,uCAAiB,CAAC,CAAA;IAAE,WAAA,IAAA,oBAAQ,GAAE,CAAA;;GARzC,mBAAmB,CAuB/B;AAvBY,kDAAmB"}
|
|
@@ -1,3 +1,19 @@
|
|
|
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 { MaybePromise } from '@eclipse-glsp/protocol';
|
|
1
17
|
import { Logger } from '../utils/logger';
|
|
2
18
|
import { Command } from './command';
|
|
3
19
|
export declare const CommandStack: unique symbol;
|
|
@@ -13,11 +29,11 @@ export interface CommandStack {
|
|
|
13
29
|
* Clears any redoable commands not yet redone, adds the command to the stack and then invokes {@link Command.execute}.
|
|
14
30
|
* @param command the command to execute.
|
|
15
31
|
*/
|
|
16
|
-
execute(command: Command): void
|
|
32
|
+
execute(command: Command): MaybePromise<void>;
|
|
17
33
|
/**
|
|
18
34
|
* Removes the topmost (i.e. last executed) command from the stack and invokes {@link Command.undo}.
|
|
19
35
|
*/
|
|
20
|
-
undo(): void
|
|
36
|
+
undo(): MaybePromise<void>;
|
|
21
37
|
/**
|
|
22
38
|
* Returns `true` if the top command on the stack can be undone.
|
|
23
39
|
*/
|
|
@@ -25,7 +41,7 @@ export interface CommandStack {
|
|
|
25
41
|
/**
|
|
26
42
|
* Re-adds the last undo command on top of the stack and invokes {@link Command.redo}
|
|
27
43
|
*/
|
|
28
|
-
redo(): void
|
|
44
|
+
redo(): MaybePromise<void>;
|
|
29
45
|
/**
|
|
30
46
|
* Returns `true` if there are redoable commands in the stack.
|
|
31
47
|
*/
|
|
@@ -54,10 +70,10 @@ export declare class DefaultCommandStack implements CommandStack {
|
|
|
54
70
|
* The current position within the command list when {@link DefaultCommandStack.saveIsDone} is called.
|
|
55
71
|
*/
|
|
56
72
|
protected saveIndex: number;
|
|
57
|
-
execute(command: Command): void
|
|
58
|
-
undo(): void
|
|
73
|
+
execute(command: Command): Promise<void>;
|
|
74
|
+
undo(): Promise<void>;
|
|
59
75
|
canUndo(): boolean;
|
|
60
|
-
redo(): void
|
|
76
|
+
redo(): Promise<void>;
|
|
61
77
|
canRedo(): boolean;
|
|
62
78
|
get isDirty(): boolean;
|
|
63
79
|
saveIsDone(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-stack.d.ts","sourceRoot":"","sources":["../../../src/common/command/command-stack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-stack.d.ts","sourceRoot":"","sources":["../../../src/common/command/command-stack.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAE9C;;OAEG;IACH,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAE3B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;IAE3B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACjB;AAED,qBACa,mBAAoB,YAAW,YAAY;IAEpD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IAEzB,SAAS,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAM;IAEnC;;OAEG;IACH,SAAS,CAAC,GAAG,SAAM;IAEnB;;OAEG;IACH,SAAS,CAAC,SAAS,SAAM;IAEnB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBxC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,OAAO,IAAI,OAAO;IAMZ,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,OAAO,IAAI,OAAO;IAIlB,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,UAAU,IAAI,IAAI;IAIlB,KAAK,IAAI,IAAI;IAMb,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK;CAM3C"}
|
|
@@ -10,21 +10,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.DefaultCommandStack = exports.CommandStack = 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
13
|
const inversify_1 = require("inversify");
|
|
29
14
|
const logger_1 = require("../utils/logger");
|
|
30
15
|
const command_1 = require("./command");
|
|
@@ -41,9 +26,9 @@ let DefaultCommandStack = class DefaultCommandStack {
|
|
|
41
26
|
*/
|
|
42
27
|
this.saveIndex = -1;
|
|
43
28
|
}
|
|
44
|
-
execute(command) {
|
|
29
|
+
async execute(command) {
|
|
45
30
|
try {
|
|
46
|
-
command.execute();
|
|
31
|
+
await command.execute();
|
|
47
32
|
}
|
|
48
33
|
catch (error) {
|
|
49
34
|
this.handleError(error);
|
|
@@ -58,11 +43,11 @@ let DefaultCommandStack = class DefaultCommandStack {
|
|
|
58
43
|
this.saveIndex = -2;
|
|
59
44
|
}
|
|
60
45
|
}
|
|
61
|
-
undo() {
|
|
46
|
+
async undo() {
|
|
62
47
|
if (this.canUndo()) {
|
|
63
48
|
const command = this.commands[this.top--];
|
|
64
49
|
try {
|
|
65
|
-
command.undo();
|
|
50
|
+
await command.undo();
|
|
66
51
|
}
|
|
67
52
|
catch (error) {
|
|
68
53
|
this.handleError(error);
|
|
@@ -74,11 +59,11 @@ let DefaultCommandStack = class DefaultCommandStack {
|
|
|
74
59
|
? command_1.Command.canUndo(this.commands[this.top])
|
|
75
60
|
: false;
|
|
76
61
|
}
|
|
77
|
-
redo() {
|
|
62
|
+
async redo() {
|
|
78
63
|
if (this.canRedo()) {
|
|
79
64
|
const command = this.commands[++this.top];
|
|
80
65
|
try {
|
|
81
|
-
command.redo();
|
|
66
|
+
await command.redo();
|
|
82
67
|
}
|
|
83
68
|
catch (error) {
|
|
84
69
|
this.handleError(error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-stack.js","sourceRoot":"","sources":["../../../src/common/command/command-stack.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"command-stack.js","sourceRoot":"","sources":["../../../src/common/command/command-stack.ts"],"names":[],"mappings":"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"}
|
|
@@ -36,142 +36,142 @@ describe('test DefaultCommandStack', () => {
|
|
|
36
36
|
commandStack = container.resolve(command_stack_1.DefaultCommandStack);
|
|
37
37
|
});
|
|
38
38
|
describe('execute', () => {
|
|
39
|
-
it('should execute the given command and become dirty', () => {
|
|
39
|
+
it('should execute the given command and become dirty', async () => {
|
|
40
40
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
41
|
-
commandStack.execute(command1);
|
|
41
|
+
await commandStack.execute(command1);
|
|
42
42
|
(0, chai_1.expect)(command1.execute.calledOnce).to.be.true;
|
|
43
43
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
44
44
|
});
|
|
45
|
-
it('should execute the given commands in order and become dirty', () => {
|
|
45
|
+
it('should execute the given commands in order and become dirty', async () => {
|
|
46
46
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
47
|
-
commandStack.execute(command1);
|
|
48
|
-
commandStack.execute(command2);
|
|
47
|
+
await commandStack.execute(command1);
|
|
48
|
+
await commandStack.execute(command2);
|
|
49
49
|
(0, chai_1.expect)(command1.execute.calledOnce).to.be.true;
|
|
50
50
|
(0, chai_1.expect)(command2.execute.calledOnce).to.be.true;
|
|
51
51
|
(0, chai_1.expect)(command2.execute.calledAfter(command1.execute)).to.be.true;
|
|
52
52
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
53
53
|
});
|
|
54
|
-
it('should be able to undo after execute', () => {
|
|
54
|
+
it('should be able to undo after execute', async () => {
|
|
55
55
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
56
|
-
commandStack.execute(command1);
|
|
56
|
+
await commandStack.execute(command1);
|
|
57
57
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
58
58
|
});
|
|
59
|
-
it('should clear the redo stack after execution', () => {
|
|
59
|
+
it('should clear the redo stack after execution', async () => {
|
|
60
60
|
commandStack['commands'].push(command2);
|
|
61
61
|
commandStack['top'] = -1;
|
|
62
62
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
63
|
-
commandStack.execute(command1);
|
|
63
|
+
await commandStack.execute(command1);
|
|
64
64
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
65
65
|
});
|
|
66
|
-
it('should flush the stack in case of an execution error', () => {
|
|
66
|
+
it('should flush the stack in case of an execution error', async () => {
|
|
67
67
|
command2.execute.throwsException();
|
|
68
68
|
const flushSpy = sandbox.spy(commandStack, 'flush');
|
|
69
|
-
(0,
|
|
69
|
+
await (0, mock_util_1.expectToThrowAsync)(() => commandStack.execute(command2));
|
|
70
70
|
(0, chai_1.expect)(command2.execute.calledOnce).to.be.true;
|
|
71
71
|
(0, chai_1.expect)(flushSpy.calledOnce).to.be.true;
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
74
|
describe('undo', () => {
|
|
75
|
-
it('should do nothing if the command stack is empty', () => {
|
|
75
|
+
it('should do nothing if the command stack is empty', async () => {
|
|
76
76
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
77
|
-
commandStack.undo();
|
|
77
|
+
await commandStack.undo();
|
|
78
78
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
79
79
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
80
80
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
81
81
|
});
|
|
82
|
-
it('should undo the command and become non-dirty again', () => {
|
|
82
|
+
it('should undo the command and become non-dirty again', async () => {
|
|
83
83
|
commandStack['commands'].push(command1);
|
|
84
84
|
commandStack['top'] = 0;
|
|
85
85
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
86
86
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
87
87
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
88
|
-
commandStack.undo();
|
|
88
|
+
await commandStack.undo();
|
|
89
89
|
(0, chai_1.expect)(command1.undo.calledOnce).to.be.true;
|
|
90
90
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
91
91
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
92
92
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
93
93
|
});
|
|
94
|
-
it('should undo multiple command and become non-dirty again', () => {
|
|
94
|
+
it('should undo multiple command and become non-dirty again', async () => {
|
|
95
95
|
commandStack['commands'].push(command1, command2);
|
|
96
96
|
commandStack['top'] = 1;
|
|
97
97
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
98
98
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
99
99
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
100
|
-
commandStack.undo();
|
|
100
|
+
await commandStack.undo();
|
|
101
101
|
(0, chai_1.expect)(command2.undo.calledOnce).to.be.true;
|
|
102
102
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
103
103
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
104
104
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
105
|
-
commandStack.undo();
|
|
105
|
+
await commandStack.undo();
|
|
106
106
|
(0, chai_1.expect)(command1.undo.calledOnce).to.be.true;
|
|
107
107
|
(0, chai_1.expect)(command1.undo.calledAfter(command2.undo)).to.be.true;
|
|
108
108
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
109
109
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
110
110
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
111
111
|
});
|
|
112
|
-
it('should flush the stack in case of an execution error', () => {
|
|
112
|
+
it('should flush the stack in case of an execution error', async () => {
|
|
113
113
|
command2.undo.throwsException();
|
|
114
114
|
const flushSpy = sandbox.spy(commandStack, 'flush');
|
|
115
115
|
commandStack['commands'].push(command2);
|
|
116
116
|
commandStack['top'] = 0;
|
|
117
|
-
(0,
|
|
117
|
+
await (0, mock_util_1.expectToThrowAsync)(() => commandStack.undo());
|
|
118
118
|
(0, chai_1.expect)(command2.undo.calledOnce).to.be.true;
|
|
119
119
|
(0, chai_1.expect)(flushSpy.calledOnce).to.be.true;
|
|
120
120
|
});
|
|
121
121
|
});
|
|
122
122
|
describe('redo', () => {
|
|
123
|
-
it('should do nothing if the command stack is empty', () => {
|
|
123
|
+
it('should do nothing if the command stack is empty', async () => {
|
|
124
124
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
125
|
-
commandStack.redo();
|
|
125
|
+
await commandStack.redo();
|
|
126
126
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
127
127
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
128
128
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
129
129
|
});
|
|
130
|
-
it('should redo the command and become dirty again', () => {
|
|
130
|
+
it('should redo the command and become dirty again', async () => {
|
|
131
131
|
commandStack['commands'].push(command1);
|
|
132
132
|
commandStack['top'] = -1;
|
|
133
133
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
134
134
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
135
135
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
136
|
-
commandStack.redo();
|
|
136
|
+
await commandStack.redo();
|
|
137
137
|
(0, chai_1.expect)(command1.redo.calledOnce).to.be.true;
|
|
138
138
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
139
139
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
140
140
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
141
141
|
});
|
|
142
|
-
it('should undo multiple command and become non-dirty again', () => {
|
|
142
|
+
it('should undo multiple command and become non-dirty again', async () => {
|
|
143
143
|
commandStack['commands'].push(command2, command1);
|
|
144
144
|
commandStack['top'] = -1;
|
|
145
145
|
commandStack['saveIndex'] = -1;
|
|
146
146
|
(0, chai_1.expect)(commandStack.isDirty).to.be.false;
|
|
147
147
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
148
148
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
149
|
-
commandStack.redo();
|
|
149
|
+
await commandStack.redo();
|
|
150
150
|
(0, chai_1.expect)(command2.redo.calledOnce).to.be.true;
|
|
151
151
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.true;
|
|
152
152
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
153
153
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
154
|
-
commandStack.redo();
|
|
154
|
+
await commandStack.redo();
|
|
155
155
|
(0, chai_1.expect)(command1.redo.calledOnce).to.be.true;
|
|
156
156
|
(0, chai_1.expect)(command1.redo.calledAfter(command2.redo)).to.be.true;
|
|
157
157
|
(0, chai_1.expect)(commandStack.isDirty).to.be.true;
|
|
158
158
|
(0, chai_1.expect)(commandStack.canRedo()).to.be.false;
|
|
159
159
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
160
160
|
});
|
|
161
|
-
it('should flush the stack in case of an execution error', () => {
|
|
161
|
+
it('should flush the stack in case of an execution error', async () => {
|
|
162
162
|
command2.redo.throwsException();
|
|
163
163
|
const flushSpy = sandbox.spy(commandStack, 'flush');
|
|
164
164
|
commandStack['commands'].push(command2);
|
|
165
165
|
commandStack['top'] = -1;
|
|
166
|
-
(0,
|
|
166
|
+
await (0, mock_util_1.expectToThrowAsync)(() => commandStack.redo());
|
|
167
167
|
(0, chai_1.expect)(command2.redo.calledOnce).to.be.true;
|
|
168
168
|
(0, chai_1.expect)(flushSpy.calledOnce).to.be.true;
|
|
169
169
|
});
|
|
170
|
-
it('should be able to undo after redo', () => {
|
|
170
|
+
it('should be able to undo after redo', async () => {
|
|
171
171
|
commandStack['commands'].push(command1);
|
|
172
172
|
commandStack['top'] = -1;
|
|
173
173
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.false;
|
|
174
|
-
commandStack.redo();
|
|
174
|
+
await commandStack.redo();
|
|
175
175
|
(0, chai_1.expect)(commandStack.canUndo()).to.be.true;
|
|
176
176
|
});
|
|
177
177
|
});
|