@eclipse-glsp/server 2.8.0-next.1 → 2.8.0-next.12

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.
Files changed (132) hide show
  1. package/lib/browser/launch/worker-server-launcher.js +3 -5
  2. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  3. package/lib/common/actions/action-dispatcher.js +5 -8
  4. package/lib/common/actions/action-dispatcher.js.map +1 -1
  5. package/lib/common/actions/action-handler-registry.js +1 -1
  6. package/lib/common/actions/action-handler-registry.js.map +1 -1
  7. package/lib/common/actions/global-action-provider.js +1 -2
  8. package/lib/common/actions/global-action-provider.js.map +1 -1
  9. package/lib/common/command/command.js +1 -2
  10. package/lib/common/command/command.js.map +1 -1
  11. package/lib/common/command/recording-command.js +3 -6
  12. package/lib/common/command/recording-command.js.map +1 -1
  13. package/lib/common/di/diagram-module.js +5 -6
  14. package/lib/common/di/diagram-module.js.map +1 -1
  15. package/lib/common/di/glsp-module.js +1 -1
  16. package/lib/common/di/glsp-module.js.map +1 -1
  17. package/lib/common/di/server-module.js +1 -1
  18. package/lib/common/di/server-module.js.map +1 -1
  19. package/lib/common/features/directediting/context-edit-validator.js +3 -3
  20. package/lib/common/features/directediting/context-edit-validator.js.map +1 -1
  21. package/lib/common/features/directediting/label-edit-validator.js +1 -1
  22. package/lib/common/features/directediting/label-edit-validator.js.map +1 -1
  23. package/lib/common/features/layout/computed-bounds-action-handler.d.ts +16 -1
  24. package/lib/common/features/layout/computed-bounds-action-handler.d.ts.map +1 -1
  25. package/lib/common/features/layout/computed-bounds-action-handler.js +41 -4
  26. package/lib/common/features/layout/computed-bounds-action-handler.js.map +1 -1
  27. package/lib/common/features/layout/layout-operation-handler.js +1 -2
  28. package/lib/common/features/layout/layout-operation-handler.js.map +1 -1
  29. package/lib/common/features/model/gmodel-index.js +3 -5
  30. package/lib/common/features/model/gmodel-index.js.map +1 -1
  31. package/lib/common/features/model/gmodel-serializer.js +1 -2
  32. package/lib/common/features/model/gmodel-serializer.js.map +1 -1
  33. package/lib/common/features/model/model-submission-handler.d.ts +1 -2
  34. package/lib/common/features/model/model-submission-handler.d.ts.map +1 -1
  35. package/lib/common/features/model/model-submission-handler.js +3 -6
  36. package/lib/common/features/model/model-submission-handler.js.map +1 -1
  37. package/lib/common/features/model/request-model-action-handler.js +4 -6
  38. package/lib/common/features/model/request-model-action-handler.js.map +1 -1
  39. package/lib/common/features/navigation/navigation-target-resolution.js +1 -1
  40. package/lib/common/features/navigation/navigation-target-resolution.js.map +1 -1
  41. package/lib/common/features/progress/progress-service.d.ts.map +1 -1
  42. package/lib/common/features/progress/progress-service.js +1 -2
  43. package/lib/common/features/progress/progress-service.js.map +1 -1
  44. package/lib/common/features/validation/request-markers-handler.js +1 -2
  45. package/lib/common/features/validation/request-markers-handler.js.map +1 -1
  46. package/lib/common/gmodel/change-routing-points-operation-handler.js +1 -2
  47. package/lib/common/gmodel/change-routing-points-operation-handler.js.map +1 -1
  48. package/lib/common/gmodel/gmodel-create-node-operation-handler.js +3 -5
  49. package/lib/common/gmodel/gmodel-create-node-operation-handler.js.map +1 -1
  50. package/lib/common/gmodel/paste-operation-handler.d.ts +1 -1
  51. package/lib/common/gmodel/paste-operation-handler.d.ts.map +1 -1
  52. package/lib/common/gmodel/paste-operation-handler.js +8 -11
  53. package/lib/common/gmodel/paste-operation-handler.js.map +1 -1
  54. package/lib/common/launch/glsp-server-launcher.d.ts +8 -1
  55. package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
  56. package/lib/common/launch/glsp-server-launcher.js +11 -1
  57. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  58. package/lib/common/launch/jsonrpc-server-launcher.d.ts +51 -2
  59. package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -1
  60. package/lib/common/launch/jsonrpc-server-launcher.js +82 -3
  61. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -1
  62. package/lib/common/operations/compound-operation-handler.js +1 -1
  63. package/lib/common/operations/compound-operation-handler.js.map +1 -1
  64. package/lib/common/operations/json-operation-handler.js +2 -3
  65. package/lib/common/operations/json-operation-handler.js.map +1 -1
  66. package/lib/common/protocol/glsp-server.js +6 -7
  67. package/lib/common/protocol/glsp-server.js.map +1 -1
  68. package/lib/common/session/client-session-manager.js +3 -5
  69. package/lib/common/session/client-session-manager.js.map +1 -1
  70. package/lib/common/utils/action-queue.js +2 -4
  71. package/lib/common/utils/action-queue.js.map +1 -1
  72. package/lib/common/utils/client-options-util.js +2 -2
  73. package/lib/common/utils/client-options-util.js.map +1 -1
  74. package/lib/common/utils/glsp-server-error.d.ts +2 -3
  75. package/lib/common/utils/glsp-server-error.d.ts.map +1 -1
  76. package/lib/common/utils/glsp-server-error.js +1 -1
  77. package/lib/common/utils/glsp-server-error.js.map +1 -1
  78. package/lib/common/utils/layout-util.d.ts +5 -5
  79. package/lib/common/utils/layout-util.d.ts.map +1 -1
  80. package/lib/common/utils/layout-util.js +17 -19
  81. package/lib/common/utils/layout-util.js.map +1 -1
  82. package/lib/common/utils/logger.js +1 -2
  83. package/lib/common/utils/logger.js.map +1 -1
  84. package/lib/node/abstract-json-model-storage.js +2 -4
  85. package/lib/node/abstract-json-model-storage.js.map +1 -1
  86. package/lib/node/launch/socket-server-launcher.d.ts +39 -2
  87. package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
  88. package/lib/node/launch/socket-server-launcher.js +50 -31
  89. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  90. package/lib/node/launch/websocket-server-launcher.d.ts +36 -5
  91. package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
  92. package/lib/node/launch/websocket-server-launcher.js +54 -13
  93. package/lib/node/launch/websocket-server-launcher.js.map +1 -1
  94. package/package.json +17 -21
  95. package/src/common/features/directediting/context-edit-validator.ts +2 -2
  96. package/src/common/features/layout/computed-bounds-action-handler.ts +52 -4
  97. package/src/common/features/model/model-submission-handler.ts +3 -2
  98. package/src/common/features/progress/progress-service.ts +2 -3
  99. package/src/common/gmodel/paste-operation-handler.ts +6 -6
  100. package/src/common/launch/glsp-server-launcher.ts +12 -1
  101. package/src/common/launch/jsonrpc-server-launcher.ts +89 -2
  102. package/src/common/utils/glsp-server-error.ts +3 -5
  103. package/src/common/utils/layout-util.ts +13 -12
  104. package/src/node/launch/socket-server-launcher.ts +54 -31
  105. package/src/node/launch/websocket-server-launcher.ts +72 -14
  106. package/src/browser/di/browser-action-dispatch-scope.spec.ts +0 -75
  107. package/src/common/actions/action-handler-registry.spec.ts +0 -52
  108. package/src/common/actions/global-action-provider.spec.ts +0 -68
  109. package/src/common/command/command-stack.spec.ts +0 -239
  110. package/src/common/command/command.spec.ts +0 -92
  111. package/src/common/command/recording-command.spec.ts +0 -86
  112. package/src/common/di/binding-target.spec.ts +0 -147
  113. package/src/common/di/multi-bindings.spec.ts +0 -133
  114. package/src/common/features/contextactions/context-actions-provider-registry.spec.ts +0 -69
  115. package/src/common/features/contextactions/request-context-actions-handler.spec.ts +0 -75
  116. package/src/common/features/contextactions/tool-palette-item-provider.spec.ts +0 -46
  117. package/src/common/features/directediting/context-edit-validator-registry.spec.ts +0 -54
  118. package/src/common/features/directediting/request-edit-validation-handler.spec.ts +0 -131
  119. package/src/common/features/model/gmodel-serializer.spec.ts +0 -141
  120. package/src/common/features/type-hints/request-type-hints-action-handler.spec.ts +0 -59
  121. package/src/common/operations/operation-handler-registry.spec.ts +0 -50
  122. package/src/common/protocol/glsp-server.spec.ts +0 -154
  123. package/src/common/session/client-session-factory.spec.ts +0 -60
  124. package/src/common/session/client-session-manager.spec.ts +0 -83
  125. package/src/common/test/mock-util.ts +0 -281
  126. package/src/common/utils/action-queue.spec.ts +0 -133
  127. package/src/common/utils/promise-queue.spec.ts +0 -142
  128. package/src/common/utils/registry.spec.ts +0 -225
  129. package/src/node/actions/action-dispatcher.spec.ts +0 -678
  130. package/src/node/launch/cli-parser.spec.ts +0 -61
  131. package/src/node/launch/socket-cli-parser.spec.ts +0 -73
  132. package/src/node/launch/socket-server-launcher.spec.ts +0 -74
@@ -1,61 +0,0 @@
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 { expect } from 'chai';
17
- import * as path from 'path';
18
- import { LogLevel } from '../../common/utils/logger';
19
- import { createCliParser, defaultLaunchOptions } from './cli-parser';
20
-
21
- describe('test createCliParser', () => {
22
- const parser = createCliParser();
23
-
24
- parser.command.exitOverride();
25
- const argv = ['/usr/bin/node', 'test'];
26
-
27
- it('parse - no args', () => {
28
- const options = parser.parse(argv);
29
- expect(options).to.deep.equal(defaultLaunchOptions);
30
- });
31
-
32
- it('parse - invalid log dir', () => {
33
- expect(() => parser.parse([...argv, '--logDir', 'invalid.Path'])).to.throw();
34
- });
35
-
36
- it('parse - valid log dir', () => {
37
- const logDir = path.resolve('../customLog');
38
- const result = parser.parse([...argv, '--logDir', '../customLog/']);
39
- expect(result.logDir, logDir);
40
- });
41
-
42
- it('parse - invalid logLevel', () => {
43
- expect(() => parser.parse([...argv, '--logLevel', 'someRandomLevel'])).to.throw();
44
- });
45
-
46
- it('parse - valid logLevel', () => {
47
- const result = parser.parse([...argv, '--logLevel', 'error']);
48
- expect(result.logLevel).to.be.equal(LogLevel.error);
49
- });
50
-
51
- it('parse- no args with custom default options', () => {
52
- const options = {
53
- logDir: '.myLogDir',
54
- logLevel: LogLevel.debug,
55
- consoleLog: false,
56
- fileLog: true
57
- };
58
- const result = createCliParser(options).parse(argv);
59
- expect(result).to.deep.equal(options);
60
- });
61
- });
@@ -1,73 +0,0 @@
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 { expect } from 'chai';
17
- import { LogLevel } from '../../common/utils/logger';
18
- import { createSocketCliParser, defaultSocketLaunchOptions, SocketLaunchOptions } from './socket-cli-parser';
19
-
20
- describe('test createCliParser', () => {
21
- const parser = createSocketCliParser();
22
-
23
- parser.command.exitOverride();
24
- const argv = ['/usr/bin/node', 'test'];
25
-
26
- it('parse - no args', () => {
27
- const options = parser.parse(argv);
28
- expect(options).to.deep.equal(defaultSocketLaunchOptions);
29
- });
30
-
31
- it('parse - invalid port (below lower range)', () => {
32
- expect(() => parser.parse([...argv, '--port', '-1'])).to.throw();
33
- });
34
-
35
- it('parse - invalid port (below upper range)', () => {
36
- expect(() => parser.parse([...argv, '--port', '65536'])).to.throw();
37
- });
38
-
39
- it('parse - valid port', () => {
40
- const port = 3000;
41
- const result = parser.parse([...argv, '--port', '3000']);
42
- expect(result.port).to.equal(port);
43
- });
44
-
45
- it('parse - --no-consoleLog', () => {
46
- const result = parser.parse([...argv, '--no-consoleLog']);
47
- expect(result.consoleLog).false;
48
- });
49
-
50
- it('parse - --fileLog', () => {
51
- const result = parser.parse([...argv, '--fileLog']);
52
- expect(result.fileLog).true;
53
- });
54
-
55
- it('parse - custom host name', () => {
56
- const host = 'docker.internal';
57
- const result = parser.parse([...argv, '--host', host]);
58
- expect(result.host, host);
59
- });
60
-
61
- it('parse- no args with custom default options', () => {
62
- const options: SocketLaunchOptions = {
63
- logDir: '.myLogDir',
64
- logLevel: LogLevel.debug,
65
- consoleLog: true,
66
- fileLog: true,
67
- host: 'myHost',
68
- port: 3000
69
- };
70
- const result = createSocketCliParser(options).parse(argv);
71
- expect(result).to.deep.equal(options);
72
- });
73
- });
@@ -1,74 +0,0 @@
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
-
17
- import { GLSPServer } from '@eclipse-glsp/protocol';
18
- import { expect } from 'chai';
19
- import { Container } from 'inversify';
20
- import * as net from 'net';
21
- import * as sinon from 'sinon';
22
- import { DefaultGLSPServer } from '../../common/protocol/glsp-server';
23
- import { createAppModule } from '../di/app-module';
24
- import { defaultSocketLaunchOptions } from './socket-cli-parser';
25
- import { SocketServerLauncher } from './socket-server-launcher';
26
- const severPort = 5008;
27
- describe('test SocketServerLauncher', () => {
28
- it('starts and stops', async () => {
29
- const appContainer = new Container();
30
- const serverStub = sinon.createStubInstance(DefaultGLSPServer);
31
- appContainer.load(createAppModule(defaultSocketLaunchOptions));
32
-
33
- appContainer.bind(GLSPServer).toConstantValue(serverStub);
34
- const launcher = appContainer.resolve(SocketServerLauncher);
35
- launcher.start({ port: severPort });
36
- const sockStart = new net.Socket();
37
- sockStart.setTimeout(100);
38
- const startPromise = new Promise(res => {
39
- sockStart
40
- .on('connect', () => {
41
- expect(true);
42
- sockStart.destroy();
43
- res(true);
44
- })
45
- .on('error', e => {
46
- expect.fail('Server is not reachable: ' + e.message);
47
- })
48
- .on('timeout', () => {
49
- expect.fail('Connection time outed.');
50
- })
51
- .connect(severPort);
52
- });
53
- await startPromise;
54
- launcher.shutdown();
55
- const sockStop = new net.Socket();
56
- sockStop.setTimeout(100);
57
- const stopPromise = new Promise(res => {
58
- sockStop
59
- .on('connect', () => {
60
- expect.fail('Server still reachable.');
61
- })
62
- .on('error', () => {
63
- expect(true);
64
- sockStop.destroy();
65
- res(true);
66
- })
67
- .on('timeout', () => {
68
- expect.fail('Connection time outed.');
69
- })
70
- .connect(severPort);
71
- });
72
- await stopPromise;
73
- });
74
- });