vscode-languageserver-protocol 3.15.0-next.5 → 3.15.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.
package/.eslintrc.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "extends": "../.eslintrc.base.json",
3
+ "rules": {
4
+ "no-console": "error"
5
+ }
6
+ }
package/lib/main.d.ts CHANGED
@@ -1,24 +1,15 @@
1
- import { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, Tracer, TraceFormat, TraceOptions, SetTraceNotification, LogTraceNotification, Message, NotificationMessage, RequestMessage, MessageType as RPCMessageType, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, StarRequestHandler, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, StarNotificationHandler, MessageReader, MessageWriter, Logger, ConnectionStrategy, StreamMessageReader, StreamMessageWriter, IPCMessageReader, IPCMessageWriter, createClientPipeTransport, createServerPipeTransport, generateRandomPipeName, DataCallback, createClientSocketTransport, createServerSocketTransport } from 'vscode-jsonrpc';
2
- export { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, Tracer, TraceFormat, TraceOptions, SetTraceNotification, LogTraceNotification, Message, NotificationMessage, RequestMessage, RPCMessageType, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, StarRequestHandler, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, StarNotificationHandler, MessageReader, MessageWriter, Logger, ConnectionStrategy, StreamMessageReader, StreamMessageWriter, IPCMessageReader, IPCMessageWriter, createClientPipeTransport, createServerPipeTransport, generateRandomPipeName, DataCallback, createClientSocketTransport, createServerSocketTransport, };
1
+ import { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, Tracer, TraceFormat, TraceOptions, SetTraceNotification, LogTraceNotification, Message, NotificationMessage, RequestMessage, MessageType as RPCMessageType, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, StarRequestHandler, HandlerResult, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, StarNotificationHandler, MessageReader, MessageWriter, Logger, ConnectionStrategy, StreamMessageReader, StreamMessageWriter, IPCMessageReader, IPCMessageWriter, createClientPipeTransport, createServerPipeTransport, generateRandomPipeName, DataCallback, createClientSocketTransport, createServerSocketTransport, ProgressType, ProgressToken } from 'vscode-jsonrpc';
2
+ export { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, Tracer, TraceFormat, TraceOptions, SetTraceNotification, LogTraceNotification, Message, NotificationMessage, RequestMessage, RPCMessageType, RequestType, RequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, StarRequestHandler, HandlerResult, NotificationType, NotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, StarNotificationHandler, MessageReader, MessageWriter, Logger, ConnectionStrategy, StreamMessageReader, StreamMessageWriter, IPCMessageReader, IPCMessageWriter, createClientPipeTransport, createServerPipeTransport, generateRandomPipeName, DataCallback, createClientSocketTransport, createServerSocketTransport, ProgressType, ProgressToken };
3
3
  export * from 'vscode-languageserver-types';
4
4
  export * from './protocol';
5
5
  export { FoldingRangeParams as FoldingRangeRequestParam } from './protocol';
6
6
  import * as callHierarchy from './protocol.callHierarchy.proposed';
7
7
  import * as progress from './protocol.progress.proposed';
8
- import * as sr from './protocol.selectionRange.proposed';
9
8
  export declare namespace Proposed {
10
- type SelectionRangeClientCapabilities = sr.SelectionRangeClientCapabilities;
11
- type SelectionRangeServerCapabilities = sr.SelectionRangeServerCapabilities;
12
- type SelectionRange = sr.SelectionRange;
13
- type SelectionRangeParams = sr.SelectionRangeParams;
14
- namespace SelectionRangeRequest {
15
- const type: RequestType<sr.SelectionRangeParams, sr.SelectionRange[] | null, any, any>;
16
- type HandlerSignature = sr.SelectionRangeRequest.HandlerSignature;
17
- }
18
9
  type CallHierarchyClientCapabilities = callHierarchy.CallHierarchyClientCapabilities;
19
10
  type CallHierarchyServerCapabilities = callHierarchy.CallHierarchyServerCapabilities;
20
11
  namespace CallHierarchyRequest {
21
- const type: RequestType<callHierarchy.CallHierarchyParams, callHierarchy.CallHierarchyCall[], void, import("./protocol").TextDocumentRegistrationOptions>;
12
+ const type: RequestType<callHierarchy.CallHierarchyParams, callHierarchy.CallHierarchyCall[], void, callHierarchy.CallHierarchyRegistrationOptions>;
22
13
  type HandlerSignature = callHierarchy.CallHierarchyRequest.HandlerSignature;
23
14
  }
24
15
  namespace CallHierarchyDirection {
@@ -29,26 +20,22 @@ export declare namespace Proposed {
29
20
  type CallHierarchyDirection = callHierarchy.CallHierarchyDirection;
30
21
  type CallHierarchyItem = callHierarchy.CallHierarchyItem;
31
22
  type CallHierarchyCall = callHierarchy.CallHierarchyCall;
32
- type ProgressClientCapabilities = progress.ProgressClientCapabilities;
33
- type ProgressStartParams = progress.ProgressStartParams;
34
- namespace ProgressStartNotification {
35
- const type: NotificationType<progress.ProgressStartParams, void>;
36
- type HandlerSignature = progress.ProgressStartNotification.HandlerSignature;
37
- }
38
- type ProgressReportParams = progress.ProgressReportParams;
39
- namespace ProgressReportNotification {
40
- const type: NotificationType<progress.ProgressReportParams, void>;
41
- type HandlerSignature = progress.ProgressReportNotification.HandlerSignature;
23
+ type WorkDoneProgressClientCapabilities = progress.WorkDoneProgressClientCapabilities;
24
+ type WorkDoneProgressBegin = progress.WorkDoneProgressBegin;
25
+ type WorkDoneProgressReport = progress.WorkDoneProgressReport;
26
+ type WorkDoneProgressEnd = progress.WorkDoneProgressEnd;
27
+ namespace WorkDoneProgress {
28
+ const type: ProgressType<progress.WorkDoneProgressBegin | progress.WorkDoneProgressReport | progress.WorkDoneProgressEnd>;
42
29
  }
43
- type ProgressDoneParams = progress.ProgressDoneParams;
44
- namespace ProgressDoneNotification {
45
- const type: NotificationType<progress.ProgressDoneParams, void>;
46
- type HandlerSignature = progress.ProgressDoneNotification.HandlerSignature;
30
+ type WorkDoneProgressCreateParams = progress.WorkDoneProgressCreateParams;
31
+ namespace WorkDoneProgressCreateRequest {
32
+ const type: RequestType<progress.WorkDoneProgressCreateParams, void, void, void>;
33
+ type HandlerSignature = progress.WorkDoneProgressCreateRequest.HandlerSignature;
47
34
  }
48
- type ProgressCancelParams = progress.ProgressCancelParams;
49
- namespace ProgressCancelNotification {
50
- const type: NotificationType<progress.ProgressCancelParams, void>;
51
- type HandlerSignature = progress.ProgressCancelNotification.HandlerSignature;
35
+ type WorkDoneProgressCancelParams = progress.WorkDoneProgressCancelParams;
36
+ namespace WorkDoneProgressCancelNotification {
37
+ const type: NotificationType<progress.WorkDoneProgressCancelParams, void>;
38
+ type HandlerSignature = progress.WorkDoneProgressCancelNotification.HandlerSignature;
52
39
  }
53
40
  }
54
41
  export interface ProtocolConnection {
@@ -154,6 +141,20 @@ export interface ProtocolConnection {
154
141
  * @param handler The actual handler.
155
142
  */
156
143
  onNotification(method: string, handler: GenericNotificationHandler): void;
144
+ /**
145
+ * Installs a progress handler for a given token.
146
+ * @param type the progress type
147
+ * @param token the token
148
+ * @param handler the handler
149
+ */
150
+ onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
151
+ /**
152
+ * Sends progress.
153
+ * @param type the progress type
154
+ * @param token the token to use
155
+ * @param value the progress value
156
+ */
157
+ sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): void;
157
158
  /**
158
159
  * Enables tracing mode for the connection.
159
160
  */
package/lib/main.js CHANGED
@@ -35,17 +35,13 @@ exports.createServerPipeTransport = vscode_jsonrpc_1.createServerPipeTransport;
35
35
  exports.generateRandomPipeName = vscode_jsonrpc_1.generateRandomPipeName;
36
36
  exports.createClientSocketTransport = vscode_jsonrpc_1.createClientSocketTransport;
37
37
  exports.createServerSocketTransport = vscode_jsonrpc_1.createServerSocketTransport;
38
+ exports.ProgressType = vscode_jsonrpc_1.ProgressType;
38
39
  __export(require("vscode-languageserver-types"));
39
40
  __export(require("./protocol"));
40
41
  const callHierarchy = require("./protocol.callHierarchy.proposed");
41
42
  const progress = require("./protocol.progress.proposed");
42
- const sr = require("./protocol.selectionRange.proposed");
43
43
  var Proposed;
44
44
  (function (Proposed) {
45
- let SelectionRangeRequest;
46
- (function (SelectionRangeRequest) {
47
- SelectionRangeRequest.type = sr.SelectionRangeRequest.type;
48
- })(SelectionRangeRequest = Proposed.SelectionRangeRequest || (Proposed.SelectionRangeRequest = {}));
49
45
  let CallHierarchyRequest;
50
46
  (function (CallHierarchyRequest) {
51
47
  CallHierarchyRequest.type = callHierarchy.CallHierarchyRequest.type;
@@ -55,22 +51,19 @@ var Proposed;
55
51
  CallHierarchyDirection.CallsFrom = callHierarchy.CallHierarchyDirection.CallsFrom;
56
52
  CallHierarchyDirection.CallsTo = callHierarchy.CallHierarchyDirection.CallsTo;
57
53
  })(CallHierarchyDirection = Proposed.CallHierarchyDirection || (Proposed.CallHierarchyDirection = {}));
58
- let ProgressStartNotification;
59
- (function (ProgressStartNotification) {
60
- ProgressStartNotification.type = progress.ProgressStartNotification.type;
61
- })(ProgressStartNotification = Proposed.ProgressStartNotification || (Proposed.ProgressStartNotification = {}));
62
- let ProgressReportNotification;
63
- (function (ProgressReportNotification) {
64
- ProgressReportNotification.type = progress.ProgressReportNotification.type;
65
- })(ProgressReportNotification = Proposed.ProgressReportNotification || (Proposed.ProgressReportNotification = {}));
66
- let ProgressDoneNotification;
67
- (function (ProgressDoneNotification) {
68
- ProgressDoneNotification.type = progress.ProgressDoneNotification.type;
69
- })(ProgressDoneNotification = Proposed.ProgressDoneNotification || (Proposed.ProgressDoneNotification = {}));
70
- let ProgressCancelNotification;
71
- (function (ProgressCancelNotification) {
72
- ProgressCancelNotification.type = progress.ProgressCancelNotification.type;
73
- })(ProgressCancelNotification = Proposed.ProgressCancelNotification || (Proposed.ProgressCancelNotification = {}));
54
+ // export type ProgressServerCapabilities = progress.ProgressServerCapabilities;
55
+ let WorkDoneProgress;
56
+ (function (WorkDoneProgress) {
57
+ WorkDoneProgress.type = progress.WorkDoneProgress.type;
58
+ })(WorkDoneProgress = Proposed.WorkDoneProgress || (Proposed.WorkDoneProgress = {}));
59
+ let WorkDoneProgressCreateRequest;
60
+ (function (WorkDoneProgressCreateRequest) {
61
+ WorkDoneProgressCreateRequest.type = progress.WorkDoneProgressCreateRequest.type;
62
+ })(WorkDoneProgressCreateRequest = Proposed.WorkDoneProgressCreateRequest || (Proposed.WorkDoneProgressCreateRequest = {}));
63
+ let WorkDoneProgressCancelNotification;
64
+ (function (WorkDoneProgressCancelNotification) {
65
+ WorkDoneProgressCancelNotification.type = progress.WorkDoneProgressCancelNotification.type;
66
+ })(WorkDoneProgressCancelNotification = Proposed.WorkDoneProgressCancelNotification || (Proposed.WorkDoneProgressCancelNotification = {}));
74
67
  })(Proposed = exports.Proposed || (exports.Proposed = {}));
75
68
  function createProtocolConnection(reader, writer, logger, strategy) {
76
69
  return vscode_jsonrpc_1.createMessageConnection(reader, writer, logger, strategy);
@@ -1,6 +1,6 @@
1
- import { RequestType, RequestHandler } from 'vscode-jsonrpc';
1
+ import { RequestType, RequestHandler, ProgressType } from 'vscode-jsonrpc';
2
2
  import { SymbolKind, Range } from 'vscode-languageserver-types';
3
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams } from './protocol';
3
+ import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
4
4
  export interface CallHierarchyClientCapabilities {
5
5
  /**
6
6
  * The text document client capabilities
@@ -19,16 +19,20 @@ export interface CallHierarchyClientCapabilities {
19
19
  };
20
20
  };
21
21
  }
22
+ export interface CallHierarchyOptions extends WorkDoneProgressOptions {
23
+ }
24
+ export interface CallHierarchyRegistrationOptions extends TextDocumentRegistrationOptions, CallHierarchyOptions {
25
+ }
22
26
  export interface CallHierarchyServerCapabilities {
23
27
  /**
24
28
  * The server provides Call Hierarchy support.
25
29
  */
26
- callHierarchyProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
30
+ callHierarchyProvider?: boolean | CallHierarchyOptions | (CallHierarchyRegistrationOptions & StaticRegistrationOptions);
27
31
  }
28
32
  /**
29
33
  * The parameter of a `textDocument/callHierarchy` request extends the `TextDocumentPositionParams` with the direction of calls to resolve.
30
34
  */
31
- export interface CallHierarchyParams extends TextDocumentPositionParams {
35
+ export interface CallHierarchyParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
32
36
  /**
33
37
  * The direction of calls to provide.
34
38
  */
@@ -103,6 +107,7 @@ export interface CallHierarchyCall {
103
107
  * Evaluates the symbol defined (or referenced) at the given position, and returns all incoming or outgoing calls to the symbol(s).
104
108
  */
105
109
  export declare namespace CallHierarchyRequest {
106
- const type: RequestType<CallHierarchyParams, CallHierarchyCall[], void, TextDocumentRegistrationOptions>;
110
+ const type: RequestType<CallHierarchyParams, CallHierarchyCall[], void, CallHierarchyRegistrationOptions>;
111
+ const resultType: ProgressType<CallHierarchyCall[]>;
107
112
  type HandlerSignature = RequestHandler<CallHierarchyParams, CallHierarchyCall[] | null, void>;
108
113
  }
@@ -30,4 +30,5 @@ var CallHierarchyDirection;
30
30
  var CallHierarchyRequest;
31
31
  (function (CallHierarchyRequest) {
32
32
  CallHierarchyRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/callHierarchy');
33
+ CallHierarchyRequest.resultType = new vscode_jsonrpc_1.ProgressType();
33
34
  })(CallHierarchyRequest = exports.CallHierarchyRequest || (exports.CallHierarchyRequest = {}));
@@ -1,36 +1,26 @@
1
- import { RequestType } from 'vscode-jsonrpc';
2
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions } from './protocol';
1
+ import { RequestType, RequestHandler, ProgressType } from 'vscode-jsonrpc';
2
+ import { TextDocumentRegistrationOptions, StaticRegistrationOptions, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
3
3
  import { TextDocumentIdentifier, Range, Color, ColorInformation, ColorPresentation } from 'vscode-languageserver-types';
4
- export interface ColorClientCapabilities {
4
+ export interface DocumentColorClientCapabilities {
5
5
  /**
6
- * The text document client capabilities
6
+ * Whether implementation supports dynamic registration. If this is set to `true`
7
+ * the client supports the new `DocumentColorRegistrationOptions` return value
8
+ * for the corresponding server capability as well.
7
9
  */
8
- textDocument?: {
9
- /**
10
- * Capabilities specific to the colorProvider
11
- */
12
- colorProvider?: {
13
- /**
14
- * Whether implementation supports dynamic registration. If this is set to `true`
15
- * the client supports the new `(ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions)`
16
- * return value for the corresponding server capability as well.
17
- */
18
- dynamicRegistration?: boolean;
19
- };
20
- };
10
+ dynamicRegistration?: boolean;
21
11
  }
22
- export interface ColorProviderOptions {
23
- }
24
- export interface ColorServerCapabilities {
12
+ export interface DocumentColorOptions extends WorkDoneProgressOptions {
25
13
  /**
26
- * The server provides color provider support.
14
+ * Code lens has a resolve provider as well.
27
15
  */
28
- colorProvider?: boolean | ColorProviderOptions | (ColorProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
16
+ resolveProvider?: boolean;
17
+ }
18
+ export interface DocumentColorRegistrationOptions extends TextDocumentRegistrationOptions, StaticRegistrationOptions, DocumentColorOptions {
29
19
  }
30
20
  /**
31
21
  * Parameters for a [DocumentColorRequest](#DocumentColorRequest).
32
22
  */
33
- export interface DocumentColorParams {
23
+ export interface DocumentColorParams extends WorkDoneProgressParams, PartialResultParams {
34
24
  /**
35
25
  * The text document.
36
26
  */
@@ -43,12 +33,14 @@ export interface DocumentColorParams {
43
33
  * that resolves to such.
44
34
  */
45
35
  export declare namespace DocumentColorRequest {
46
- const type: RequestType<DocumentColorParams, ColorInformation[], void, TextDocumentRegistrationOptions>;
36
+ const type: RequestType<DocumentColorParams, ColorInformation[], void, DocumentColorRegistrationOptions>;
37
+ const resultType: ProgressType<ColorInformation[]>;
38
+ type HandlerSignature = RequestHandler<DocumentColorParams, ColorInformation[], void>;
47
39
  }
48
40
  /**
49
41
  * Parameters for a [ColorPresentationRequest](#ColorPresentationRequest).
50
42
  */
51
- export interface ColorPresentationParams {
43
+ export interface ColorPresentationParams extends WorkDoneProgressParams, PartialResultParams {
52
44
  /**
53
45
  * The text document.
54
46
  */
@@ -69,5 +61,6 @@ export interface ColorPresentationParams {
69
61
  * that resolves to such.
70
62
  */
71
63
  export declare namespace ColorPresentationRequest {
72
- const type: RequestType<ColorPresentationParams, ColorPresentation[], void, TextDocumentRegistrationOptions>;
64
+ const type: RequestType<ColorPresentationParams, ColorPresentation[], void, WorkDoneProgressOptions & TextDocumentRegistrationOptions>;
65
+ type HandlerSignature = RequestHandler<ColorPresentationParams, ColorPresentation[], void>;
73
66
  }
@@ -14,6 +14,7 @@ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
14
14
  var DocumentColorRequest;
15
15
  (function (DocumentColorRequest) {
16
16
  DocumentColorRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/documentColor');
17
+ DocumentColorRequest.resultType = new vscode_jsonrpc_1.ProgressType();
17
18
  })(DocumentColorRequest = exports.DocumentColorRequest || (exports.DocumentColorRequest = {}));
18
19
  /**
19
20
  * A request to list all presentation for a color. The request's
@@ -1,4 +1,5 @@
1
1
  import { RequestType, RequestHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
2
+ import { PartialResultParams } from './protocol';
2
3
  export interface ConfigurationClientCapabilities {
3
4
  /**
4
5
  * The workspace client capabilities
@@ -20,7 +21,7 @@ export interface ConfigurationClientCapabilities {
20
21
  * change event and empty the cache if such an event is received.
21
22
  */
22
23
  export declare namespace ConfigurationRequest {
23
- const type: RequestType<ConfigurationParams, any[], void, void>;
24
+ const type: RequestType<ConfigurationParams & PartialResultParams, any[], void, void>;
24
25
  type HandlerSignature = RequestHandler<ConfigurationParams, any[], void>;
25
26
  type MiddlewareSignature = (params: ConfigurationParams, token: CancellationToken, next: HandlerSignature) => HandlerResult<any[], void>;
26
27
  }