vscode-languageserver-protocol 3.16.0-next.8 → 3.17.0-next.10
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/main.js +1 -1
- package/lib/common/api.d.ts +80 -17
- package/lib/common/api.js +44 -8
- package/lib/common/connection.d.ts +36 -23
- package/lib/common/connection.js +1 -1
- package/lib/common/messages.d.ts +35 -6
- package/lib/common/messages.js +13 -7
- package/lib/common/proposed.diagnostic.d.ts +324 -0
- package/lib/common/proposed.diagnostic.js +72 -0
- package/lib/common/proposed.inlineValue.d.ts +86 -0
- package/lib/common/proposed.inlineValue.js +29 -0
- package/lib/common/proposed.typeHierarchy.d.ts +83 -0
- package/lib/common/proposed.typeHierarchy.js +40 -0
- package/lib/common/protocol.callHierarchy.js +1 -1
- package/lib/common/protocol.colorProvider.d.ts +1 -3
- package/lib/common/protocol.colorProvider.js +0 -3
- package/lib/common/protocol.configuration.d.ts +4 -3
- package/lib/common/protocol.d.ts +470 -77
- package/lib/common/protocol.declaration.d.ts +2 -4
- package/lib/common/protocol.declaration.js +0 -3
- package/lib/common/protocol.fileOperations.d.ts +293 -0
- package/lib/common/protocol.fileOperations.js +92 -0
- package/lib/common/protocol.foldingRange.d.ts +3 -32
- package/lib/common/protocol.foldingRange.js +0 -3
- package/lib/common/protocol.implementation.d.ts +2 -4
- package/lib/common/protocol.implementation.js +0 -3
- package/lib/common/protocol.js +65 -31
- package/lib/common/protocol.linkedEditingRange.d.ts +51 -0
- package/lib/common/protocol.linkedEditingRange.js +19 -0
- package/lib/common/{protocol.moniker.proposed.d.ts → protocol.moniker.d.ts} +11 -14
- package/lib/common/{protocol.moniker.proposed.js → protocol.moniker.js} +1 -1
- package/lib/common/protocol.progress.d.ts +6 -4
- package/lib/common/protocol.progress.js +4 -0
- package/lib/common/protocol.selectionRange.d.ts +1 -3
- package/lib/common/protocol.selectionRange.js +0 -3
- package/lib/common/protocol.semanticTokens.d.ts +75 -135
- package/lib/common/protocol.semanticTokens.js +10 -69
- package/lib/common/protocol.showDocument.d.ts +71 -0
- package/lib/common/protocol.showDocument.js +22 -0
- package/lib/common/protocol.typeDefinition.d.ts +2 -4
- package/lib/common/protocol.typeDefinition.js +0 -3
- package/lib/common/protocol.workspaceFolders.d.ts +1 -1
- package/lib/node/main.js +1 -1
- package/package.json +6 -5
package/lib/browser/main.js
CHANGED
|
@@ -19,7 +19,7 @@ const browser_1 = require("vscode-jsonrpc/browser");
|
|
|
19
19
|
__exportStar(require("vscode-jsonrpc/browser"), exports);
|
|
20
20
|
__exportStar(require("../common/api"), exports);
|
|
21
21
|
function createProtocolConnection(reader, writer, logger, options) {
|
|
22
|
-
return browser_1.createMessageConnection(reader, writer, logger, options);
|
|
22
|
+
return (0, browser_1.createMessageConnection)(reader, writer, logger, options);
|
|
23
23
|
}
|
|
24
24
|
exports.createProtocolConnection = createProtocolConnection;
|
|
25
25
|
//# sourceMappingURL=main.js.map
|
package/lib/common/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { integer } from 'vscode-languageserver-types';
|
|
2
2
|
export * from 'vscode-jsonrpc';
|
|
3
3
|
export * from 'vscode-languageserver-types';
|
|
4
4
|
export * from './messages';
|
|
@@ -11,28 +11,91 @@ export declare namespace LSPErrorCodes {
|
|
|
11
11
|
*
|
|
12
12
|
* @since 3.16.0
|
|
13
13
|
*/
|
|
14
|
-
const lspReservedErrorRangeStart:
|
|
15
|
-
|
|
16
|
-
|
|
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;
|
|
17
48
|
/**
|
|
18
49
|
* This is the end range of LSP reserved error codes.
|
|
19
50
|
* It doesn't denote a real error code.
|
|
20
51
|
*
|
|
21
52
|
* @since 3.16.0
|
|
22
53
|
*/
|
|
23
|
-
const lspReservedErrorRangeEnd:
|
|
54
|
+
const lspReservedErrorRangeEnd: integer;
|
|
24
55
|
}
|
|
56
|
+
import * as diag from './proposed.diagnostic';
|
|
57
|
+
import * as typeh from './proposed.typeHierarchy';
|
|
58
|
+
import * as iv from './proposed.inlineValue';
|
|
25
59
|
export declare namespace Proposed {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type
|
|
29
|
-
type
|
|
30
|
-
type
|
|
31
|
-
type
|
|
32
|
-
type
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
type DiagnosticClientCapabilities = diag.DiagnosticClientCapabilities;
|
|
61
|
+
type $DiagnosticClientCapabilities = diag.$DiagnosticClientCapabilities;
|
|
62
|
+
type DiagnosticOptions = diag.DiagnosticOptions;
|
|
63
|
+
type DiagnosticRegistrationOptions = diag.DiagnosticRegistrationOptions;
|
|
64
|
+
type $DiagnosticServerCapabilities = diag.$DiagnosticServerCapabilities;
|
|
65
|
+
type DocumentDiagnosticParams = diag.DocumentDiagnosticParams;
|
|
66
|
+
type DiagnosticServerCancellationData = diag.DiagnosticServerCancellationData;
|
|
67
|
+
const DiagnosticServerCancellationData: typeof diag.DiagnosticServerCancellationData;
|
|
68
|
+
type DocumentDiagnosticReportKind = diag.DocumentDiagnosticReportKind;
|
|
69
|
+
const DocumentDiagnosticReportKind: typeof diag.DocumentDiagnosticReportKind;
|
|
70
|
+
type FullDocumentDiagnosticReport = diag.FullDocumentDiagnosticReport;
|
|
71
|
+
type RelatedFullDocumentDiagnosticReport = diag.RelatedFullDocumentDiagnosticReport;
|
|
72
|
+
type UnchangedDocumentDiagnosticReport = diag.UnchangedDocumentDiagnosticReport;
|
|
73
|
+
type RelatedUnchangedDocumentDiagnosticReport = diag.RelatedUnchangedDocumentDiagnosticReport;
|
|
74
|
+
type DocumentDiagnosticReport = diag.DocumentDiagnosticReport;
|
|
75
|
+
type DocumentDiagnosticReportPartialResult = diag.DocumentDiagnosticReportPartialResult;
|
|
76
|
+
const DocumentDiagnosticRequest: typeof diag.DocumentDiagnosticRequest;
|
|
77
|
+
type PreviousResultId = diag.PreviousResultId;
|
|
78
|
+
type WorkspaceDiagnosticParams = diag.WorkspaceDiagnosticParams;
|
|
79
|
+
type WorkspaceFullDocumentDiagnosticReport = diag.WorkspaceFullDocumentDiagnosticReport;
|
|
80
|
+
type WorkspaceUnchangedDocumentDiagnosticReport = diag.WorkspaceUnchangedDocumentDiagnosticReport;
|
|
81
|
+
type WorkspaceDocumentDiagnosticReport = diag.WorkspaceDocumentDiagnosticReport;
|
|
82
|
+
type WorkspaceDiagnosticReport = diag.WorkspaceDiagnosticReport;
|
|
83
|
+
type WorkspaceDiagnosticReportPartialResult = diag.WorkspaceDiagnosticReportPartialResult;
|
|
84
|
+
const WorkspaceDiagnosticRequest: typeof diag.WorkspaceDiagnosticRequest;
|
|
85
|
+
const DiagnosticRefreshRequest: typeof diag.DiagnosticRefreshRequest;
|
|
86
|
+
type TypeHierarchyClientCapabilities = typeh.TypeHierarchyClientCapabilities;
|
|
87
|
+
type TypeHierarchyOptions = typeh.TypeHierarchyOptions;
|
|
88
|
+
type TypeHierarchyRegistrationOptions = typeh.TypeHierarchyRegistrationOptions;
|
|
89
|
+
type TypeHierarchyPrepareParams = typeh.TypeHierarchyPrepareParams;
|
|
90
|
+
type TypeHierarchySupertypesParams = typeh.TypeHierarchySupertypesParams;
|
|
91
|
+
type TypeHierarchySubtypesParams = typeh.TypeHierarchySubtypesParams;
|
|
92
|
+
const TypeHierarchyPrepareRequest: typeof typeh.TypeHierarchyPrepareRequest;
|
|
93
|
+
const TypeHierarchySupertypesRequest: typeof typeh.TypeHierarchySupertypesRequest;
|
|
94
|
+
const TypeHierarchySubtypesRequest: typeof typeh.TypeHierarchySubtypesRequest;
|
|
95
|
+
type InlineValuesClientCapabilities = iv.InlineValuesClientCapabilities;
|
|
96
|
+
type InlineValuesOptions = iv.InlineValuesOptions;
|
|
97
|
+
type InlineValuesRegistrationOptions = iv.InlineValuesRegistrationOptions;
|
|
98
|
+
type InlineValuesParams = iv.InlineValuesParams;
|
|
99
|
+
const InlineValuesRequest: typeof iv.InlineValuesRequest;
|
|
100
|
+
const InlineValuesRefreshRequest: typeof iv.InlineValuesRefreshRequest;
|
|
38
101
|
}
|
package/lib/common/api.js
CHANGED
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.Proposed = exports.LSPErrorCodes = exports.createProtocolConnection = void 0;
|
|
18
|
-
const mk = require("./protocol.moniker.proposed");
|
|
19
18
|
__exportStar(require("vscode-jsonrpc"), exports);
|
|
20
19
|
__exportStar(require("vscode-languageserver-types"), exports);
|
|
21
20
|
__exportStar(require("./messages"), exports);
|
|
@@ -31,7 +30,38 @@ var LSPErrorCodes;
|
|
|
31
30
|
* @since 3.16.0
|
|
32
31
|
*/
|
|
33
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
|
+
*/
|
|
34
60
|
LSPErrorCodes.ContentModified = -32801;
|
|
61
|
+
/**
|
|
62
|
+
* The client has canceled a request and a server as detected
|
|
63
|
+
* the cancel.
|
|
64
|
+
*/
|
|
35
65
|
LSPErrorCodes.RequestCancelled = -32800;
|
|
36
66
|
/**
|
|
37
67
|
* This is the end range of LSP reserved error codes.
|
|
@@ -41,14 +71,20 @@ var LSPErrorCodes;
|
|
|
41
71
|
*/
|
|
42
72
|
LSPErrorCodes.lspReservedErrorRangeEnd = -32800;
|
|
43
73
|
})(LSPErrorCodes = exports.LSPErrorCodes || (exports.LSPErrorCodes = {}));
|
|
74
|
+
const diag = require("./proposed.diagnostic");
|
|
75
|
+
const typeh = require("./proposed.typeHierarchy");
|
|
76
|
+
const iv = require("./proposed.inlineValue");
|
|
44
77
|
var Proposed;
|
|
45
78
|
(function (Proposed) {
|
|
46
|
-
Proposed.
|
|
47
|
-
Proposed.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
79
|
+
Proposed.DiagnosticServerCancellationData = diag.DiagnosticServerCancellationData;
|
|
80
|
+
Proposed.DocumentDiagnosticReportKind = diag.DocumentDiagnosticReportKind;
|
|
81
|
+
Proposed.DocumentDiagnosticRequest = diag.DocumentDiagnosticRequest;
|
|
82
|
+
Proposed.WorkspaceDiagnosticRequest = diag.WorkspaceDiagnosticRequest;
|
|
83
|
+
Proposed.DiagnosticRefreshRequest = diag.DiagnosticRefreshRequest;
|
|
84
|
+
Proposed.TypeHierarchyPrepareRequest = typeh.TypeHierarchyPrepareRequest;
|
|
85
|
+
Proposed.TypeHierarchySupertypesRequest = typeh.TypeHierarchySupertypesRequest;
|
|
86
|
+
Proposed.TypeHierarchySubtypesRequest = typeh.TypeHierarchySubtypesRequest;
|
|
87
|
+
Proposed.InlineValuesRequest = iv.InlineValuesRequest;
|
|
88
|
+
Proposed.InlineValuesRefreshRequest = iv.InlineValuesRefreshRequest;
|
|
53
89
|
})(Proposed = exports.Proposed || (exports.Proposed = {}));
|
|
54
90
|
//# sourceMappingURL=api.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Message, NotificationMessage, CancellationToken,
|
|
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';
|
|
2
3
|
export interface ProtocolConnection {
|
|
3
4
|
/**
|
|
4
5
|
* Sends a request and returns a promise resolving to the result of the request.
|
|
@@ -7,7 +8,8 @@ export interface ProtocolConnection {
|
|
|
7
8
|
* @param token An optional cancellation token.
|
|
8
9
|
* @returns A promise resolving to the request's result.
|
|
9
10
|
*/
|
|
10
|
-
sendRequest<R, E, RO>(type:
|
|
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>;
|
|
11
13
|
/**
|
|
12
14
|
* Sends a request and returns a promise resolving to the result of the request.
|
|
13
15
|
*
|
|
@@ -16,92 +18,99 @@ export interface ProtocolConnection {
|
|
|
16
18
|
* @param token An optional cancellation token.
|
|
17
19
|
* @returns A promise resolving to the request's result.
|
|
18
20
|
*/
|
|
19
|
-
sendRequest<P, R, E, RO>(type:
|
|
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>;
|
|
20
23
|
/**
|
|
21
24
|
* Sends a request and returns a promise resolving to the result of the request.
|
|
22
25
|
*
|
|
23
|
-
* @param method the
|
|
26
|
+
* @param method the message signature or the method name.
|
|
24
27
|
* @param token An optional cancellation token.
|
|
25
28
|
* @returns A promise resolving to the request's result.
|
|
26
29
|
*/
|
|
27
|
-
sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
|
|
30
|
+
sendRequest<R>(method: MessageSignature | string, token?: CancellationToken): Promise<R>;
|
|
28
31
|
/**
|
|
29
32
|
* Sends a request and returns a promise resolving to the result of the request.
|
|
30
33
|
*
|
|
31
|
-
* @param method the
|
|
34
|
+
* @param method the message signature or the method name.
|
|
32
35
|
* @param params The request's parameter.
|
|
33
36
|
* @param token An optional cancellation token.
|
|
34
37
|
* @returns A promise resolving to the request's result.
|
|
35
38
|
*/
|
|
36
|
-
sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;
|
|
39
|
+
sendRequest<R>(method: MessageSignature | string, param: any, token?: CancellationToken): Promise<R>;
|
|
37
40
|
/**
|
|
38
41
|
* Installs a request handler.
|
|
39
42
|
*
|
|
40
43
|
* @param type The request type to install the handler for.
|
|
41
44
|
* @param handler The actual handler.
|
|
42
45
|
*/
|
|
43
|
-
onRequest<R, E, RO>(type:
|
|
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;
|
|
44
48
|
/**
|
|
45
49
|
* Installs a request handler.
|
|
46
50
|
*
|
|
47
51
|
* @param type The request type to install the handler for.
|
|
48
52
|
* @param handler The actual handler.
|
|
49
53
|
*/
|
|
50
|
-
onRequest<P, R, E, RO>(type:
|
|
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;
|
|
51
56
|
/**
|
|
52
57
|
* Installs a request handler.
|
|
53
58
|
*
|
|
54
|
-
* @param methods
|
|
59
|
+
* @param methods the message signature or the method name to install a handler for.
|
|
55
60
|
* @param handler The actual handler.
|
|
56
61
|
*/
|
|
57
|
-
onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>):
|
|
62
|
+
onRequest<R, E>(method: MessageSignature | string, handler: GenericRequestHandler<R, E>): Disposable;
|
|
58
63
|
/**
|
|
59
64
|
* Sends a notification.
|
|
60
65
|
*
|
|
61
66
|
* @param type the notification's type to send.
|
|
62
67
|
*/
|
|
63
|
-
sendNotification
|
|
68
|
+
sendNotification(type: NotificationType0): Promise<void>;
|
|
69
|
+
sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
|
|
64
70
|
/**
|
|
65
71
|
* Sends a notification.
|
|
66
72
|
*
|
|
67
73
|
* @param type the notification's type to send.
|
|
68
74
|
* @param params the notification's parameters.
|
|
69
75
|
*/
|
|
70
|
-
sendNotification<P, RO>(type:
|
|
76
|
+
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: P): Promise<void>;
|
|
77
|
+
sendNotification<P>(type: NotificationType<P>, params?: P): Promise<void>;
|
|
71
78
|
/**
|
|
72
79
|
* Sends a notification.
|
|
73
80
|
*
|
|
74
|
-
* @param method the notification's method name.
|
|
81
|
+
* @param method the notification's method signature or the method name.
|
|
75
82
|
*/
|
|
76
|
-
sendNotification(method: string): void
|
|
83
|
+
sendNotification(method: MessageSignature | string): Promise<void>;
|
|
77
84
|
/**
|
|
78
85
|
* Sends a notification.
|
|
79
86
|
*
|
|
80
|
-
* @param method the notification's method name.
|
|
87
|
+
* @param method the notification's method signature or the method name.
|
|
81
88
|
* @param params the notification's parameters.
|
|
82
89
|
*/
|
|
83
|
-
sendNotification(method: string, params: any): void
|
|
90
|
+
sendNotification(method: MessageSignature | string, params: any): Promise<void>;
|
|
84
91
|
/**
|
|
85
92
|
* Installs a notification handler.
|
|
86
93
|
*
|
|
87
94
|
* @param type The notification type to install the handler for.
|
|
88
95
|
* @param handler The actual handler.
|
|
89
96
|
*/
|
|
90
|
-
onNotification<RO>(type:
|
|
97
|
+
onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
|
|
98
|
+
onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
|
|
91
99
|
/**
|
|
92
100
|
* Installs a notification handler.
|
|
93
101
|
*
|
|
94
102
|
* @param type The notification type to install the handler for.
|
|
95
103
|
* @param handler The actual handler.
|
|
96
104
|
*/
|
|
97
|
-
onNotification<P, RO>(type:
|
|
105
|
+
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NotificationHandler<P>): Disposable;
|
|
106
|
+
onNotification<P>(type: NotificationType<P>, handler: NotificationHandler<P>): Disposable;
|
|
98
107
|
/**
|
|
99
108
|
* Installs a notification handler.
|
|
100
109
|
*
|
|
101
|
-
* @param methods The method name to install the handler for.
|
|
110
|
+
* @param methods The message signature or the method name to install the handler for.
|
|
102
111
|
* @param handler The actual handler.
|
|
103
112
|
*/
|
|
104
|
-
onNotification(method: string, handler: GenericNotificationHandler):
|
|
113
|
+
onNotification(method: MessageSignature | string, handler: GenericNotificationHandler): Disposable;
|
|
105
114
|
/**
|
|
106
115
|
* Installs a progress handler for a given token.
|
|
107
116
|
* @param type the progress type
|
|
@@ -115,7 +124,7 @@ export interface ProtocolConnection {
|
|
|
115
124
|
* @param token the token to use
|
|
116
125
|
* @param value the progress value
|
|
117
126
|
*/
|
|
118
|
-
sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): void
|
|
127
|
+
sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
|
|
119
128
|
/**
|
|
120
129
|
* Enables tracing mode for the connection.
|
|
121
130
|
*/
|
|
@@ -130,7 +139,7 @@ export interface ProtocolConnection {
|
|
|
130
139
|
*/
|
|
131
140
|
onClose: Event<void>;
|
|
132
141
|
/**
|
|
133
|
-
* An event
|
|
142
|
+
* An event emitter firing when the connection receives a notification that is not
|
|
134
143
|
* handled.
|
|
135
144
|
*/
|
|
136
145
|
onUnhandledNotification: Event<NotificationMessage>;
|
|
@@ -138,6 +147,10 @@ export interface ProtocolConnection {
|
|
|
138
147
|
* An event emitter firing when the connection got disposed.
|
|
139
148
|
*/
|
|
140
149
|
onDispose: Event<void>;
|
|
150
|
+
/**
|
|
151
|
+
* Ends the connection.
|
|
152
|
+
*/
|
|
153
|
+
end(): void;
|
|
141
154
|
/**
|
|
142
155
|
* Actively disposes the connection.
|
|
143
156
|
*/
|
package/lib/common/connection.js
CHANGED
|
@@ -10,7 +10,7 @@ function createProtocolConnection(input, output, logger, options) {
|
|
|
10
10
|
if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
|
|
11
11
|
options = { connectionStrategy: options };
|
|
12
12
|
}
|
|
13
|
-
return vscode_jsonrpc_1.createMessageConnection(input, output, logger, options);
|
|
13
|
+
return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);
|
|
14
14
|
}
|
|
15
15
|
exports.createProtocolConnection = createProtocolConnection;
|
|
16
16
|
//# sourceMappingURL=connection.js.map
|
package/lib/common/messages.d.ts
CHANGED
|
@@ -1,15 +1,44 @@
|
|
|
1
1
|
import { RequestType, RequestType0, NotificationType, NotificationType0, ProgressType, _EM } from 'vscode-jsonrpc';
|
|
2
|
-
export declare class
|
|
3
|
-
|
|
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;
|
|
4
8
|
constructor(method: string);
|
|
5
9
|
}
|
|
6
|
-
export declare class
|
|
7
|
-
|
|
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;
|
|
8
18
|
constructor(method: string);
|
|
9
19
|
}
|
|
10
|
-
export declare class
|
|
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;
|
|
11
27
|
constructor(method: string);
|
|
12
28
|
}
|
|
13
|
-
export declare class ProtocolNotificationType0<RO> extends NotificationType0<RO> {
|
|
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;
|
|
14
43
|
constructor(method: string);
|
|
15
44
|
}
|
package/lib/common/messages.js
CHANGED
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
* ------------------------------------------------------------------------------------------ */
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = void 0;
|
|
8
8
|
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
|
|
9
|
+
class RegistrationType {
|
|
10
|
+
constructor(method) {
|
|
11
|
+
this.method = method;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.RegistrationType = RegistrationType;
|
|
9
15
|
class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {
|
|
10
16
|
constructor(method) {
|
|
11
17
|
super(method);
|
|
@@ -18,16 +24,16 @@ class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {
|
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
26
|
exports.ProtocolRequestType = ProtocolRequestType;
|
|
21
|
-
class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {
|
|
22
|
-
constructor(method) {
|
|
23
|
-
super(method, vscode_jsonrpc_1.ParameterStructures.byName);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ProtocolNotificationType = ProtocolNotificationType;
|
|
27
27
|
class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {
|
|
28
28
|
constructor(method) {
|
|
29
29
|
super(method);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
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;
|
|
33
39
|
//# sourceMappingURL=messages.js.map
|