vscode-languageserver-protocol 3.17.6-next.9 → 3.18.1

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/README.md +3 -3
  2. package/eslint.config.js +13 -0
  3. package/lib/browser/main.js +1 -2
  4. package/lib/common/connection.d.ts +13 -13
  5. package/lib/common/connection.js +1 -2
  6. package/lib/common/messages.d.ts +7 -0
  7. package/lib/common/messages.js +8 -1
  8. package/lib/common/protocol.callHierarchy.d.ts +5 -2
  9. package/lib/common/protocol.callHierarchy.js +3 -0
  10. package/lib/common/protocol.colorProvider.d.ts +5 -3
  11. package/lib/common/protocol.colorProvider.js +3 -1
  12. package/lib/common/protocol.configuration.d.ts +2 -1
  13. package/lib/common/protocol.configuration.js +1 -0
  14. package/lib/common/protocol.d.ts +100 -37
  15. package/lib/common/protocol.declaration.d.ts +3 -2
  16. package/lib/common/protocol.declaration.js +1 -0
  17. package/lib/common/protocol.diagnostic.d.ts +32 -4
  18. package/lib/common/protocol.diagnostic.js +21 -7
  19. package/lib/common/protocol.fileOperations.d.ts +8 -2
  20. package/lib/common/protocol.fileOperations.js +6 -0
  21. package/lib/common/protocol.foldingRange.d.ts +6 -5
  22. package/lib/common/protocol.foldingRange.js +4 -1
  23. package/lib/common/protocol.implementation.d.ts +3 -2
  24. package/lib/common/protocol.implementation.js +1 -0
  25. package/lib/common/protocol.inlayHint.d.ts +5 -2
  26. package/lib/common/protocol.inlayHint.js +3 -0
  27. package/lib/common/protocol.inlineCompletion.d.ts +3 -7
  28. package/lib/common/protocol.inlineCompletion.js +1 -1
  29. package/lib/common/protocol.inlineValue.d.ts +6 -4
  30. package/lib/common/protocol.inlineValue.js +2 -0
  31. package/lib/common/protocol.js +53 -10
  32. package/lib/common/protocol.linkedEditingRange.d.ts +3 -2
  33. package/lib/common/protocol.linkedEditingRange.js +1 -0
  34. package/lib/common/protocol.moniker.d.ts +3 -2
  35. package/lib/common/protocol.moniker.js +1 -0
  36. package/lib/common/protocol.notebook.js +17 -7
  37. package/lib/common/protocol.progress.d.ts +2 -1
  38. package/lib/common/protocol.progress.js +1 -0
  39. package/lib/common/protocol.selectionRange.d.ts +3 -2
  40. package/lib/common/protocol.selectionRange.js +1 -0
  41. package/lib/common/protocol.semanticTokens.d.ts +6 -2
  42. package/lib/common/protocol.semanticTokens.js +4 -0
  43. package/lib/common/protocol.showDocument.d.ts +2 -1
  44. package/lib/common/protocol.showDocument.js +1 -0
  45. package/lib/common/protocol.textDocumentContent.d.ts +21 -13
  46. package/lib/common/protocol.textDocumentContent.js +1 -2
  47. package/lib/common/protocol.typeDefinition.d.ts +3 -2
  48. package/lib/common/protocol.typeDefinition.js +2 -1
  49. package/lib/common/protocol.typeHierarchy.d.ts +3 -2
  50. package/lib/common/protocol.typeHierarchy.js +1 -0
  51. package/lib/common/protocol.workspaceFolder.d.ts +3 -1
  52. package/lib/common/protocol.workspaceFolder.js +2 -0
  53. package/lib/common/utils/is.js +9 -10
  54. package/lib/node/main.d.ts +0 -1
  55. package/lib/node/main.js +1 -2
  56. package/metaModel.schema.json +18 -1
  57. package/package.json +4 -4
@@ -1,12 +1,11 @@
1
1
  import type { DocumentUri } from 'vscode-languageserver-types';
2
2
  import type { RequestHandler } from 'vscode-jsonrpc';
3
- import { MessageDirection, ProtocolRequestType } from './messages';
4
- import type { StaticRegistrationOptions } from './protocol';
3
+ import { MessageDirection, ProtocolRequestType, CM } from './messages';
4
+ import { type StaticRegistrationOptions } from './protocol';
5
5
  /**
6
6
  * Client capabilities for a text document content provider.
7
7
  *
8
8
  * @since 3.18.0
9
- * @proposed
10
9
  */
11
10
  export type TextDocumentContentClientCapabilities = {
12
11
  /**
@@ -18,26 +17,23 @@ export type TextDocumentContentClientCapabilities = {
18
17
  * Text document content provider options.
19
18
  *
20
19
  * @since 3.18.0
21
- * @proposed
22
20
  */
23
21
  export type TextDocumentContentOptions = {
24
22
  /**
25
- * The scheme for which the server provides content.
23
+ * The schemes for which the server provides content.
26
24
  */
27
- scheme: string;
25
+ schemes: string[];
28
26
  };
29
27
  /**
30
28
  * Text document content provider registration options.
31
29
  *
32
30
  * @since 3.18.0
33
- * @proposed
34
31
  */
35
32
  export type TextDocumentContentRegistrationOptions = TextDocumentContentOptions & StaticRegistrationOptions;
36
33
  /**
37
34
  * Parameters for the `workspace/textDocumentContent` request.
38
35
  *
39
36
  * @since 3.18.0
40
- * @proposed
41
37
  */
42
38
  export interface TextDocumentContentParams {
43
39
  /**
@@ -45,24 +41,37 @@ export interface TextDocumentContentParams {
45
41
  */
46
42
  uri: DocumentUri;
47
43
  }
44
+ /**
45
+ * Result of the `workspace/textDocumentContent` request.
46
+ *
47
+ * @since 3.18.0
48
+ */
49
+ export interface TextDocumentContentResult {
50
+ /**
51
+ * The text content of the text document. Please note, that the content of
52
+ * any subsequent open notifications for the text document might differ
53
+ * from the returned content due to whitespace and line ending
54
+ * normalizations done on the client
55
+ */
56
+ text: string;
57
+ }
48
58
  /**
49
59
  * The `workspace/textDocumentContent` request is sent from the client to the
50
60
  * server to request the content of a text document.
51
61
  *
52
62
  * @since 3.18.0
53
- * @proposed
54
63
  */
55
64
  export declare namespace TextDocumentContentRequest {
56
65
  const method: 'workspace/textDocumentContent';
57
66
  const messageDirection: MessageDirection;
58
- const type: ProtocolRequestType<TextDocumentContentParams, string, void, void, TextDocumentContentRegistrationOptions>;
59
- type HandlerSignature = RequestHandler<TextDocumentContentParams, string, void>;
67
+ const type: ProtocolRequestType<TextDocumentContentParams, TextDocumentContentResult, void, void, TextDocumentContentRegistrationOptions>;
68
+ type HandlerSignature = RequestHandler<TextDocumentContentParams, TextDocumentContentResult, void>;
69
+ const capabilities: CM<"workspace.textDocumentContent", "workspace.textDocumentContent">;
60
70
  }
61
71
  /**
62
72
  * Parameters for the `workspace/textDocumentContent/refresh` request.
63
73
  *
64
74
  * @since 3.18.0
65
- * @proposed
66
75
  */
67
76
  export interface TextDocumentContentRefreshParams {
68
77
  /**
@@ -75,7 +84,6 @@ export interface TextDocumentContentRefreshParams {
75
84
  * the content of a specific text document.
76
85
  *
77
86
  * @since 3.18.0
78
- * @proposed
79
87
  */
80
88
  export declare namespace TextDocumentContentRefreshRequest {
81
89
  const method: `workspace/textDocumentContent/refresh`;
@@ -11,20 +11,19 @@ const messages_1 = require("./messages");
11
11
  * server to request the content of a text document.
12
12
  *
13
13
  * @since 3.18.0
14
- * @proposed
15
14
  */
16
15
  var TextDocumentContentRequest;
17
16
  (function (TextDocumentContentRequest) {
18
17
  TextDocumentContentRequest.method = 'workspace/textDocumentContent';
19
18
  TextDocumentContentRequest.messageDirection = messages_1.MessageDirection.clientToServer;
20
19
  TextDocumentContentRequest.type = new messages_1.ProtocolRequestType(TextDocumentContentRequest.method);
20
+ TextDocumentContentRequest.capabilities = messages_1.CM.create('workspace.textDocumentContent', 'workspace.textDocumentContent');
21
21
  })(TextDocumentContentRequest || (exports.TextDocumentContentRequest = TextDocumentContentRequest = {}));
22
22
  /**
23
23
  * The `workspace/textDocumentContent` request is sent from the server to the client to refresh
24
24
  * the content of a specific text document.
25
25
  *
26
26
  * @since 3.18.0
27
- * @proposed
28
27
  */
29
28
  var TextDocumentContentRefreshRequest;
30
29
  (function (TextDocumentContentRefreshRequest) {
@@ -1,7 +1,7 @@
1
1
  import { RequestHandler } from 'vscode-jsonrpc';
2
2
  import { Definition, DefinitionLink, LocationLink, Location } from 'vscode-languageserver-types';
3
- import { MessageDirection, ProtocolRequestType } from './messages';
4
- import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
3
+ import { MessageDirection, ProtocolRequestType, CM } from './messages';
4
+ import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
5
5
  /**
6
6
  * Since 3.6.0
7
7
  */
@@ -35,4 +35,5 @@ export declare namespace TypeDefinitionRequest {
35
35
  const messageDirection: MessageDirection;
36
36
  const type: ProtocolRequestType<TypeDefinitionParams, Definition | LocationLink[] | null, Location[] | LocationLink[], void, TypeDefinitionRegistrationOptions>;
37
37
  type HandlerSignature = RequestHandler<TypeDefinitionParams, Definition | DefinitionLink[] | null, void>;
38
+ const capabilities: CM<"textDocument.typeDefinition", "typeDefinitionProvider">;
38
39
  }
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.TypeDefinitionRequest = void 0;
8
8
  const messages_1 = require("./messages");
9
- // @ts-ignore: to avoid inlining LocatioLink as dynamic import
9
+ // @ts-ignore: to avoid inlining LocationLink as dynamic import
10
10
  let __noDynamicImport;
11
11
  /**
12
12
  * A request to resolve the type definition locations of a symbol at a given text
@@ -18,4 +18,5 @@ var TypeDefinitionRequest;
18
18
  TypeDefinitionRequest.method = 'textDocument/typeDefinition';
19
19
  TypeDefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
20
20
  TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);
21
+ TypeDefinitionRequest.capabilities = messages_1.CM.create('textDocument.typeDefinition', 'typeDefinitionProvider');
21
22
  })(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));
@@ -1,7 +1,7 @@
1
1
  import { RequestHandler } from 'vscode-jsonrpc';
2
2
  import { TypeHierarchyItem } from 'vscode-languageserver-types';
3
- import { MessageDirection, ProtocolRequestType } from './messages';
4
- import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
3
+ import { MessageDirection, ProtocolRequestType, CM } from './messages';
4
+ import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
5
5
  /**
6
6
  * @since 3.17.0
7
7
  */
@@ -42,6 +42,7 @@ export declare namespace TypeHierarchyPrepareRequest {
42
42
  const messageDirection: MessageDirection;
43
43
  const type: ProtocolRequestType<TypeHierarchyPrepareParams, TypeHierarchyItem[] | null, never, void, TypeHierarchyRegistrationOptions>;
44
44
  type HandlerSignature = RequestHandler<TypeHierarchyPrepareParams, TypeHierarchyItem[] | null, void>;
45
+ const capabilities: CM<"textDocument.typeHierarchy", "typeHierarchyProvider">;
45
46
  }
46
47
  /**
47
48
  * The parameter of a `typeHierarchy/supertypes` request.
@@ -17,6 +17,7 @@ var TypeHierarchyPrepareRequest;
17
17
  TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy';
18
18
  TypeHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;
19
19
  TypeHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(TypeHierarchyPrepareRequest.method);
20
+ TypeHierarchyPrepareRequest.capabilities = messages_1.CM.create('textDocument.typeHierarchy', 'typeHierarchyProvider');
20
21
  })(TypeHierarchyPrepareRequest || (exports.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {}));
21
22
  /**
22
23
  * A request to resolve the supertypes for a given `TypeHierarchyItem`.
@@ -1,6 +1,6 @@
1
1
  import { WorkspaceFolder } from 'vscode-languageserver-types';
2
2
  import { RequestHandler0, NotificationHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
3
- import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType } from './messages';
3
+ import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType, CM } from './messages';
4
4
  export interface WorkspaceFoldersInitializeParams {
5
5
  /**
6
6
  * The workspace folders configured in the client when the server starts.
@@ -38,6 +38,7 @@ export declare namespace WorkspaceFoldersRequest {
38
38
  const type: ProtocolRequestType0<WorkspaceFolder[] | null, never, void, void>;
39
39
  type HandlerSignature = RequestHandler0<WorkspaceFolder[] | null, void>;
40
40
  type MiddlewareSignature = (token: CancellationToken, next: HandlerSignature) => HandlerResult<WorkspaceFolder[] | null, void>;
41
+ const capabilities: CM<"workspace.workspaceFolders", "workspace.workspaceFolders">;
41
42
  }
42
43
  /**
43
44
  * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
@@ -49,6 +50,7 @@ export declare namespace DidChangeWorkspaceFoldersNotification {
49
50
  const type: ProtocolNotificationType<DidChangeWorkspaceFoldersParams, void>;
50
51
  type HandlerSignature = NotificationHandler<DidChangeWorkspaceFoldersParams>;
51
52
  type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
53
+ const capabilities: CM<undefined, "workspace.workspaceFolders.changeNotifications">;
52
54
  }
53
55
  /**
54
56
  * The parameters of a `workspace/didChangeWorkspaceFolders` notification.
@@ -14,6 +14,7 @@ var WorkspaceFoldersRequest;
14
14
  WorkspaceFoldersRequest.method = 'workspace/workspaceFolders';
15
15
  WorkspaceFoldersRequest.messageDirection = messages_1.MessageDirection.serverToClient;
16
16
  WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0(WorkspaceFoldersRequest.method);
17
+ WorkspaceFoldersRequest.capabilities = messages_1.CM.create('workspace.workspaceFolders', 'workspace.workspaceFolders');
17
18
  })(WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {}));
18
19
  /**
19
20
  * The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
@@ -24,4 +25,5 @@ var DidChangeWorkspaceFoldersNotification;
24
25
  DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders';
25
26
  DidChangeWorkspaceFoldersNotification.messageDirection = messages_1.MessageDirection.clientToServer;
26
27
  DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method);
28
+ DidChangeWorkspaceFoldersNotification.capabilities = messages_1.CM.create(undefined, 'workspace.workspaceFolders.changeNotifications');
27
29
  })(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));
@@ -4,43 +4,42 @@
4
4
  * ------------------------------------------------------------------------------------------ */
5
5
  'use strict';
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.objectLiteral = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;
7
+ exports.boolean = boolean;
8
+ exports.string = string;
9
+ exports.number = number;
10
+ exports.error = error;
11
+ exports.func = func;
12
+ exports.array = array;
13
+ exports.stringArray = stringArray;
14
+ exports.typedArray = typedArray;
15
+ exports.objectLiteral = objectLiteral;
8
16
  function boolean(value) {
9
17
  return value === true || value === false;
10
18
  }
11
- exports.boolean = boolean;
12
19
  function string(value) {
13
20
  return typeof value === 'string' || value instanceof String;
14
21
  }
15
- exports.string = string;
16
22
  function number(value) {
17
23
  return typeof value === 'number' || value instanceof Number;
18
24
  }
19
- exports.number = number;
20
25
  function error(value) {
21
26
  return value instanceof Error;
22
27
  }
23
- exports.error = error;
24
28
  function func(value) {
25
29
  return typeof value === 'function';
26
30
  }
27
- exports.func = func;
28
31
  function array(value) {
29
32
  return Array.isArray(value);
30
33
  }
31
- exports.array = array;
32
34
  function stringArray(value) {
33
35
  return array(value) && value.every(elem => string(elem));
34
36
  }
35
- exports.stringArray = stringArray;
36
37
  function typedArray(value, check) {
37
38
  return Array.isArray(value) && value.every(check);
38
39
  }
39
- exports.typedArray = typedArray;
40
40
  function objectLiteral(value) {
41
41
  // Strictly speaking class instances pass this check as well. Since the LSP
42
42
  // doesn't use classes we ignore this for now. If we do we need to add something
43
43
  // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
44
44
  return value !== null && typeof value === 'object';
45
45
  }
46
- exports.objectLiteral = objectLiteral;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api';
3
2
  export * from 'vscode-jsonrpc/node';
4
3
  export * from '../common/api';
package/lib/node/main.js CHANGED
@@ -18,11 +18,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.createProtocolConnection = void 0;
21
+ exports.createProtocolConnection = createProtocolConnection;
22
22
  const node_1 = require("vscode-jsonrpc/node");
23
23
  __exportStar(require("vscode-jsonrpc/node"), exports);
24
24
  __exportStar(require("../common/api"), exports);
25
25
  function createProtocolConnection(input, output, logger, options) {
26
26
  return (0, node_1.createMessageConnection)(input, output, logger, options);
27
27
  }
28
- exports.createProtocolConnection = createProtocolConnection;
@@ -3,7 +3,7 @@
3
3
  "definitions": {
4
4
  "AndType": {
5
5
  "additionalProperties": false,
6
- "description": "Represents an `and`type (e.g. TextDocumentParams & WorkDoneProgressParams`).",
6
+ "description": "Represents an `and` type (e.g. TextDocumentParams & WorkDoneProgressParams`).",
7
7
  "properties": {
8
8
  "items": {
9
9
  "items": {
@@ -362,6 +362,10 @@
362
362
  "additionalProperties": false,
363
363
  "description": "Represents a LSP notification",
364
364
  "properties": {
365
+ "clientCapability": {
366
+ "description": "The client capability property path if any.",
367
+ "type": "string"
368
+ },
365
369
  "deprecated": {
366
370
  "description": "Whether the notification is deprecated or not. If deprecated the property contains the deprecation message.",
367
371
  "type": "string"
@@ -404,6 +408,10 @@
404
408
  "$ref": "#/definitions/Type",
405
409
  "description": "Optional registration options if the notification supports dynamic registration."
406
410
  },
411
+ "serverCapability": {
412
+ "description": "The server capability property path if any.",
413
+ "type": "string"
414
+ },
407
415
  "since": {
408
416
  "description": "Since when (release number) this notification is available. Is undefined if not known.",
409
417
  "type": "string"
@@ -515,6 +523,10 @@
515
523
  "additionalProperties": false,
516
524
  "description": "Represents a LSP request",
517
525
  "properties": {
526
+ "clientCapability": {
527
+ "description": "The client capability property path if any.",
528
+ "type": "string"
529
+ },
518
530
  "deprecated": {
519
531
  "description": "Whether the request is deprecated or not. If deprecated the property contains the deprecation message.",
520
532
  "type": "string"
@@ -569,6 +581,10 @@
569
581
  "$ref": "#/definitions/Type",
570
582
  "description": "The result type."
571
583
  },
584
+ "serverCapability": {
585
+ "description": "The server capability property path if any.",
586
+ "type": "string"
587
+ },
572
588
  "since": {
573
589
  "description": "Since when (release number) this request is available. Is undefined if not known.",
574
590
  "type": "string"
@@ -845,3 +861,4 @@
845
861
  }
846
862
  }
847
863
  }
864
+
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.17.6-next.9",
4
+ "version": "3.18.1",
5
5
  "author": "Microsoft Corporation",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -27,8 +27,8 @@
27
27
  }
28
28
  },
29
29
  "dependencies": {
30
- "vscode-jsonrpc": "9.0.0-next.5",
31
- "vscode-languageserver-types": "3.17.6-next.5"
30
+ "vscode-jsonrpc": "9.0.0",
31
+ "vscode-languageserver-types": "3.18.0"
32
32
  },
33
33
  "scripts": {
34
34
  "prepublishOnly": "echo \"⛔ Can only publish from a secure pipeline ⛔\" && node ../build/npm/fail",
@@ -38,7 +38,7 @@
38
38
  "compile": "tsc -b ./tsconfig.json",
39
39
  "watch": "tsc -b ./tsconfig.watch.json -w",
40
40
  "clean": "rimraf lib && rimraf dist",
41
- "lint": "eslint --ext ts src",
41
+ "lint": "eslint src",
42
42
  "test": "npm run test:node && npm run test:browser",
43
43
  "test:node": "node ../node_modules/mocha/bin/_mocha",
44
44
  "test:browser": "npm run webpack:test:silent && node ../build/bin/runBrowserTests.js http://127.0.0.1:8080/protocol/src/browser/test/",