vscode-languageserver-protocol 3.15.0-next.1 → 3.15.0-next.13

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.
@@ -0,0 +1,115 @@
1
+ import { NotificationType, NotificationHandler, RequestType, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
2
+ export interface WorkDoneProgressClientCapabilities {
3
+ /**
4
+ * Window specific client capabilities.
5
+ */
6
+ window?: {
7
+ /**
8
+ * Whether client supports handling progress notifications. If set servers are allowed to
9
+ * report in `workDoneProgress` property in the request specific server capabilities.
10
+ *
11
+ * Since 3.15.0
12
+ */
13
+ workDoneProgress?: boolean;
14
+ };
15
+ }
16
+ export interface WorkDoneProgressBegin {
17
+ kind: 'begin';
18
+ /**
19
+ * Mandatory title of the progress operation. Used to briefly inform about
20
+ * the kind of operation being performed.
21
+ *
22
+ * Examples: "Indexing" or "Linking dependencies".
23
+ */
24
+ title: string;
25
+ /**
26
+ * Controls if a cancel button should show to allow the user to cancel the
27
+ * long running operation. Clients that don't support cancellation are allowed
28
+ * to ignore the setting.
29
+ */
30
+ cancellable?: boolean;
31
+ /**
32
+ * Optional, more detailed associated progress message. Contains
33
+ * complementary information to the `title`.
34
+ *
35
+ * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
36
+ * If unset, the previous progress message (if any) is still valid.
37
+ */
38
+ message?: string;
39
+ /**
40
+ * Optional progress percentage to display (value 100 is considered 100%).
41
+ * If not provided infinite progress is assumed and clients are allowed
42
+ * to ignore the `percentage` value in subsequent in report notifications.
43
+ *
44
+ * The value should be steadily rising. Clients are free to ignore values
45
+ * that are not following this rule.
46
+ */
47
+ percentage?: number;
48
+ }
49
+ export interface WorkDoneProgressReport {
50
+ kind: 'report';
51
+ /**
52
+ * Controls enablement state of a cancel button. This property is only valid if a cancel
53
+ * button got requested in the `WorkDoneProgressStart` payload.
54
+ *
55
+ * Clients that don't support cancellation or don't support control the button's
56
+ * enablement state are allowed to ignore the setting.
57
+ */
58
+ cancellable?: boolean;
59
+ /**
60
+ * Optional, more detailed associated progress message. Contains
61
+ * complementary information to the `title`.
62
+ *
63
+ * Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
64
+ * If unset, the previous progress message (if any) is still valid.
65
+ */
66
+ message?: string;
67
+ /**
68
+ * Optional progress percentage to display (value 100 is considered 100%).
69
+ * If not provided infinite progress is assumed and clients are allowed
70
+ * to ignore the `percentage` value in subsequent in report notifications.
71
+ *
72
+ * The value should be steadily rising. Clients are free to ignore values
73
+ * that are not following this rule.
74
+ */
75
+ percentage?: number;
76
+ }
77
+ export interface WorkDoneProgressEnd {
78
+ kind: 'end';
79
+ /**
80
+ * Optional, a final message indicating to for example indicate the outcome
81
+ * of the operation.
82
+ */
83
+ message?: string;
84
+ }
85
+ export declare namespace WorkDoneProgress {
86
+ const type: ProgressType<WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd>;
87
+ }
88
+ export interface WorkDoneProgressCreateParams {
89
+ /**
90
+ * The token to be used to report progress.
91
+ */
92
+ token: ProgressToken;
93
+ }
94
+ /**
95
+ * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
96
+ * reporting from the server.
97
+ */
98
+ export declare namespace WorkDoneProgressCreateRequest {
99
+ const type: RequestType<WorkDoneProgressCreateParams, void, void, void>;
100
+ type HandlerSignature = RequestHandler<WorkDoneProgressCreateParams, void, void>;
101
+ }
102
+ export interface WorkDoneProgressCancelParams {
103
+ /**
104
+ * The token to be used to report progress.
105
+ */
106
+ token: ProgressToken;
107
+ }
108
+ /**
109
+ * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
110
+ * initiated on the server side.
111
+ */
112
+ export declare namespace WorkDoneProgressCancelNotification {
113
+ const type: NotificationType<WorkDoneProgressCancelParams, void>;
114
+ type HandlerSignature = NotificationHandler<WorkDoneProgressCancelParams>;
115
+ }
@@ -0,0 +1,27 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
8
+ var WorkDoneProgress;
9
+ (function (WorkDoneProgress) {
10
+ WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();
11
+ })(WorkDoneProgress = exports.WorkDoneProgress || (exports.WorkDoneProgress = {}));
12
+ /**
13
+ * The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
14
+ * reporting from the server.
15
+ */
16
+ var WorkDoneProgressCreateRequest;
17
+ (function (WorkDoneProgressCreateRequest) {
18
+ WorkDoneProgressCreateRequest.type = new vscode_jsonrpc_1.RequestType('window/workDoneProgress/create');
19
+ })(WorkDoneProgressCreateRequest = exports.WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = {}));
20
+ /**
21
+ * The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
22
+ * initiated on the server side.
23
+ */
24
+ var WorkDoneProgressCancelNotification;
25
+ (function (WorkDoneProgressCancelNotification) {
26
+ WorkDoneProgressCancelNotification.type = new vscode_jsonrpc_1.NotificationType('window/workDoneProgress/cancel');
27
+ })(WorkDoneProgressCancelNotification = exports.WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = {}));
@@ -1,71 +1,39 @@
1
- import { RequestType } from 'vscode-jsonrpc';
2
- import { Range } from 'vscode-languageserver-types';
3
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams } from './protocol';
1
+ import { RequestType, RequestHandler, ProgressType } from 'vscode-jsonrpc';
2
+ import { TextDocumentIdentifier, Position, SelectionRange } from 'vscode-languageserver-types';
3
+ import { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistrationOptions, WorkDoneProgressParams, PartialResultParams } from './protocol';
4
4
  export interface SelectionRangeClientCapabilities {
5
5
  /**
6
- * The text document client capabilities
6
+ * Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
7
+ * the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
8
+ * capability as well.
7
9
  */
8
- textDocument?: {
9
- /**
10
- * Capabilities specific to `textDocument/selectionRange` requests
11
- */
12
- selectionRange?: {
13
- /**
14
- * Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
15
- * the client supports the new `(SelectionRangeProviderOptions & 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 SelectionRangeProviderOptions {
12
+ export interface SelectionRangeOptions extends WorkDoneProgressOptions {
23
13
  }
24
- export interface SelectionRangeServerCapabilities {
25
- /**
26
- * The server provides selection range support.
27
- */
28
- selectionRangeProvider?: boolean | SelectionRangeProviderOptions | (SelectionRangeProviderOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions);
29
- }
30
- /**
31
- * Enum of known selection range kinds
32
- */
33
- export declare enum SelectionRangeKind {
34
- /**
35
- * Empty Kind.
36
- */
37
- Empty = "",
38
- /**
39
- * The statment kind, its value is `statement`, possible extensions can be
40
- * `statement.if` etc
41
- */
42
- Statement = "statement",
43
- /**
44
- * The declaration kind, its value is `declaration`, possible extensions can be
45
- * `declaration.function`, `declaration.class` etc.
46
- */
47
- Declaration = "declaration"
14
+ export interface SelectionRangeRegistrationOptions extends SelectionRangeOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
48
15
  }
49
16
  /**
50
- * Represents a selection range
17
+ * A parameter literal used in selection range requests.
51
18
  */
52
- export interface SelectionRange {
19
+ export interface SelectionRangeParams extends WorkDoneProgressParams, PartialResultParams {
53
20
  /**
54
- * Range of the selection.
21
+ * The text document.
55
22
  */
56
- range: Range;
23
+ textDocument: TextDocumentIdentifier;
57
24
  /**
58
- * Describes the kind of the selection range such as `statemet' or 'declaration'. See
59
- * [SelectionRangeKind](#SelectionRangeKind) for an enumeration of standardized kinds.
25
+ * The positions inside the text document.
60
26
  */
61
- kind: string;
27
+ positions: Position[];
62
28
  }
63
29
  /**
64
30
  * A request to provide selection ranges in a document. The request's
65
- * parameter is of type [TextDocumentPositionParams](#TextDocumentPositionParams), the
31
+ * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the
66
32
  * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable
67
33
  * that resolves to such.
68
34
  */
69
35
  export declare namespace SelectionRangeRequest {
70
- const type: RequestType<TextDocumentPositionParams, SelectionRange[] | null, any, any>;
36
+ const type: RequestType<SelectionRangeParams, SelectionRange[] | null, any, SelectionRangeRegistrationOptions>;
37
+ const resultType: ProgressType<SelectionRange[]>;
38
+ type HandlerSignature = RequestHandler<SelectionRangeParams, SelectionRange[] | null, void>;
71
39
  }
@@ -5,33 +5,14 @@
5
5
  *--------------------------------------------------------------------------------------------*/
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const vscode_jsonrpc_1 = require("vscode-jsonrpc");
8
- /**
9
- * Enum of known selection range kinds
10
- */
11
- var SelectionRangeKind;
12
- (function (SelectionRangeKind) {
13
- /**
14
- * Empty Kind.
15
- */
16
- SelectionRangeKind["Empty"] = "";
17
- /**
18
- * The statment kind, its value is `statement`, possible extensions can be
19
- * `statement.if` etc
20
- */
21
- SelectionRangeKind["Statement"] = "statement";
22
- /**
23
- * The declaration kind, its value is `declaration`, possible extensions can be
24
- * `declaration.function`, `declaration.class` etc.
25
- */
26
- SelectionRangeKind["Declaration"] = "declaration";
27
- })(SelectionRangeKind = exports.SelectionRangeKind || (exports.SelectionRangeKind = {}));
28
8
  /**
29
9
  * A request to provide selection ranges in a document. The request's
30
- * parameter is of type [TextDocumentPositionParams](#TextDocumentPositionParams), the
10
+ * parameter is of type [SelectionRangeParams](#SelectionRangeParams), the
31
11
  * response is of type [SelectionRange[]](#SelectionRange[]) or a Thenable
32
12
  * that resolves to such.
33
13
  */
34
14
  var SelectionRangeRequest;
35
15
  (function (SelectionRangeRequest) {
36
16
  SelectionRangeRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/selectionRange');
17
+ SelectionRangeRequest.resultType = new vscode_jsonrpc_1.ProgressType();
37
18
  })(SelectionRangeRequest = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));
@@ -1,33 +1,28 @@
1
- import { RequestType, RequestHandler } from 'vscode-jsonrpc';
1
+ import { RequestType, RequestHandler, ProgressType } from 'vscode-jsonrpc';
2
2
  import { Definition, DefinitionLink, LocationLink, Location } from 'vscode-languageserver-types';
3
- import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams } from './protocol';
3
+ import { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
4
+ /**
5
+ * Since 3.6.0
6
+ */
4
7
  export interface TypeDefinitionClientCapabilities {
5
8
  /**
6
- * The text document client capabilities
9
+ * Whether implementation supports dynamic registration. If this is set to `true`
10
+ * the client supports the new `TypeDefinitionRegistrationOptions` return value
11
+ * for the corresponding server capability as well.
7
12
  */
8
- textDocument?: {
9
- /**
10
- * Capabilities specific to the `textDocument/typeDefinition`
11
- */
12
- typeDefinition?: {
13
- /**
14
- * Whether implementation supports dynamic registration. If this is set to `true`
15
- * the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
16
- * return value for the corresponding server capability as well.
17
- */
18
- dynamicRegistration?: boolean;
19
- /**
20
- * The client supports additional metadata in the form of definition links.
21
- */
22
- linkSupport?: boolean;
23
- };
24
- };
25
- }
26
- export interface TypeDefinitionServerCapabilities {
13
+ dynamicRegistration?: boolean;
27
14
  /**
28
- * The server provides Goto Type Definition support.
15
+ * The client supports additional metadata in the form of definition links.
16
+ *
17
+ * Since 3.14.0
29
18
  */
30
- typeDefinitionProvider?: boolean | (TextDocumentRegistrationOptions & StaticRegistrationOptions);
19
+ linkSupport?: boolean;
20
+ }
21
+ export interface TypeDefinitionOptions extends WorkDoneProgressOptions {
22
+ }
23
+ export interface TypeDefinitionRegistrationOptions extends TextDocumentRegistrationOptions, TypeDefinitionOptions, StaticRegistrationOptions {
24
+ }
25
+ export interface TypeDefinitionParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
31
26
  }
32
27
  /**
33
28
  * A request to resolve the type definition locations of a symbol at a given text
@@ -36,6 +31,7 @@ export interface TypeDefinitionServerCapabilities {
36
31
  * Thenable that resolves to such.
37
32
  */
38
33
  export declare namespace TypeDefinitionRequest {
39
- const type: RequestType<TextDocumentPositionParams, Location | Location[] | LocationLink[] | null, void, TextDocumentRegistrationOptions>;
40
- type HandlerSignature = RequestHandler<TextDocumentPositionParams, Definition | DefinitionLink[] | null, void>;
34
+ const type: RequestType<TypeDefinitionParams, Location | Location[] | LocationLink[] | null, void, TypeDefinitionRegistrationOptions>;
35
+ const resultType: ProgressType<LocationLink[] | Location[]>;
36
+ type HandlerSignature = RequestHandler<TypeDefinitionParams, Definition | DefinitionLink[] | null, void>;
41
37
  }
@@ -16,4 +16,5 @@ let __noDynamicImport;
16
16
  var TypeDefinitionRequest;
17
17
  (function (TypeDefinitionRequest) {
18
18
  TypeDefinitionRequest.type = new vscode_jsonrpc_1.RequestType('textDocument/typeDefinition');
19
+ TypeDefinitionRequest.resultType = new vscode_jsonrpc_1.ProgressType();
19
20
  })(TypeDefinitionRequest = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));
package/lib/utils/is.d.ts CHANGED
@@ -6,4 +6,4 @@ export declare function func(value: any): value is Function;
6
6
  export declare function array<T>(value: any): value is T[];
7
7
  export declare function stringArray(value: any): value is string[];
8
8
  export declare function typedArray<T>(value: any, check: (value: any) => boolean): value is T[];
9
- export declare function thenable<T>(value: any): value is Thenable<T>;
9
+ export declare function objectLiteral(value: any): value is object;
package/lib/utils/is.js CHANGED
@@ -36,7 +36,10 @@ function typedArray(value, check) {
36
36
  return Array.isArray(value) && value.every(check);
37
37
  }
38
38
  exports.typedArray = typedArray;
39
- function thenable(value) {
40
- return value && func(value.then);
39
+ function objectLiteral(value) {
40
+ // Strictly speaking class instances pass this check as well. Since the LSP
41
+ // doesn't use classes we ignore this for now. If we do we need to add something
42
+ // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
43
+ return value !== null && typeof value === 'object';
41
44
  }
42
- exports.thenable = thenable;
45
+ exports.objectLiteral = objectLiteral;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vscode-languageserver-protocol",
3
3
  "description": "VSCode Language Server Protocol implementation",
4
- "version": "3.15.0-next.1",
4
+ "version": "3.15.0-next.13",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -15,14 +15,14 @@
15
15
  "main": "./lib/main.js",
16
16
  "typings": "./lib/main",
17
17
  "dependencies": {
18
- "vscode-jsonrpc": "^4.0.0",
19
- "vscode-languageserver-types": "3.14.0"
18
+ "vscode-jsonrpc": "^5.0.0-next.5",
19
+ "vscode-languageserver-types": "^3.15.0-next.9"
20
20
  },
21
21
  "scripts": {
22
22
  "prepublishOnly": "npm run clean && npm run compile && npm test",
23
23
  "postpublish": "node ../build/npm/post-publish.js",
24
- "compile": "node ../build/bin/tsc -p ./tsconfig.json",
25
- "watch": "node ../build/bin/tsc -w -p ./tsconfig.json",
24
+ "compile": "node ../build/bin/tsc -b ./tsconfig.json",
25
+ "watch": "node ../build/bin/tsc -b ./tsconfig.json -w",
26
26
  "test": "node ../node_modules/mocha/bin/_mocha",
27
27
  "clean": "node ../node_modules/rimraf/bin.js lib",
28
28
  "preversion": "npm test"