@eclipse-glsp/server 1.1.0-RC07 → 1.1.0-RC08

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 (131) hide show
  1. package/lib/browser/di/app-module.d.ts +2 -7
  2. package/lib/browser/di/app-module.d.ts.map +1 -1
  3. package/lib/browser/di/app-module.js +5 -30
  4. package/lib/browser/di/app-module.js.map +1 -1
  5. package/lib/browser/index.d.ts +0 -1
  6. package/lib/browser/index.d.ts.map +1 -1
  7. package/lib/browser/index.js +0 -1
  8. package/lib/browser/index.js.map +1 -1
  9. package/lib/browser/launch/worker-server-launcher.d.ts +4 -4
  10. package/lib/browser/launch/worker-server-launcher.d.ts.map +1 -1
  11. package/lib/browser/launch/worker-server-launcher.js +5 -11
  12. package/lib/browser/launch/worker-server-launcher.js.map +1 -1
  13. package/lib/common/actions/client-action-handler.d.ts +1 -2
  14. package/lib/common/actions/client-action-handler.d.ts.map +1 -1
  15. package/lib/common/actions/client-action-handler.js +17 -2
  16. package/lib/common/actions/client-action-handler.js.map +1 -1
  17. package/lib/common/command/command-stack.d.ts +16 -1
  18. package/lib/common/command/command-stack.d.ts.map +1 -1
  19. package/lib/common/command/command-stack.js +0 -15
  20. package/lib/common/command/command-stack.js.map +1 -1
  21. package/lib/common/di/client-session-module.d.ts +1 -1
  22. package/lib/common/di/client-session-module.d.ts.map +1 -1
  23. package/lib/common/di/client-session-module.js +2 -2
  24. package/lib/common/di/client-session-module.js.map +1 -1
  25. package/lib/common/di/glsp-module.d.ts +3 -1
  26. package/lib/common/di/glsp-module.d.ts.map +1 -1
  27. package/lib/common/di/glsp-module.js +0 -15
  28. package/lib/common/di/glsp-module.js.map +1 -1
  29. package/lib/common/di/multi-binding.d.ts +19 -4
  30. package/lib/common/di/multi-binding.d.ts.map +1 -1
  31. package/lib/common/di/multi-binding.js.map +1 -1
  32. package/lib/common/di/server-module.d.ts +1 -6
  33. package/lib/common/di/server-module.d.ts.map +1 -1
  34. package/lib/common/di/server-module.js +21 -17
  35. package/lib/common/di/server-module.js.map +1 -1
  36. package/lib/common/index.d.ts +1 -2
  37. package/lib/common/index.d.ts.map +1 -1
  38. package/lib/common/index.js +1 -2
  39. package/lib/common/index.js.map +1 -1
  40. package/lib/common/launch/glsp-server-launcher.d.ts +1 -1
  41. package/lib/common/launch/glsp-server-launcher.d.ts.map +1 -1
  42. package/lib/common/launch/glsp-server-launcher.js +2 -2
  43. package/lib/common/launch/glsp-server-launcher.js.map +1 -1
  44. package/lib/common/launch/jsonrpc-server-launcher.d.ts +38 -0
  45. package/lib/common/launch/jsonrpc-server-launcher.d.ts.map +1 -0
  46. package/lib/common/launch/jsonrpc-server-launcher.js +84 -0
  47. package/lib/common/launch/jsonrpc-server-launcher.js.map +1 -0
  48. package/lib/common/protocol/glsp-server.d.ts +4 -104
  49. package/lib/common/protocol/glsp-server.d.ts.map +1 -1
  50. package/lib/common/protocol/glsp-server.js +13 -20
  51. package/lib/common/protocol/glsp-server.js.map +1 -1
  52. package/lib/common/protocol/glsp-server.spec.js +18 -5
  53. package/lib/common/protocol/glsp-server.spec.js.map +1 -1
  54. package/lib/common/session/client-session-factory.d.ts +1 -2
  55. package/lib/common/session/client-session-factory.d.ts.map +1 -1
  56. package/lib/common/session/client-session-factory.js +17 -2
  57. package/lib/common/session/client-session-factory.js.map +1 -1
  58. package/lib/common/session/client-session-factory.spec.js +2 -2
  59. package/lib/common/session/client-session-factory.spec.js.map +1 -1
  60. package/lib/common/session/client-session-manager.d.ts +1 -3
  61. package/lib/common/session/client-session-manager.d.ts.map +1 -1
  62. package/lib/common/session/client-session-manager.js.map +1 -1
  63. package/lib/common/test/mock-util.d.ts +3 -6
  64. package/lib/common/test/mock-util.d.ts.map +1 -1
  65. package/lib/common/test/mock-util.js.map +1 -1
  66. package/lib/{browser/di → common/utils}/console-logger.d.ts +7 -1
  67. package/lib/common/utils/console-logger.d.ts.map +1 -0
  68. package/lib/{browser/di → common/utils}/console-logger.js +26 -8
  69. package/lib/common/utils/console-logger.js.map +1 -0
  70. package/lib/common/utils/logger.d.ts +21 -0
  71. package/lib/common/utils/logger.d.ts.map +1 -1
  72. package/lib/common/utils/logger.js +12 -1
  73. package/lib/common/utils/logger.js.map +1 -1
  74. package/lib/node/di/app-module.d.ts +2 -2
  75. package/lib/node/di/app-module.d.ts.map +1 -1
  76. package/lib/node/di/app-module.js +10 -35
  77. package/lib/node/di/app-module.js.map +1 -1
  78. package/lib/node/launch/cli-parser.d.ts +2 -3
  79. package/lib/node/launch/cli-parser.d.ts.map +1 -1
  80. package/lib/node/launch/cli-parser.js.map +1 -1
  81. package/lib/node/launch/socket-cli-parser.js +1 -1
  82. package/lib/node/launch/socket-cli-parser.js.map +1 -1
  83. package/lib/node/launch/socket-server-launcher.d.ts +2 -23
  84. package/lib/node/launch/socket-server-launcher.d.ts.map +1 -1
  85. package/lib/node/launch/socket-server-launcher.js +8 -28
  86. package/lib/node/launch/socket-server-launcher.js.map +1 -1
  87. package/lib/node/launch/socket-server-launcher.spec.js +5 -0
  88. package/lib/node/launch/socket-server-launcher.spec.js.map +1 -1
  89. package/lib/node/launch/websocket-server-launcher.d.ts +2 -8
  90. package/lib/node/launch/websocket-server-launcher.d.ts.map +1 -1
  91. package/lib/node/launch/websocket-server-launcher.js +4 -28
  92. package/lib/node/launch/websocket-server-launcher.js.map +1 -1
  93. package/package.json +4 -4
  94. package/src/browser/di/app-module.ts +4 -32
  95. package/src/browser/index.ts +0 -1
  96. package/src/browser/launch/worker-server-launcher.ts +7 -13
  97. package/src/common/actions/client-action-handler.ts +1 -2
  98. package/src/common/command/command-stack.ts +1 -1
  99. package/src/common/di/client-session-module.ts +1 -1
  100. package/src/common/di/glsp-module.ts +3 -1
  101. package/src/common/di/multi-binding.ts +4 -5
  102. package/src/common/di/server-module.ts +6 -21
  103. package/src/common/index.ts +1 -2
  104. package/src/common/launch/glsp-server-launcher.ts +2 -2
  105. package/src/common/launch/jsonrpc-server-launcher.ts +95 -0
  106. package/src/common/protocol/glsp-server.spec.ts +7 -4
  107. package/src/common/protocol/glsp-server.ts +17 -132
  108. package/src/common/session/client-session-factory.spec.ts +1 -1
  109. package/src/common/session/client-session-factory.ts +1 -2
  110. package/src/common/session/client-session-manager.ts +1 -3
  111. package/src/common/test/mock-util.ts +5 -5
  112. package/src/{browser/di → common/utils}/console-logger.ts +19 -1
  113. package/src/common/utils/logger.ts +16 -1
  114. package/src/node/di/app-module.ts +4 -13
  115. package/src/node/launch/cli-parser.ts +2 -3
  116. package/src/node/launch/socket-cli-parser.ts +1 -1
  117. package/src/node/launch/socket-server-launcher.spec.ts +6 -0
  118. package/src/node/launch/socket-server-launcher.ts +8 -30
  119. package/src/node/launch/websocket-server-launcher.ts +5 -31
  120. package/lib/browser/di/console-logger.d.ts.map +0 -1
  121. package/lib/browser/di/console-logger.js.map +0 -1
  122. package/lib/common/protocol/glsp-client-proxy.d.ts +0 -45
  123. package/lib/common/protocol/glsp-client-proxy.d.ts.map +0 -1
  124. package/lib/common/protocol/glsp-client-proxy.js +0 -53
  125. package/lib/common/protocol/glsp-client-proxy.js.map +0 -1
  126. package/lib/common/protocol/glsp-server-listener.d.ts +0 -37
  127. package/lib/common/protocol/glsp-server-listener.d.ts.map +0 -1
  128. package/lib/common/protocol/glsp-server-listener.js +0 -5
  129. package/lib/common/protocol/glsp-server-listener.js.map +0 -1
  130. package/src/common/protocol/glsp-client-proxy.ts +0 -65
  131. package/src/common/protocol/glsp-server-listener.ts +0 -39
@@ -16,14 +16,12 @@
16
16
 
17
17
  import { createWebSocketConnection, Disposable, MaybePromise, WebSocketWrapper } from '@eclipse-glsp/protocol';
18
18
  import * as http from 'http';
19
- import { Container, inject, injectable } from 'inversify';
19
+ import { inject, injectable } from 'inversify';
20
20
  import * as net from 'net';
21
21
  import * as jsonrpc from 'vscode-jsonrpc';
22
22
  import { Server, WebSocket } from 'ws';
23
- import { GLSPServerLauncher } from '../../common/launch/glsp-server-launcher';
24
- import { GLSPServer, JsonRpcGLSPServer } from '../../common/protocol/glsp-server';
23
+ import { JsonRpcGLSPServerLauncher } from '../../common/launch/jsonrpc-server-launcher';
25
24
  import { Logger } from '../../common/utils/logger';
26
- import { START_UP_COMPLETE_MSG } from './socket-server-launcher';
27
25
 
28
26
  export interface WebSocketServerOptions {
29
27
  host?: string;
@@ -46,19 +44,16 @@ export interface WebsocketConnectionData {
46
44
  const STATUS_UPGRADE_REQUIRED = 426;
47
45
 
48
46
  @injectable()
49
- export class WebSocketServerLauncher extends GLSPServerLauncher<WebSocketServerOptions> {
47
+ export class WebSocketServerLauncher extends JsonRpcGLSPServerLauncher<WebSocketServerOptions> {
50
48
  @inject(Logger)
51
49
  protected override logger: Logger;
52
50
 
53
51
  protected server: Server;
54
- protected startupCompleteMessage = START_UP_COMPLETE_MSG;
55
- protected currentConnections: jsonrpc.MessageConnection[] = [];
56
52
 
57
53
  constructor() {
58
54
  super();
59
55
  this.toDispose.push(
60
56
  Disposable.create(() => {
61
- this.currentConnections.forEach(connection => connection.dispose());
62
57
  this.server.close();
63
58
  })
64
59
  );
@@ -72,7 +67,8 @@ export class WebSocketServerLauncher extends GLSPServerLauncher<WebSocketServerO
72
67
  console.log(this.startupCompleteMessage.concat(resolvedOptions.port.toString()));
73
68
 
74
69
  this.server.on('connection', (ws, req) => {
75
- this.createClientConnection(ws);
70
+ const connection = this.createConnection(ws);
71
+ this.createServerInstance(connection);
76
72
  });
77
73
 
78
74
  return new Promise((resolve, reject) => {
@@ -81,28 +77,6 @@ export class WebSocketServerLauncher extends GLSPServerLauncher<WebSocketServerO
81
77
  });
82
78
  }
83
79
 
84
- protected async createClientConnection(socket: WebSocket): Promise<void> {
85
- const container = this.createContainer();
86
- const connection = this.createConnection(socket);
87
- this.currentConnections.push(connection);
88
- const glspServer = container.get<JsonRpcGLSPServer>(JsonRpcGLSPServer);
89
- glspServer.connect(connection);
90
- this.logger.info('Starting GLSP server connection');
91
- connection.listen();
92
- connection.onDispose(() => this.disposeClientConnection(container, glspServer));
93
- socket.on('close', () => this.disposeClientConnection(container, glspServer));
94
- connection.onClose(() => console.log('GOD dam'));
95
- return new Promise((resolve, rejects) => {
96
- connection.onClose(() => resolve(undefined));
97
- connection.onError(error => rejects(error));
98
- });
99
- }
100
-
101
- protected disposeClientConnection(container: Container, glspServer: GLSPServer): void {
102
- glspServer.shutdown();
103
- container.unbindAll();
104
- }
105
-
106
80
  protected createConnection(socket: WebSocket): jsonrpc.MessageConnection {
107
81
  return createWebSocketConnection(wrapWebSocket(socket));
108
82
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-logger.d.ts","sourceRoot":"","sources":["../../../src/browser/di/console-logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAGlF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBACa,aAAc,SAAQ,MAAM;IAClB,QAAQ,EAAE,QAAQ;IAAyB,MAAM,CAAC;gBAAlD,QAAQ,GAAE,QAAwB,EAAS,MAAM,CAAC,oBAAQ;IAI7E,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM7C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM9C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI;IAM9C,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM;IAOrD,cAAc,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM;IAOxC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM;CAOpC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"console-logger.js","sourceRoot":"","sources":["../../../src/browser/di/console-logger.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;;;;;;;;;;AAElF,yCAAuC;AACvC,8CAAsD;AAG/C,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,cAAM;IACrC,YAAmB,WAAqB,gBAAQ,CAAC,IAAI,EAAS,MAAe;QACzE,KAAK,EAAE,CAAC;QADO,aAAQ,GAAR,QAAQ,CAA0B;QAAS,WAAM,GAAN,MAAM,CAAS;IAE7E,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,MAAa;QAClC,IAAI,gBAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;YAChC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SAClD;IACL,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,MAAa;QAClC,IAAI,gBAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;YAChC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SAClD;IACL,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QACnC,IAAI,gBAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SACnD;IACL,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,MAAa;QACnC,IAAI,gBAAQ,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;SACnD;IACL,CAAC;IAED,UAAU,CAAC,OAAe,EAAE,GAAG,MAAa;QACxC,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAC;QAClD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,MAAM,CAAC,CAAC;QAClD,OAAO,GAAG,SAAS,IAAI,IAAI,CAAC,QAAQ,MAAM,MAAM,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;IAChF,CAAC;IAED,cAAc,CAAC,GAAG,MAAa;QAC3B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YAChC,OAAO,EAAE,CAAC;SACb;QACD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;IAED,SAAS,CAAC,KAAc;QACpB,IAAI,KAAK,YAAY,KAAK,EAAE;YACxB,OAAO,GAAG,KAAK,CAAC,OAAO;cACrB,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;SACzB;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;CACJ,CAAA;AAlDY,aAAa;IADzB,IAAA,sBAAU,GAAE;;GACA,aAAa,CAkDzB;AAlDY,sCAAa"}
@@ -1,45 +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 { ActionMessage } from '@eclipse-glsp/protocol';
17
- import * as jsonrpc from 'vscode-jsonrpc';
18
- export declare const GLSPClientProxyFactory: unique symbol;
19
- export type GLSPClientProxyFactory = (connection: jsonrpc.MessageConnection) => GLSPClientProxy;
20
- export declare const GLSPClientProxy: unique symbol;
21
- /**
22
- * Json-rpc client proxy interface to hide the underlying json-rpc logic.
23
- */
24
- export interface GLSPClientProxy {
25
- /**
26
- * A `process` notification is sent from the server to server to the client when the client should handle i.e.
27
- * process a specific {@link ActionMessage}. Any communication that is performed between initialization and shutdown
28
- * is handled by sending action messages, either from the client to the server or from the server to the client. This
29
- * is the core part of the Graphical Language Server Protocol.
30
- *
31
- * @param message The {@link ActionMessage} that should be processed.
32
- */
33
- process(message: ActionMessage): void;
34
- }
35
- export declare const JsonRpcGLSPClientProxy: unique symbol;
36
- export interface JsonRpcGLSPClientProxy extends GLSPClientProxy {
37
- connect(connection: jsonrpc.MessageConnection): void;
38
- }
39
- export declare class DefaultGLSPClientProxy implements JsonRpcGLSPClientProxy {
40
- private logger;
41
- protected connection: jsonrpc.MessageConnection;
42
- connect(connection: jsonrpc.MessageConnection): void;
43
- process(message: ActionMessage): void;
44
- }
45
- //# sourceMappingURL=glsp-client-proxy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glsp-client-proxy.d.ts","sourceRoot":"","sources":["../../../src/common/protocol/glsp-client-proxy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAC;AAE1E,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAG1C,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE,MAAM,MAAM,sBAAsB,GAAG,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,KAAK,eAAe,CAAC;AAEhG,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC3D,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;CACxD;AAED,qBACa,sBAAuB,YAAW,sBAAsB;IAEjE,OAAO,CAAC,MAAM,CAAS;IAEvB,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAEhD,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,iBAAiB,GAAG,IAAI;IAMpD,OAAO,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;CAIxC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.DefaultGLSPClientProxy = exports.JsonRpcGLSPClientProxy = exports.GLSPClientProxy = exports.GLSPClientProxyFactory = void 0;
13
- /********************************************************************************
14
- * Copyright (c) 2022-2023 STMicroelectronics and others.
15
- *
16
- * This program and the accompanying materials are made available under the
17
- * terms of the Eclipse Public License v. 2.0 which is available at
18
- * http://www.eclipse.org/legal/epl-2.0.
19
- *
20
- * This Source Code may also be made available under the following Secondary
21
- * Licenses when the conditions for such availability set forth in the Eclipse
22
- * Public License v. 2.0 are satisfied: GNU General Public License, version 2
23
- * with the GNU Classpath Exception which is available at
24
- * https://www.gnu.org/software/classpath/license.html.
25
- *
26
- * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
27
- ********************************************************************************/
28
- const protocol_1 = require("@eclipse-glsp/protocol");
29
- const inversify_1 = require("inversify");
30
- const logger_1 = require("../utils/logger");
31
- exports.GLSPClientProxyFactory = Symbol('GLSPClientProxyFactory');
32
- exports.GLSPClientProxy = Symbol('GLSPClientProxy');
33
- exports.JsonRpcGLSPClientProxy = Symbol('JsonRpcGLSPClientProxy');
34
- let DefaultGLSPClientProxy = class DefaultGLSPClientProxy {
35
- connect(connection) {
36
- if (!this.connection) {
37
- this.connection = connection;
38
- }
39
- }
40
- process(message) {
41
- this.logger.debug(`Send action '${message.action.kind}' to client '${message.clientId}'`);
42
- this.connection.sendNotification(protocol_1.JsonrpcGLSPClient.ActionMessageNotification, message);
43
- }
44
- };
45
- __decorate([
46
- (0, inversify_1.inject)(logger_1.Logger),
47
- __metadata("design:type", logger_1.Logger)
48
- ], DefaultGLSPClientProxy.prototype, "logger", void 0);
49
- DefaultGLSPClientProxy = __decorate([
50
- (0, inversify_1.injectable)()
51
- ], DefaultGLSPClientProxy);
52
- exports.DefaultGLSPClientProxy = DefaultGLSPClientProxy;
53
- //# sourceMappingURL=glsp-client-proxy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glsp-client-proxy.js","sourceRoot":"","sources":["../../../src/common/protocol/glsp-client-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,qDAA0E;AAC1E,yCAA+C;AAE/C,4CAAyC;AAE5B,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAI1D,QAAA,eAAe,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAiB5C,QAAA,sBAAsB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAOhE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAM/B,OAAO,CAAC,UAAqC;QACzC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;SAChC;IACL,CAAC;IAED,OAAO,CAAC,OAAsB;QAC1B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,OAAO,CAAC,MAAM,CAAC,IAAI,gBAAgB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC1F,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,4BAAiB,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC3F,CAAC;CACJ,CAAA;AAfG;IAAC,IAAA,kBAAM,EAAC,eAAM,CAAC;8BACC,eAAM;sDAAC;AAFd,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAgBlC;AAhBY,wDAAsB"}
@@ -1,37 +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 { GLSPServer } from './glsp-server';
17
- export declare const GLSPServerListener: unique symbol;
18
- /**
19
- * A listener to track the connection status of {@link GLSPClient}s (i.e. client applications).
20
- * Gets notified when a new GLSP client connects or disconnects.
21
- */
22
- export interface GLSPServerListener {
23
- /**
24
- * Triggered after a GLSPServer has been initialized via the {@link GLSPServer.initialize()}
25
- * method.
26
- *
27
- * @param server The GLSPServer which has been initialized.
28
- */
29
- serverInitialized?(server: GLSPServer): void;
30
- /**
31
- * Triggered after the {@link GLSPServer.shutdown()} method has been invoked.
32
- *
33
- * @param glspServer The glspServer which has been shut down.
34
- */
35
- serverShutDown?(server: GLSPServer): void;
36
- }
37
- //# sourceMappingURL=glsp-server-listener.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glsp-server-listener.d.ts","sourceRoot":"","sources":["../../../src/common/protocol/glsp-server-listener.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;;;;OAKG;IACH,iBAAiB,CAAC,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAE7C;;;;OAIG;IACH,cAAc,CAAC,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;CAC7C"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GLSPServerListener = void 0;
4
- exports.GLSPServerListener = Symbol('GLSPServerListener');
5
- //# sourceMappingURL=glsp-server-listener.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"glsp-server-listener.js","sourceRoot":"","sources":["../../../src/common/protocol/glsp-server-listener.ts"],"names":[],"mappings":";;;AAiBa,QAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,65 +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 { ActionMessage, JsonrpcGLSPClient } from '@eclipse-glsp/protocol';
17
- import { inject, injectable } from 'inversify';
18
- import * as jsonrpc from 'vscode-jsonrpc';
19
- import { Logger } from '../utils/logger';
20
-
21
- export const GLSPClientProxyFactory = Symbol('GLSPClientProxyFactory');
22
-
23
- export type GLSPClientProxyFactory = (connection: jsonrpc.MessageConnection) => GLSPClientProxy;
24
-
25
- export const GLSPClientProxy = Symbol('GLSPClientProxy');
26
-
27
- /**
28
- * Json-rpc client proxy interface to hide the underlying json-rpc logic.
29
- */
30
- export interface GLSPClientProxy {
31
- /**
32
- * A `process` notification is sent from the server to server to the client when the client should handle i.e.
33
- * process a specific {@link ActionMessage}. Any communication that is performed between initialization and shutdown
34
- * is handled by sending action messages, either from the client to the server or from the server to the client. This
35
- * is the core part of the Graphical Language Server Protocol.
36
- *
37
- * @param message The {@link ActionMessage} that should be processed.
38
- */
39
- process(message: ActionMessage): void;
40
- }
41
-
42
- export const JsonRpcGLSPClientProxy = Symbol('JsonRpcGLSPClientProxy');
43
-
44
- export interface JsonRpcGLSPClientProxy extends GLSPClientProxy {
45
- connect(connection: jsonrpc.MessageConnection): void;
46
- }
47
-
48
- @injectable()
49
- export class DefaultGLSPClientProxy implements JsonRpcGLSPClientProxy {
50
- @inject(Logger)
51
- private logger: Logger;
52
-
53
- protected connection: jsonrpc.MessageConnection;
54
-
55
- connect(connection: jsonrpc.MessageConnection): void {
56
- if (!this.connection) {
57
- this.connection = connection;
58
- }
59
- }
60
-
61
- process(message: ActionMessage): void {
62
- this.logger.debug(`Send action '${message.action.kind}' to client '${message.clientId}'`);
63
- this.connection.sendNotification(JsonrpcGLSPClient.ActionMessageNotification, message);
64
- }
65
- }
@@ -1,39 +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 { GLSPServer } from './glsp-server';
17
-
18
- export const GLSPServerListener = Symbol('GLSPServerListener');
19
-
20
- /**
21
- * A listener to track the connection status of {@link GLSPClient}s (i.e. client applications).
22
- * Gets notified when a new GLSP client connects or disconnects.
23
- */
24
- export interface GLSPServerListener {
25
- /**
26
- * Triggered after a GLSPServer has been initialized via the {@link GLSPServer.initialize()}
27
- * method.
28
- *
29
- * @param server The GLSPServer which has been initialized.
30
- */
31
- serverInitialized?(server: GLSPServer): void;
32
-
33
- /**
34
- * Triggered after the {@link GLSPServer.shutdown()} method has been invoked.
35
- *
36
- * @param glspServer The glspServer which has been shut down.
37
- */
38
- serverShutDown?(server: GLSPServer): void;
39
- }