vscode-languageserver-protocol 3.17.0-next.9

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 (57) hide show
  1. package/License.txt +11 -0
  2. package/README.md +16 -0
  3. package/browser.d.ts +6 -0
  4. package/browser.js +7 -0
  5. package/lib/browser/main.d.ts +4 -0
  6. package/lib/browser/main.js +25 -0
  7. package/lib/common/api.d.ts +94 -0
  8. package/lib/common/api.js +87 -0
  9. package/lib/common/connection.d.ts +163 -0
  10. package/lib/common/connection.js +16 -0
  11. package/lib/common/messages.d.ts +44 -0
  12. package/lib/common/messages.js +39 -0
  13. package/lib/common/proposed.diagnostic.d.ts +324 -0
  14. package/lib/common/proposed.diagnostic.js +72 -0
  15. package/lib/common/proposed.typeHierarchy.d.ts +83 -0
  16. package/lib/common/proposed.typeHierarchy.js +40 -0
  17. package/lib/common/protocol.callHierarchy.d.ts +83 -0
  18. package/lib/common/protocol.callHierarchy.js +40 -0
  19. package/lib/common/protocol.colorProvider.d.ts +63 -0
  20. package/lib/common/protocol.colorProvider.js +30 -0
  21. package/lib/common/protocol.configuration.d.ts +46 -0
  22. package/lib/common/protocol.configuration.js +22 -0
  23. package/lib/common/protocol.d.ts +2750 -0
  24. package/lib/common/protocol.declaration.d.ts +37 -0
  25. package/lib/common/protocol.declaration.js +23 -0
  26. package/lib/common/protocol.fileOperations.d.ts +293 -0
  27. package/lib/common/protocol.fileOperations.js +92 -0
  28. package/lib/common/protocol.foldingRange.d.ts +63 -0
  29. package/lib/common/protocol.foldingRange.js +38 -0
  30. package/lib/common/protocol.implementation.d.ts +38 -0
  31. package/lib/common/protocol.implementation.js +22 -0
  32. package/lib/common/protocol.js +752 -0
  33. package/lib/common/protocol.linkedEditingRange.d.ts +51 -0
  34. package/lib/common/protocol.linkedEditingRange.js +19 -0
  35. package/lib/common/protocol.moniker.d.ts +103 -0
  36. package/lib/common/protocol.moniker.js +68 -0
  37. package/lib/common/protocol.progress.d.ts +117 -0
  38. package/lib/common/protocol.progress.js +34 -0
  39. package/lib/common/protocol.selectionRange.d.ts +40 -0
  40. package/lib/common/protocol.selectionRange.js +20 -0
  41. package/lib/common/protocol.semanticTokens.d.ts +194 -0
  42. package/lib/common/protocol.semanticTokens.js +51 -0
  43. package/lib/common/protocol.showDocument.d.ts +71 -0
  44. package/lib/common/protocol.showDocument.js +22 -0
  45. package/lib/common/protocol.typeDefinition.d.ts +38 -0
  46. package/lib/common/protocol.typeDefinition.js +22 -0
  47. package/lib/common/protocol.workspaceFolders.d.ts +94 -0
  48. package/lib/common/protocol.workspaceFolders.js +24 -0
  49. package/lib/common/utils/is.d.ts +9 -0
  50. package/lib/common/utils/is.js +47 -0
  51. package/lib/node/main.d.ts +6 -0
  52. package/lib/node/main.js +25 -0
  53. package/node.cmd +5 -0
  54. package/node.d.ts +6 -0
  55. package/node.js +7 -0
  56. package/package.json +38 -0
  57. package/thirdpartynotices.txt +31 -0
package/License.txt ADDED
@@ -0,0 +1,11 @@
1
+ Copyright (c) Microsoft Corporation
2
+
3
+ All rights reserved.
4
+
5
+ MIT License
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # VSCode Language Server - Protocol Module
2
+
3
+ [![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageclient)
4
+ [![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageclient)
5
+ [![Build Status](https://travis-ci.org/Microsoft/vscode-languageserver-node.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-languageserver-node)
6
+
7
+ This npm module is a tool independent implementation of the language server protocol and can be used in any type of node application.
8
+
9
+ See [here](https://github.com/Microsoft/language-server-protocol) for a detailed documentation on the language server protocol.
10
+
11
+ ## History
12
+
13
+ For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md)
14
+
15
+ ## License
16
+ [MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt)
package/browser.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ----------------------------------------------------------------------------------------- */
5
+
6
+ export * from './lib/browser/main';
package/browser.js ADDED
@@ -0,0 +1,7 @@
1
+ /* --------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License. See License.txt in the project root for license information.
4
+ * ----------------------------------------------------------------------------------------- */
5
+ 'use strict';
6
+
7
+ module.exports = require('./lib/browser/main');
@@ -0,0 +1,4 @@
1
+ import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api';
2
+ export * from 'vscode-jsonrpc/browser';
3
+ export * from '../common/api';
4
+ export declare function createProtocolConnection(reader: MessageReader, writer: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /* --------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ * ------------------------------------------------------------------------------------------ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.createProtocolConnection = void 0;
18
+ const browser_1 = require("vscode-jsonrpc/browser");
19
+ __exportStar(require("vscode-jsonrpc/browser"), exports);
20
+ __exportStar(require("../common/api"), exports);
21
+ function createProtocolConnection(reader, writer, logger, options) {
22
+ return (0, browser_1.createMessageConnection)(reader, writer, logger, options);
23
+ }
24
+ exports.createProtocolConnection = createProtocolConnection;
25
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1,94 @@
1
+ import type { integer } from 'vscode-languageserver-types';
2
+ export * from 'vscode-jsonrpc';
3
+ export * from 'vscode-languageserver-types';
4
+ export * from './messages';
5
+ export * from './protocol';
6
+ export { ProtocolConnection, createProtocolConnection } from './connection';
7
+ export declare namespace LSPErrorCodes {
8
+ /**
9
+ * This is the start range of LSP reserved error codes.
10
+ * It doesn't denote a real error code.
11
+ *
12
+ * @since 3.16.0
13
+ */
14
+ const lspReservedErrorRangeStart: integer;
15
+ /**
16
+ * A request failed but it was syntactically correct, e.g the
17
+ * method name was known and the parameters were valid. The error
18
+ * message should contain human readable information about why
19
+ * the request failed.
20
+ *
21
+ * @since 3.17.0
22
+ */
23
+ const RequestFailed: integer;
24
+ /**
25
+ * The server cancelled the request. This error code should
26
+ * only be used for requests that explicitly support being
27
+ * server cancellable.
28
+ *
29
+ * @since 3.17.0
30
+ */
31
+ const ServerCancelled: integer;
32
+ /**
33
+ * The server detected that the content of a document got
34
+ * modified outside normal conditions. A server should
35
+ * NOT send this error code if it detects a content change
36
+ * in it unprocessed messages. The result even computed
37
+ * on an older state might still be useful for the client.
38
+ *
39
+ * If a client decides that a result is not of any use anymore
40
+ * the client should cancel the request.
41
+ */
42
+ const ContentModified: integer;
43
+ /**
44
+ * The client has canceled a request and a server as detected
45
+ * the cancel.
46
+ */
47
+ const RequestCancelled: integer;
48
+ /**
49
+ * This is the end range of LSP reserved error codes.
50
+ * It doesn't denote a real error code.
51
+ *
52
+ * @since 3.16.0
53
+ */
54
+ const lspReservedErrorRangeEnd: integer;
55
+ }
56
+ import * as diag from './proposed.diagnostic';
57
+ import * as typeh from './proposed.typeHierarchy';
58
+ export declare namespace Proposed {
59
+ type DiagnosticClientCapabilities = diag.DiagnosticClientCapabilities;
60
+ type $DiagnosticClientCapabilities = diag.$DiagnosticClientCapabilities;
61
+ type DiagnosticOptions = diag.DiagnosticOptions;
62
+ type DiagnosticRegistrationOptions = diag.DiagnosticRegistrationOptions;
63
+ type $DiagnosticServerCapabilities = diag.$DiagnosticServerCapabilities;
64
+ type DocumentDiagnosticParams = diag.DocumentDiagnosticParams;
65
+ type DiagnosticServerCancellationData = diag.DiagnosticServerCancellationData;
66
+ const DiagnosticServerCancellationData: typeof diag.DiagnosticServerCancellationData;
67
+ type DocumentDiagnosticReportKind = diag.DocumentDiagnosticReportKind;
68
+ const DocumentDiagnosticReportKind: typeof diag.DocumentDiagnosticReportKind;
69
+ type FullDocumentDiagnosticReport = diag.FullDocumentDiagnosticReport;
70
+ type RelatedFullDocumentDiagnosticReport = diag.RelatedFullDocumentDiagnosticReport;
71
+ type UnchangedDocumentDiagnosticReport = diag.UnchangedDocumentDiagnosticReport;
72
+ type RelatedUnchangedDocumentDiagnosticReport = diag.RelatedUnchangedDocumentDiagnosticReport;
73
+ type DocumentDiagnosticReport = diag.DocumentDiagnosticReport;
74
+ type DocumentDiagnosticReportPartialResult = diag.DocumentDiagnosticReportPartialResult;
75
+ const DocumentDiagnosticRequest: typeof diag.DocumentDiagnosticRequest;
76
+ type PreviousResultId = diag.PreviousResultId;
77
+ type WorkspaceDiagnosticParams = diag.WorkspaceDiagnosticParams;
78
+ type WorkspaceFullDocumentDiagnosticReport = diag.WorkspaceFullDocumentDiagnosticReport;
79
+ type WorkspaceUnchangedDocumentDiagnosticReport = diag.WorkspaceUnchangedDocumentDiagnosticReport;
80
+ type WorkspaceDocumentDiagnosticReport = diag.WorkspaceDocumentDiagnosticReport;
81
+ type WorkspaceDiagnosticReport = diag.WorkspaceDiagnosticReport;
82
+ type WorkspaceDiagnosticReportPartialResult = diag.WorkspaceDiagnosticReportPartialResult;
83
+ const WorkspaceDiagnosticRequest: typeof diag.WorkspaceDiagnosticRequest;
84
+ const DiagnosticRefreshRequest: typeof diag.DiagnosticRefreshRequest;
85
+ type TypeHierarchyClientCapabilities = typeh.TypeHierarchyClientCapabilities;
86
+ type TypeHierarchyOptions = typeh.TypeHierarchyOptions;
87
+ type TypeHierarchyRegistrationOptions = typeh.TypeHierarchyRegistrationOptions;
88
+ type TypeHierarchyPrepareParams = typeh.TypeHierarchyPrepareParams;
89
+ type TypeHierarchySupertypesParams = typeh.TypeHierarchySupertypesParams;
90
+ type TypeHierarchySubtypesParams = typeh.TypeHierarchySubtypesParams;
91
+ const TypeHierarchyPrepareRequest: typeof typeh.TypeHierarchyPrepareRequest;
92
+ const TypeHierarchySupertypesRequest: typeof typeh.TypeHierarchySupertypesRequest;
93
+ const TypeHierarchySubtypesRequest: typeof typeh.TypeHierarchySubtypesRequest;
94
+ }
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ /* --------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ * ------------------------------------------------------------------------------------------ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Proposed = exports.LSPErrorCodes = exports.createProtocolConnection = void 0;
18
+ __exportStar(require("vscode-jsonrpc"), exports);
19
+ __exportStar(require("vscode-languageserver-types"), exports);
20
+ __exportStar(require("./messages"), exports);
21
+ __exportStar(require("./protocol"), exports);
22
+ var connection_1 = require("./connection");
23
+ Object.defineProperty(exports, "createProtocolConnection", { enumerable: true, get: function () { return connection_1.createProtocolConnection; } });
24
+ var LSPErrorCodes;
25
+ (function (LSPErrorCodes) {
26
+ /**
27
+ * This is the start range of LSP reserved error codes.
28
+ * It doesn't denote a real error code.
29
+ *
30
+ * @since 3.16.0
31
+ */
32
+ LSPErrorCodes.lspReservedErrorRangeStart = -32899;
33
+ /**
34
+ * A request failed but it was syntactically correct, e.g the
35
+ * method name was known and the parameters were valid. The error
36
+ * message should contain human readable information about why
37
+ * the request failed.
38
+ *
39
+ * @since 3.17.0
40
+ */
41
+ LSPErrorCodes.RequestFailed = -32803;
42
+ /**
43
+ * The server cancelled the request. This error code should
44
+ * only be used for requests that explicitly support being
45
+ * server cancellable.
46
+ *
47
+ * @since 3.17.0
48
+ */
49
+ LSPErrorCodes.ServerCancelled = -32802;
50
+ /**
51
+ * The server detected that the content of a document got
52
+ * modified outside normal conditions. A server should
53
+ * NOT send this error code if it detects a content change
54
+ * in it unprocessed messages. The result even computed
55
+ * on an older state might still be useful for the client.
56
+ *
57
+ * If a client decides that a result is not of any use anymore
58
+ * the client should cancel the request.
59
+ */
60
+ LSPErrorCodes.ContentModified = -32801;
61
+ /**
62
+ * The client has canceled a request and a server as detected
63
+ * the cancel.
64
+ */
65
+ LSPErrorCodes.RequestCancelled = -32800;
66
+ /**
67
+ * This is the end range of LSP reserved error codes.
68
+ * It doesn't denote a real error code.
69
+ *
70
+ * @since 3.16.0
71
+ */
72
+ LSPErrorCodes.lspReservedErrorRangeEnd = -32800;
73
+ })(LSPErrorCodes = exports.LSPErrorCodes || (exports.LSPErrorCodes = {}));
74
+ const diag = require("./proposed.diagnostic");
75
+ const typeh = require("./proposed.typeHierarchy");
76
+ var Proposed;
77
+ (function (Proposed) {
78
+ Proposed.DiagnosticServerCancellationData = diag.DiagnosticServerCancellationData;
79
+ Proposed.DocumentDiagnosticReportKind = diag.DocumentDiagnosticReportKind;
80
+ Proposed.DocumentDiagnosticRequest = diag.DocumentDiagnosticRequest;
81
+ Proposed.WorkspaceDiagnosticRequest = diag.WorkspaceDiagnosticRequest;
82
+ Proposed.DiagnosticRefreshRequest = diag.DiagnosticRefreshRequest;
83
+ Proposed.TypeHierarchyPrepareRequest = typeh.TypeHierarchyPrepareRequest;
84
+ Proposed.TypeHierarchySupertypesRequest = typeh.TypeHierarchySupertypesRequest;
85
+ Proposed.TypeHierarchySubtypesRequest = typeh.TypeHierarchySubtypesRequest;
86
+ })(Proposed = exports.Proposed || (exports.Proposed = {}));
87
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,163 @@
1
+ import { Message, NotificationMessage, CancellationToken, RequestHandler0, RequestHandler, GenericRequestHandler, NotificationHandler0, NotificationHandler, GenericNotificationHandler, ProgressType, Trace, Tracer, TraceOptions, Disposable, Event, MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, RequestType0, RequestType, NotificationType0, NotificationType, MessageSignature } from 'vscode-jsonrpc';
2
+ import { ProtocolRequestType, ProtocolRequestType0, ProtocolNotificationType, ProtocolNotificationType0 } from './messages';
3
+ export interface ProtocolConnection {
4
+ /**
5
+ * Sends a request and returns a promise resolving to the result of the request.
6
+ *
7
+ * @param type The type of request to sent.
8
+ * @param token An optional cancellation token.
9
+ * @returns A promise resolving to the request's result.
10
+ */
11
+ sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
12
+ sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
13
+ /**
14
+ * Sends a request and returns a promise resolving to the result of the request.
15
+ *
16
+ * @param type The type of request to sent.
17
+ * @param params The request's parameter.
18
+ * @param token An optional cancellation token.
19
+ * @returns A promise resolving to the request's result.
20
+ */
21
+ sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: P, token?: CancellationToken): Promise<R>;
22
+ sendRequest<P, R, E>(type: RequestType<P, R, E>, params: P, token?: CancellationToken): Promise<R>;
23
+ /**
24
+ * Sends a request and returns a promise resolving to the result of the request.
25
+ *
26
+ * @param method the message signature or the method name.
27
+ * @param token An optional cancellation token.
28
+ * @returns A promise resolving to the request's result.
29
+ */
30
+ sendRequest<R>(method: MessageSignature | string, token?: CancellationToken): Promise<R>;
31
+ /**
32
+ * Sends a request and returns a promise resolving to the result of the request.
33
+ *
34
+ * @param method the message signature or the method name.
35
+ * @param params The request's parameter.
36
+ * @param token An optional cancellation token.
37
+ * @returns A promise resolving to the request's result.
38
+ */
39
+ sendRequest<R>(method: MessageSignature | string, param: any, token?: CancellationToken): Promise<R>;
40
+ /**
41
+ * Installs a request handler.
42
+ *
43
+ * @param type The request type to install the handler for.
44
+ * @param handler The actual handler.
45
+ */
46
+ onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: RequestHandler0<R, E>): Disposable;
47
+ onRequest<R, E>(type: RequestType0<R, E>, handler: RequestHandler0<R, E>): Disposable;
48
+ /**
49
+ * Installs a request handler.
50
+ *
51
+ * @param type The request type to install the handler for.
52
+ * @param handler The actual handler.
53
+ */
54
+ onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: RequestHandler<P, R, E>): Disposable;
55
+ onRequest<P, R, E>(type: RequestType<P, R, E>, handler: RequestHandler<P, R, E>): Disposable;
56
+ /**
57
+ * Installs a request handler.
58
+ *
59
+ * @param methods the message signature or the method name to install a handler for.
60
+ * @param handler The actual handler.
61
+ */
62
+ onRequest<R, E>(method: MessageSignature | string, handler: GenericRequestHandler<R, E>): Disposable;
63
+ /**
64
+ * Sends a notification.
65
+ *
66
+ * @param type the notification's type to send.
67
+ */
68
+ sendNotification(type: NotificationType0): Promise<void>;
69
+ sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
70
+ /**
71
+ * Sends a notification.
72
+ *
73
+ * @param type the notification's type to send.
74
+ * @param params the notification's parameters.
75
+ */
76
+ sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
77
+ sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
78
+ /**
79
+ * Sends a notification.
80
+ *
81
+ * @param method the notification's method signature or the method name.
82
+ */
83
+ sendNotification(method: MessageSignature | string): Promise<void>;
84
+ /**
85
+ * Sends a notification.
86
+ *
87
+ * @param method the notification's method signature or the method name.
88
+ * @param params the notification's parameters.
89
+ */
90
+ sendNotification(method: MessageSignature | string, params: any): Promise<void>;
91
+ /**
92
+ * Installs a notification handler.
93
+ *
94
+ * @param type The notification type to install the handler for.
95
+ * @param handler The actual handler.
96
+ */
97
+ onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
98
+ onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
99
+ /**
100
+ * Installs a notification handler.
101
+ *
102
+ * @param type The notification type to install the handler for.
103
+ * @param handler The actual handler.
104
+ */
105
+ onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
106
+ onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
107
+ /**
108
+ * Installs a notification handler.
109
+ *
110
+ * @param methods The message signature or the method name to install the handler for.
111
+ * @param handler The actual handler.
112
+ */
113
+ onNotification(method: MessageSignature | string, handler: GenericNotificationHandler): Disposable;
114
+ /**
115
+ * Installs a progress handler for a given token.
116
+ * @param type the progress type
117
+ * @param token the token
118
+ * @param handler the handler
119
+ */
120
+ onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
121
+ /**
122
+ * Sends progress.
123
+ * @param type the progress type
124
+ * @param token the token to use
125
+ * @param value the progress value
126
+ */
127
+ sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
128
+ /**
129
+ * Enables tracing mode for the connection.
130
+ */
131
+ trace(value: Trace, tracer: Tracer, sendNotification?: boolean): void;
132
+ trace(value: Trace, tracer: Tracer, traceOptions?: TraceOptions): void;
133
+ /**
134
+ * An event emitter firing when an error occurs on the connection.
135
+ */
136
+ onError: Event<[Error, Message | undefined, number | undefined]>;
137
+ /**
138
+ * An event emitter firing when the connection got closed.
139
+ */
140
+ onClose: Event<void>;
141
+ /**
142
+ * An event emitter firing when the connection receives a notification that is not
143
+ * handled.
144
+ */
145
+ onUnhandledNotification: Event<NotificationMessage>;
146
+ /**
147
+ * An event emitter firing when the connection got disposed.
148
+ */
149
+ onDispose: Event<void>;
150
+ /**
151
+ * Ends the connection.
152
+ */
153
+ end(): void;
154
+ /**
155
+ * Actively disposes the connection.
156
+ */
157
+ dispose(): void;
158
+ /**
159
+ * Turns the connection into listening mode
160
+ */
161
+ listen(): void;
162
+ }
163
+ export declare function createProtocolConnection(input: MessageReader, output: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /* --------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ * ------------------------------------------------------------------------------------------ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createProtocolConnection = void 0;
8
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
9
+ function createProtocolConnection(input, output, logger, options) {
10
+ if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
11
+ options = { connectionStrategy: options };
12
+ }
13
+ return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);
14
+ }
15
+ exports.createProtocolConnection = createProtocolConnection;
16
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1,44 @@
1
+ import { RequestType, RequestType0, NotificationType, NotificationType0, ProgressType, _EM } from 'vscode-jsonrpc';
2
+ export declare class RegistrationType<RO> {
3
+ /**
4
+ * Clients must not use this property. It is here to ensure correct typing.
5
+ */
6
+ readonly ____: [RO, _EM] | undefined;
7
+ readonly method: string;
8
+ constructor(method: string);
9
+ }
10
+ export declare class ProtocolRequestType0<R, PR, E, RO> extends RequestType0<R, E> implements ProgressType<PR>, RegistrationType<RO> {
11
+ /**
12
+ * Clients must not use these properties. They are here to ensure correct typing.
13
+ * in TypeScript
14
+ */
15
+ readonly ___: [PR, RO, _EM] | undefined;
16
+ readonly ____: [RO, _EM] | undefined;
17
+ readonly _pr: PR | undefined;
18
+ constructor(method: string);
19
+ }
20
+ export declare class ProtocolRequestType<P, R, PR, E, RO> extends RequestType<P, R, E> implements ProgressType<PR>, RegistrationType<RO> {
21
+ /**
22
+ * Clients must not use this property. It is here to ensure correct typing.
23
+ */
24
+ readonly ___: [PR, RO, _EM] | undefined;
25
+ readonly ____: [RO, _EM] | undefined;
26
+ readonly _pr: PR | undefined;
27
+ constructor(method: string);
28
+ }
29
+ export declare class ProtocolNotificationType0<RO> extends NotificationType0 implements RegistrationType<RO> {
30
+ /**
31
+ * Clients must not use this property. It is here to ensure correct typing.
32
+ */
33
+ readonly ___: [RO, _EM] | undefined;
34
+ readonly ____: [RO, _EM] | undefined;
35
+ constructor(method: string);
36
+ }
37
+ export declare class ProtocolNotificationType<P, RO> extends NotificationType<P> implements RegistrationType<RO> {
38
+ /**
39
+ * Clients must not use this property. It is here to ensure correct typing.
40
+ */
41
+ readonly ___: [RO, _EM] | undefined;
42
+ readonly ____: [RO, _EM] | undefined;
43
+ constructor(method: string);
44
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ /* --------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ * ------------------------------------------------------------------------------------------ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = void 0;
8
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
9
+ class RegistrationType {
10
+ constructor(method) {
11
+ this.method = method;
12
+ }
13
+ }
14
+ exports.RegistrationType = RegistrationType;
15
+ class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {
16
+ constructor(method) {
17
+ super(method);
18
+ }
19
+ }
20
+ exports.ProtocolRequestType0 = ProtocolRequestType0;
21
+ class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {
22
+ constructor(method) {
23
+ super(method, vscode_jsonrpc_1.ParameterStructures.byName);
24
+ }
25
+ }
26
+ exports.ProtocolRequestType = ProtocolRequestType;
27
+ class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {
28
+ constructor(method) {
29
+ super(method);
30
+ }
31
+ }
32
+ exports.ProtocolNotificationType0 = ProtocolNotificationType0;
33
+ class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {
34
+ constructor(method) {
35
+ super(method, vscode_jsonrpc_1.ParameterStructures.byName);
36
+ }
37
+ }
38
+ exports.ProtocolNotificationType = ProtocolNotificationType;
39
+ //# sourceMappingURL=messages.js.map