vscode-languageserver-protocol 3.12.0 → 3.13.0

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/main.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, 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, Tracer } from 'vscode-jsonrpc';
2
- export { ErrorCodes, ResponseError, CancellationToken, CancellationTokenSource, Disposable, Event, Emitter, Trace, 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, Tracer };
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, };
3
3
  export * from 'vscode-languageserver-types';
4
4
  export * from './protocol';
5
+ export { FoldingRangeParams as FoldingRangeRequestParam } from './protocol';
5
6
  export declare namespace Proposed {
6
7
  }
7
8
  export interface ProtocolConnection {
@@ -111,6 +112,7 @@ export interface ProtocolConnection {
111
112
  * Enables tracing mode for the connection.
112
113
  */
113
114
  trace(value: Trace, tracer: Tracer, sendNotification?: boolean): void;
115
+ trace(value: Trace, tracer: Tracer, traceOptions?: TraceOptions): void;
114
116
  /**
115
117
  * An event emitter firing when an error occurs on the connection.
116
118
  */
package/lib/main.js CHANGED
@@ -16,6 +16,7 @@ exports.Disposable = vscode_jsonrpc_1.Disposable;
16
16
  exports.Event = vscode_jsonrpc_1.Event;
17
17
  exports.Emitter = vscode_jsonrpc_1.Emitter;
18
18
  exports.Trace = vscode_jsonrpc_1.Trace;
19
+ exports.TraceFormat = vscode_jsonrpc_1.TraceFormat;
19
20
  exports.SetTraceNotification = vscode_jsonrpc_1.SetTraceNotification;
20
21
  exports.LogTraceNotification = vscode_jsonrpc_1.LogTraceNotification;
21
22
  exports.RequestType = vscode_jsonrpc_1.RequestType;
@@ -13,6 +13,11 @@ export interface ConfigurationClientCapabilities {
13
13
  /**
14
14
  * The 'workspace/configuration' request is sent from the server to the client to fetch a certain
15
15
  * configuration setting.
16
+ *
17
+ * This pull model replaces the old push model were the client signaled configuration change via an
18
+ * event. If the server still needs to react to configuration changes (since the server caches the
19
+ * result of `workspace/configuration` requests) the server should register for an empty configuration
20
+ * change event and empty the cache if such an event is received.
16
21
  */
17
22
  export declare namespace ConfigurationRequest {
18
23
  const type: RequestType<ConfigurationParams, any[], void, void>;
@@ -8,6 +8,11 @@ const vscode_jsonrpc_1 = require("vscode-jsonrpc");
8
8
  /**
9
9
  * The 'workspace/configuration' request is sent from the server to the client to fetch a certain
10
10
  * configuration setting.
11
+ *
12
+ * This pull model replaces the old push model were the client signaled configuration change via an
13
+ * event. If the server still needs to react to configuration changes (since the server caches the
14
+ * result of `workspace/configuration` requests) the server should register for an empty configuration
15
+ * change event and empty the cache if such an event is received.
11
16
  */
12
17
  var ConfigurationRequest;
13
18
  (function (ConfigurationRequest) {
package/lib/protocol.d.ts CHANGED
@@ -5,7 +5,7 @@ import { TypeDefinitionRequest, TypeDefinitionClientCapabilities, TypeDefinition
5
5
  import { WorkspaceFoldersRequest, DidChangeWorkspaceFoldersNotification, DidChangeWorkspaceFoldersParams, WorkspaceFolder, WorkspaceFoldersChangeEvent, WorkspaceFoldersInitializeParams, WorkspaceFoldersClientCapabilities, WorkspaceFoldersServerCapabilities } from './protocol.workspaceFolders';
6
6
  import { ConfigurationRequest, ConfigurationParams, ConfigurationItem, ConfigurationClientCapabilities } from './protocol.configuration';
7
7
  import { DocumentColorRequest, ColorPresentationRequest, ColorProviderOptions, DocumentColorParams, ColorPresentationParams, ColorServerCapabilities, ColorClientCapabilities } from './protocol.colorProvider';
8
- import { FoldingRangeClientCapabilities, FoldingRangeProviderOptions, FoldingRangeRequest, FoldingRangeRequestParam, FoldingRangeServerCapabilities } from './protocol.foldingRange';
8
+ import { FoldingRangeClientCapabilities, FoldingRangeProviderOptions, FoldingRangeRequest, FoldingRangeParams, FoldingRangeServerCapabilities } from './protocol.foldingRange';
9
9
  /**
10
10
  * A document filter denotes a document by different properties like
11
11
  * the [language](#TextDocument.languageId), the [scheme](#Uri.scheme) of
@@ -111,6 +111,48 @@ export interface TextDocumentPositionParams {
111
111
  */
112
112
  position: Position;
113
113
  }
114
+ /**
115
+ * The kind of resource operations supported by the client.
116
+ */
117
+ export declare type ResourceOperationKind = 'create' | 'rename' | 'delete';
118
+ export declare namespace ResourceOperationKind {
119
+ /**
120
+ * Supports creating new resources.
121
+ */
122
+ const Create: ResourceOperationKind;
123
+ /**
124
+ * Supports renaming existing resources.
125
+ */
126
+ const Rename: ResourceOperationKind;
127
+ /**
128
+ * Supports deleting existing resources.
129
+ */
130
+ const Delete: ResourceOperationKind;
131
+ }
132
+ export declare type FailureHandlingKind = 'abort' | 'transactional' | 'undo' | 'textOnlyTransactional';
133
+ export declare namespace FailureHandlingKind {
134
+ /**
135
+ * Applying the workspace change is simply aborted if one of the changes provided
136
+ * fails. All operations executed before the failing operation stay executed.
137
+ */
138
+ const Abort: FailureHandlingKind;
139
+ /**
140
+ * All operations are executed transactional. That means they either all
141
+ * succeed or no changes at all are applied to the workspace.
142
+ */
143
+ const Transactional: FailureHandlingKind;
144
+ /**
145
+ * If the workspace edit contains only textual file changes they are executed transactional.
146
+ * If resource changes (create, rename or delete file) are part of the change the failure
147
+ * handling startegy is abort.
148
+ */
149
+ const TextOnlyTransactional: FailureHandlingKind;
150
+ /**
151
+ * The client tries to undo the operations already executed. But there is no
152
+ * guaruntee that this is succeeding.
153
+ */
154
+ const Undo: FailureHandlingKind;
155
+ }
114
156
  /**
115
157
  * Workspace specific client capabilities.
116
158
  */
@@ -129,6 +171,16 @@ export interface WorkspaceClientCapabilities {
129
171
  * The client supports versioned document changes in `WorkspaceEdit`s
130
172
  */
131
173
  documentChanges?: boolean;
174
+ /**
175
+ * The resource operations the client supports. Clients should at least
176
+ * support 'create', 'rename' and 'delete'.
177
+ */
178
+ resourceOperations?: ResourceOperationKind[];
179
+ /**
180
+ * The failure handling strategy of a client if applying the workspace edit
181
+ * failes.
182
+ */
183
+ failureHandling?: FailureHandlingKind;
132
184
  };
133
185
  /**
134
186
  * Capabilities specific to the `workspace/didChangeConfiguration` notification.
@@ -996,7 +1048,7 @@ export interface DidChangeTextDocumentParams {
996
1048
  /**
997
1049
  * The actual content changes. The content changes describe single state changes
998
1050
  * to the document. So if there are two content changes c1 and c2 for a document
999
- * in state S10 then c1 move the document to S11 and c2 to S12.
1051
+ * in state S then c1 move the document to S' and c2 to S''.
1000
1052
  */
1001
1053
  contentChanges: TextDocumentContentChangeEvent[];
1002
1054
  }
@@ -1556,6 +1608,12 @@ export interface ApplyWorkspaceEditResponse {
1556
1608
  * Indicates whether the edit was applied or not.
1557
1609
  */
1558
1610
  applied: boolean;
1611
+ /**
1612
+ * Depending on the client's failure handling strategy `failedChange` might
1613
+ * contain the index of the change that failed. This property is only available
1614
+ * if the client signals a `failureHandlingStrategy` in its client capabilities.
1615
+ */
1616
+ failedChange?: number;
1559
1617
  }
1560
1618
  /**
1561
1619
  * A request sent from the server to the client to modified certain resources.
@@ -1563,4 +1621,4 @@ export interface ApplyWorkspaceEditResponse {
1563
1621
  export declare namespace ApplyWorkspaceEditRequest {
1564
1622
  const type: RequestType<ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, void, void>;
1565
1623
  }
1566
- export { ImplementationRequest, TypeDefinitionRequest, WorkspaceFoldersRequest, DidChangeWorkspaceFoldersNotification, DidChangeWorkspaceFoldersParams, WorkspaceFolder, WorkspaceFoldersChangeEvent, ConfigurationRequest, ConfigurationParams, ConfigurationItem, DocumentColorRequest, ColorPresentationRequest, ColorProviderOptions, DocumentColorParams, ColorPresentationParams, FoldingRangeClientCapabilities, FoldingRangeProviderOptions, FoldingRangeRequest, FoldingRangeRequestParam, FoldingRangeServerCapabilities };
1624
+ export { ImplementationRequest, TypeDefinitionRequest, WorkspaceFoldersRequest, DidChangeWorkspaceFoldersNotification, DidChangeWorkspaceFoldersParams, WorkspaceFolder, WorkspaceFoldersChangeEvent, ConfigurationRequest, ConfigurationParams, ConfigurationItem, DocumentColorRequest, ColorPresentationRequest, ColorProviderOptions, DocumentColorParams, ColorPresentationParams, FoldingRangeClientCapabilities, FoldingRangeProviderOptions, FoldingRangeRequest, FoldingRangeParams, FoldingRangeServerCapabilities };
@@ -84,7 +84,7 @@ export interface FoldingRange {
84
84
  /**
85
85
  * Parameters for a [FoldingRangeRequest](#FoldingRangeRequest).
86
86
  */
87
- export interface FoldingRangeRequestParam {
87
+ export interface FoldingRangeParams {
88
88
  /**
89
89
  * The text document.
90
90
  */
@@ -92,10 +92,10 @@ export interface FoldingRangeRequestParam {
92
92
  }
93
93
  /**
94
94
  * A request to provide folding ranges in a document. The request's
95
- * parameter is of type [FoldingRangeRequestParam](#FoldingRangeRequestParam), the
95
+ * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the
96
96
  * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable
97
97
  * that resolves to such.
98
98
  */
99
99
  export declare namespace FoldingRangeRequest {
100
- const type: RequestType<FoldingRangeRequestParam, FoldingRange[] | null, any, any>;
100
+ const type: RequestType<FoldingRangeParams, FoldingRange[] | null, any, any>;
101
101
  }
@@ -25,7 +25,7 @@ var FoldingRangeKind;
25
25
  })(FoldingRangeKind = exports.FoldingRangeKind || (exports.FoldingRangeKind = {}));
26
26
  /**
27
27
  * A request to provide folding ranges in a document. The request's
28
- * parameter is of type [FoldingRangeRequestParam](#FoldingRangeRequestParam), the
28
+ * parameter is of type [FoldingRangeParams](#FoldingRangeParams), the
29
29
  * response is of type [FoldingRangeList](#FoldingRangeList) or a Thenable
30
30
  * that resolves to such.
31
31
  */
package/lib/protocol.js CHANGED
@@ -44,6 +44,45 @@ var UnregistrationRequest;
44
44
  (function (UnregistrationRequest) {
45
45
  UnregistrationRequest.type = new vscode_jsonrpc_1.RequestType('client/unregisterCapability');
46
46
  })(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));
47
+ var ResourceOperationKind;
48
+ (function (ResourceOperationKind) {
49
+ /**
50
+ * Supports creating new resources.
51
+ */
52
+ ResourceOperationKind.Create = 'create';
53
+ /**
54
+ * Supports renaming existing resources.
55
+ */
56
+ ResourceOperationKind.Rename = 'rename';
57
+ /**
58
+ * Supports deleting existing resources.
59
+ */
60
+ ResourceOperationKind.Delete = 'delete';
61
+ })(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));
62
+ var FailureHandlingKind;
63
+ (function (FailureHandlingKind) {
64
+ /**
65
+ * Applying the workspace change is simply aborted if one of the changes provided
66
+ * fails. All operations executed before the failing operation stay executed.
67
+ */
68
+ FailureHandlingKind.Abort = 'abort';
69
+ /**
70
+ * All operations are executed transactional. That means they either all
71
+ * succeed or no changes at all are applied to the workspace.
72
+ */
73
+ FailureHandlingKind.Transactional = 'transactional';
74
+ /**
75
+ * If the workspace edit contains only textual file changes they are executed transactional.
76
+ * If resource changes (create, rename or delete file) are part of the change the failure
77
+ * handling startegy is abort.
78
+ */
79
+ FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';
80
+ /**
81
+ * The client tries to undo the operations already executed. But there is no
82
+ * guaruntee that this is succeeding.
83
+ */
84
+ FailureHandlingKind.Undo = 'undo';
85
+ })(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));
47
86
  /**
48
87
  * Defines how the host (editor) should sync
49
88
  * document changes to the language server.
package/lib/utils/is.js CHANGED
@@ -4,25 +4,24 @@
4
4
  * ------------------------------------------------------------------------------------------ */
5
5
  'use strict';
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- const toString = Object.prototype.toString;
8
7
  function boolean(value) {
9
8
  return value === true || value === false;
10
9
  }
11
10
  exports.boolean = boolean;
12
11
  function string(value) {
13
- return toString.call(value) === '[object String]';
12
+ return typeof value === 'string' || value instanceof String;
14
13
  }
15
14
  exports.string = string;
16
15
  function number(value) {
17
- return toString.call(value) === '[object Number]';
16
+ return typeof value === 'number' || value instanceof Number;
18
17
  }
19
18
  exports.number = number;
20
19
  function error(value) {
21
- return toString.call(value) === '[object Error]';
20
+ return value instanceof Error;
22
21
  }
23
22
  exports.error = error;
24
23
  function func(value) {
25
- return toString.call(value) === '[object Function]';
24
+ return typeof value === 'function';
26
25
  }
27
26
  exports.func = func;
28
27
  function array(value) {
package/package.json CHANGED
@@ -1,29 +1,29 @@
1
- {
2
- "name": "vscode-languageserver-protocol",
3
- "description": "VSCode Language Server Protocol implementation",
4
- "version": "3.12.0",
5
- "author": "Microsoft Corporation",
6
- "license": "MIT",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com/Microsoft/vscode-languageserver-node.git"
10
- },
11
- "bugs": {
12
- "url": "https://github.com/Microsoft/vscode-languageserver-node/issues"
13
- },
14
- "main": "./lib/main.js",
15
- "typings": "./lib/main",
16
- "dependencies": {
17
- "vscode-jsonrpc": "^3.6.2",
18
- "vscode-languageserver-types": "^3.12.0"
19
- },
20
- "scripts": {
21
- "prepublishOnly": "npm run clean && npm run compile && npm test",
22
- "postpublish": "node ../build/npm/post-publish.js",
23
- "compile": "node ../build/bin/tsc -p ./tsconfig.json",
24
- "watch": "node ../build/bin/tsc -w -p ./tsconfig.json",
25
- "test": "node ../node_modules/mocha/bin/_mocha",
26
- "clean": "node ../node_modules/rimraf/bin.js lib",
27
- "preversion": "npm test"
28
- }
29
- }
1
+ {
2
+ "name": "vscode-languageserver-protocol",
3
+ "description": "VSCode Language Server Protocol implementation",
4
+ "version": "3.13.0",
5
+ "author": "Microsoft Corporation",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Microsoft/vscode-languageserver-node.git"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/Microsoft/vscode-languageserver-node/issues"
13
+ },
14
+ "main": "./lib/main.js",
15
+ "typings": "./lib/main",
16
+ "dependencies": {
17
+ "vscode-jsonrpc": "^4.0.0",
18
+ "vscode-languageserver-types": "3.13.0"
19
+ },
20
+ "scripts": {
21
+ "prepublishOnly": "npm run clean && npm run compile && npm test",
22
+ "postpublish": "node ../build/npm/post-publish.js",
23
+ "compile": "node ../build/bin/tsc -p ./tsconfig.json",
24
+ "watch": "node ../build/bin/tsc -w -p ./tsconfig.json",
25
+ "test": "node ../node_modules/mocha/bin/_mocha",
26
+ "clean": "node ../node_modules/rimraf/bin.js lib",
27
+ "preversion": "npm test"
28
+ }
29
+ }