This commit is contained in:
gr
2026-11-11 14:22:02 +08:00
parent 245618dcdc
commit a62311a8da
64878 changed files with 3747172 additions and 66 deletions
@@ -0,0 +1,11 @@
Copyright (c) Microsoft Corporation
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,16 @@
# VSCode Language Server - Protocol Module
[![NPM Version](https://img.shields.io/npm/v/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageserver-protocol)
[![NPM Downloads](https://img.shields.io/npm/dm/vscode-languageserver-protocol.svg)](https://npmjs.org/package/vscode-languageserver-protocol)
[![Build Status](https://dev.azure.com/vscode/vscode-languageserver-node/_apis/build/status%2Fvscode-languageserver-node?branchName=main)](https://dev.azure.com/vscode/vscode-languageserver-node/_build/latest?definitionId=52&branchName=main)
This npm module is a tool independent implementation of the language server protocol and can be used in any type of node application. Please note that the protocol is versioned using the LSP specification version number. Since the protocol depends on the `vscode-jsonrpc` version a a breaking change on that dependencies might not be reflected in a major version change of this module. Changing the major version number in these cases was more confusing this it would result in a version mismatch between the protocol and the LSP specification.
See [here](https://github.com/Microsoft/language-server-protocol) for a detailed documentation on the language server protocol.
## History
For the history please see the [main repository](https://github.com/Microsoft/vscode-languageserver-node/blob/master/README.md)
## License
[MIT](https://github.com/Microsoft/vscode-languageserver-node/blob/master/License.txt)
@@ -0,0 +1,13 @@
// @ts-check
'use strict';
const { createConfig } = require('../eslint.config.base.js');
module.exports = createConfig(
['src/common/tsconfig.json', 'src/browser/tsconfig.json', 'src/browser/test/tsconfig.json', 'src/node/tsconfig.json', 'src/node/test/tsconfig.json'],
undefined,
{
'no-console': 'error',
'@typescript-eslint/no-floating-promises': 'error',
}
);
@@ -0,0 +1,4 @@
import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api';
export * from 'vscode-jsonrpc/browser';
export * from '../common/api';
export declare function createProtocolConnection(reader: MessageReader, writer: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
@@ -0,0 +1,27 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProtocolConnection = createProtocolConnection;
const browser_1 = require("vscode-jsonrpc/browser");
__exportStar(require("vscode-jsonrpc/browser"), exports);
__exportStar(require("../common/api"), exports);
function createProtocolConnection(reader, writer, logger, options) {
return (0, browser_1.createMessageConnection)(reader, writer, logger, options);
}
@@ -0,0 +1,58 @@
import type { integer } from 'vscode-languageserver-types';
export * from 'vscode-jsonrpc';
export * from 'vscode-languageserver-types';
export * from './messages';
export * from './protocol';
export { ProtocolConnection, createProtocolConnection } from './connection';
export declare namespace LSPErrorCodes {
/**
* This is the start range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* @since 3.16.0
*/
const lspReservedErrorRangeStart: integer;
/**
* A request failed but it was syntactically correct, e.g the
* method name was known and the parameters were valid. The error
* message should contain human readable information about why
* the request failed.
*
* @since 3.17.0
*/
const RequestFailed: integer;
/**
* The server cancelled the request. This error code should
* only be used for requests that explicitly support being
* server cancellable.
*
* @since 3.17.0
*/
const ServerCancelled: integer;
/**
* The server detected that the content of a document got
* modified outside normal conditions. A server should
* NOT send this error code if it detects a content change
* in it unprocessed messages. The result even computed
* on an older state might still be useful for the client.
*
* If a client decides that a result is not of any use anymore
* the client should cancel the request.
*/
const ContentModified: integer;
/**
* The client has canceled a request and a server has detected
* the cancel.
*/
const RequestCancelled: integer;
/**
* This is the end range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* @since 3.16.0
*/
const lspReservedErrorRangeEnd: integer;
}
export type LSPErrorCodes = integer;
export declare namespace Proposed {
}
@@ -0,0 +1,77 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LSPErrorCodes = exports.createProtocolConnection = void 0;
__exportStar(require("vscode-jsonrpc"), exports);
__exportStar(require("vscode-languageserver-types"), exports);
__exportStar(require("./messages"), exports);
__exportStar(require("./protocol"), exports);
var connection_1 = require("./connection");
Object.defineProperty(exports, "createProtocolConnection", { enumerable: true, get: function () { return connection_1.createProtocolConnection; } });
var LSPErrorCodes;
(function (LSPErrorCodes) {
/**
* This is the start range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* @since 3.16.0
*/
LSPErrorCodes.lspReservedErrorRangeStart = -32899;
/**
* A request failed but it was syntactically correct, e.g the
* method name was known and the parameters were valid. The error
* message should contain human readable information about why
* the request failed.
*
* @since 3.17.0
*/
LSPErrorCodes.RequestFailed = -32803;
/**
* The server cancelled the request. This error code should
* only be used for requests that explicitly support being
* server cancellable.
*
* @since 3.17.0
*/
LSPErrorCodes.ServerCancelled = -32802;
/**
* The server detected that the content of a document got
* modified outside normal conditions. A server should
* NOT send this error code if it detects a content change
* in it unprocessed messages. The result even computed
* on an older state might still be useful for the client.
*
* If a client decides that a result is not of any use anymore
* the client should cancel the request.
*/
LSPErrorCodes.ContentModified = -32801;
/**
* The client has canceled a request and a server has detected
* the cancel.
*/
LSPErrorCodes.RequestCancelled = -32800;
/**
* This is the end range of LSP reserved error codes.
* It doesn't denote a real error code.
*
* @since 3.16.0
*/
LSPErrorCodes.lspReservedErrorRangeEnd = -32800;
})(LSPErrorCodes || (exports.LSPErrorCodes = LSPErrorCodes = {}));
@@ -0,0 +1,187 @@
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, RequestParam } from 'vscode-jsonrpc';
import { ProtocolRequestType, ProtocolRequestType0, ProtocolNotificationType, ProtocolNotificationType0 } from './messages';
export interface ProtocolConnection {
/**
* Sends a request and returns a promise resolving to the result of the request.
*
* @param type The type of request to sent.
* @param token An optional cancellation token.
* @returns A promise resolving to the request's result.
*/
sendRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, token?: CancellationToken): Promise<R>;
sendRequest<R, E>(type: RequestType0<R, E>, token?: CancellationToken): Promise<R>;
/**
* Sends a request and returns a promise resolving to the result of the request.
*
* @param type The type of request to sent.
* @param params The request's parameter.
* @param token An optional cancellation token.
* @returns A promise resolving to the request's result.
*/
sendRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, params: NoInfer<RequestParam<P>>, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: NoInfer<RequestParam<P>>, token?: CancellationToken): Promise<R>;
/**
* Sends a request and returns a promise resolving to the result of the request.
*
* @param method the method name.
* @param token An optional cancellation token.
* @returns A promise resolving to the request's result.
*/
sendRequest<R>(method: string, token?: CancellationToken): Promise<R>;
/**
* Sends a request and returns a promise resolving to the result of the request.
*
* @param method the method name.
* @param params The request's parameter.
* @param token An optional cancellation token.
* @returns A promise resolving to the request's result.
*/
sendRequest<R>(method: string, param: any, token?: CancellationToken): Promise<R>;
/**
* Installs a request handler.
*
* @param type The request type to install the handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onRequest<R, PR, E, RO>(type: ProtocolRequestType0<R, PR, E, RO>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: NoInfer<RequestHandler0<R, E>>): Disposable;
/**
* Installs a request handler.
*
* @param type The request type to install the handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onRequest<P, R, PR, E, RO>(type: ProtocolRequestType<P, R, PR, E, RO>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: NoInfer<RequestHandler<P, R, E>>): Disposable;
/**
* Installs a request handler.
*
* @param methods the message method name to install a handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onRequest<R, E>(method: string, handler: GenericRequestHandler<R, E>): Disposable;
/**
* Returns true if the connection has a pending response.
* Otherwise false is returned.
*/
hasPendingResponse(): boolean;
/**
* Sends a notification.
*
* @param type the notification's type to send.
* @returns A promise that resolves when the notification is written to the
* network layer.
*/
sendNotification(type: NotificationType0): Promise<void>;
sendNotification<RO>(type: ProtocolNotificationType0<RO>): Promise<void>;
/**
* Sends a notification.
*
* @param type the notification's type to send.
* @param params the notification's parameters.
* @returns A promise that resolves when the notification is written to the
* network layer.
*/
sendNotification<P, RO>(type: ProtocolNotificationType<P, RO>, params?: NoInfer<RequestParam<P>>): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: NoInfer<RequestParam<P>>): Promise<void>;
/**
* Sends a notification.
*
* @param method the notification's method name.
* @returns A promise that resolves when the notification is written to the
* network layer.
*/
sendNotification(method: string): Promise<void>;
/**
* Sends a notification.
*
* @param method the notification's method name.
* @param params the notification's parameters.
* @returns A promise that resolves when the notification is written to the
* network layer.
*/
sendNotification(method: string, params: any): Promise<void>;
/**
* Installs a notification handler.
*
* @param type The notification type to install the handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onNotification<RO>(type: ProtocolNotificationType0<RO>, handler: NotificationHandler0): Disposable;
onNotification(type: NotificationType0, handler: NotificationHandler0): Disposable;
/**
* Installs a notification handler.
*
* @param type The notification type to install the handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onNotification<P, RO>(type: ProtocolNotificationType<P, RO>, handler: NoInfer<NotificationHandler<P>>): Disposable;
onNotification<P>(type: NotificationType<P>, handler: NoInfer<NotificationHandler<P>>): Disposable;
/**
* Installs a notification handler.
*
* @param methods The message method name to install the handler for.
* @param handler The actual handler.
* @returns A disposable to remove the handler.
*/
onNotification(method: string, handler: GenericNotificationHandler): Disposable;
/**
* Installs a progress handler for a given token.
* @param type the progress type
* @param token the token
* @param handler the handler
* @returns A disposable to remove the handler.
*/
onProgress<P>(type: ProgressType<P>, token: string | number, handler: NoInfer<NotificationHandler<P>>): Disposable;
/**
* Sends progress.
* @param type the progress type
* @param token the token to use
* @param value the progress value
* @returns A promise that resolves when the progress is written to the
* network layer.
*/
sendProgress<P>(type: ProgressType<P>, token: string | number, value: NoInfer<RequestParam<P>>): Promise<void>;
/**
* Enables tracing mode for the connection.
* @returns A promise that resolves when the trace value is written to the
* network layer.
*/
trace(value: Trace, tracer: Tracer, sendNotification?: boolean): Promise<void>;
trace(value: Trace, tracer: Tracer, traceOptions?: TraceOptions): Promise<void>;
/**
* An event emitter firing when an error occurs on the connection.
*/
onError: Event<[Error, Message | undefined, number | undefined]>;
/**
* An event emitter firing when the connection got closed.
*/
onClose: Event<void>;
/**
* An event emitter firing when the connection receives a notification that is not
* handled.
*/
onUnhandledNotification: Event<NotificationMessage>;
/**
* An event emitter firing when the connection got disposed.
*/
onDispose: Event<void>;
/**
* Ends the connection.
*/
end(): void;
/**
* Actively disposes the connection.
*/
dispose(): void;
/**
* Turns the connection into listening mode
*/
listen(): void;
}
export declare function createProtocolConnection(input: MessageReader, output: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
@@ -0,0 +1,14 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProtocolConnection = createProtocolConnection;
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
function createProtocolConnection(input, output, logger, options) {
if (vscode_jsonrpc_1.ConnectionStrategy.is(options)) {
options = { connectionStrategy: options };
}
return (0, vscode_jsonrpc_1.createMessageConnection)(input, output, logger, options);
}
@@ -0,0 +1,58 @@
import { RequestType, RequestType0, NotificationType, NotificationType0, ProgressType, _EM } from 'vscode-jsonrpc';
export declare enum MessageDirection {
clientToServer = "clientToServer",
serverToClient = "serverToClient",
both = "both"
}
export declare class RegistrationType<RO> {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
readonly ____: [RO, _EM] | undefined;
readonly method: string;
constructor(method: string);
}
export declare class ProtocolRequestType0<R, PR, E, RO> extends RequestType0<R, E> implements ProgressType<PR>, RegistrationType<RO> {
/**
* Clients must not use these properties. They are here to ensure correct typing.
* in TypeScript
*/
readonly __: [PR, _EM] | undefined;
readonly ___: [PR, RO, _EM] | undefined;
readonly ____: [RO, _EM] | undefined;
readonly _pr: PR | undefined;
constructor(method: string);
}
export declare class ProtocolRequestType<P, R, PR, E, RO> extends RequestType<P, R, E> implements ProgressType<PR>, RegistrationType<RO> {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
readonly __: [PR, _EM] | undefined;
readonly ___: [PR, RO, _EM] | undefined;
readonly ____: [RO, _EM] | undefined;
readonly _pr: PR | undefined;
constructor(method: string);
}
export declare class ProtocolNotificationType0<RO> extends NotificationType0 implements RegistrationType<RO> {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
readonly ___: [RO, _EM] | undefined;
readonly ____: [RO, _EM] | undefined;
constructor(method: string);
}
export declare class ProtocolNotificationType<P, RO> extends NotificationType<P> implements RegistrationType<RO> {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
readonly ___: [RO, _EM] | undefined;
readonly ____: [RO, _EM] | undefined;
constructor(method: string);
}
export type CM<C extends string | undefined, S extends string | undefined> = {
client: C;
server: S;
};
export declare namespace CM {
function create<C extends string | undefined, S extends string | undefined>(client: C, server: S): CM<C, S>;
}
@@ -0,0 +1,81 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.CM = exports.ProtocolNotificationType = exports.ProtocolNotificationType0 = exports.ProtocolRequestType = exports.ProtocolRequestType0 = exports.RegistrationType = exports.MessageDirection = void 0;
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
var MessageDirection;
(function (MessageDirection) {
MessageDirection["clientToServer"] = "clientToServer";
MessageDirection["serverToClient"] = "serverToClient";
MessageDirection["both"] = "both";
})(MessageDirection || (exports.MessageDirection = MessageDirection = {}));
class RegistrationType {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
____;
method;
constructor(method) {
this.method = method;
}
}
exports.RegistrationType = RegistrationType;
class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {
/**
* Clients must not use these properties. They are here to ensure correct typing.
* in TypeScript
*/
__;
___;
____;
_pr;
constructor(method) {
super(method);
}
}
exports.ProtocolRequestType0 = ProtocolRequestType0;
class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
__;
___;
____;
_pr;
constructor(method) {
super(method, vscode_jsonrpc_1.ParameterStructures.byName);
}
}
exports.ProtocolRequestType = ProtocolRequestType;
class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
___;
____;
constructor(method) {
super(method);
}
}
exports.ProtocolNotificationType0 = ProtocolNotificationType0;
class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {
/**
* Clients must not use this property. It is here to ensure correct typing.
*/
___;
____;
constructor(method) {
super(method, vscode_jsonrpc_1.ParameterStructures.byName);
}
}
exports.ProtocolNotificationType = ProtocolNotificationType;
var CM;
(function (CM) {
function create(client, server) {
return { client, server };
}
CM.create = create;
})(CM || (exports.CM = CM = {}));
@@ -0,0 +1 @@
export {};
@@ -0,0 +1,43 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) TypeFox, Microsoft and others. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
const messages_1 = require("./messages");
const api_1 = require("./api");
// This file is used to define the $ notification partly specified in JSON-RPC
// so that we generate proper data for them in the meta model.
// @ts-ignore 6196
var SetTraceNotification;
(function (SetTraceNotification) {
SetTraceNotification.method = '$/setTrace';
SetTraceNotification.messageDirection = messages_1.MessageDirection.clientToServer;
SetTraceNotification.type = new messages_1.ProtocolNotificationType(SetTraceNotification.method);
})(SetTraceNotification || (SetTraceNotification = {}));
// @ts-ignore 6196
var LogTraceNotification;
(function (LogTraceNotification) {
LogTraceNotification.method = '$/logTrace';
LogTraceNotification.messageDirection = messages_1.MessageDirection.serverToClient;
LogTraceNotification.type = new messages_1.ProtocolNotificationType(LogTraceNotification.method);
})(LogTraceNotification || (LogTraceNotification = {}));
// @ts-ignore 6196
const $ErrorCodes = vscode_jsonrpc_1.ErrorCodes;
// @ts-ignore 6196
const $LSPErrorCodes = api_1.LSPErrorCodes;
// @ts-ignore 6196
var CancelNotification;
(function (CancelNotification) {
CancelNotification.method = '$/cancelRequest';
CancelNotification.messageDirection = messages_1.MessageDirection.both;
CancelNotification.type = new messages_1.ProtocolNotificationType(CancelNotification.method);
})(CancelNotification || (CancelNotification = {}));
// @ts-ignore 6196
var ProgressNotification;
(function (ProgressNotification) {
ProgressNotification.method = '$/progress';
ProgressNotification.messageDirection = messages_1.MessageDirection.both;
ProgressNotification.type = new messages_1.ProtocolNotificationType(ProgressNotification.method);
})(ProgressNotification || (ProgressNotification = {}));
@@ -0,0 +1,89 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* @since 3.16.0
*/
export interface CallHierarchyClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
}
/**
* Call hierarchy options used during static registration.
*
* @since 3.16.0
*/
export interface CallHierarchyOptions extends WorkDoneProgressOptions {
}
/**
* Call hierarchy options used during static or dynamic registration.
*
* @since 3.16.0
*/
export interface CallHierarchyRegistrationOptions extends TextDocumentRegistrationOptions, CallHierarchyOptions, StaticRegistrationOptions {
}
/**
* The parameter of a `textDocument/prepareCallHierarchy` request.
*
* @since 3.16.0
*/
export interface CallHierarchyPrepareParams extends TextDocumentPositionParams, WorkDoneProgressParams {
}
/**
* A request to result a `CallHierarchyItem` in a document at a given position.
* Can be used as an input to an incoming or outgoing call hierarchy.
*
* @since 3.16.0
*/
export declare namespace CallHierarchyPrepareRequest {
const method: 'textDocument/prepareCallHierarchy';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<CallHierarchyPrepareParams, CallHierarchyItem[] | null, never, void, CallHierarchyRegistrationOptions>;
type HandlerSignature = RequestHandler<CallHierarchyPrepareParams, CallHierarchyItem[] | null, void>;
const capabilities: CM<"textDocument.callHierarchy", "callHierarchyProvider">;
}
/**
* The parameter of a `callHierarchy/incomingCalls` request.
*
* @since 3.16.0
*/
export interface CallHierarchyIncomingCallsParams extends WorkDoneProgressParams, PartialResultParams {
item: CallHierarchyItem;
}
/**
* A request to resolve the incoming calls for a given `CallHierarchyItem`.
*
* @since 3.16.0
*/
export declare namespace CallHierarchyIncomingCallsRequest {
const method: 'callHierarchy/incomingCalls';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<CallHierarchyIncomingCallsParams, CallHierarchyIncomingCall[] | null, CallHierarchyIncomingCall[], void, void>;
type HandlerSignature = RequestHandler<CallHierarchyIncomingCallsParams, CallHierarchyIncomingCall[] | null, void>;
const capabilities: CM<"textDocument.callHierarchy", "callHierarchyProvider">;
}
/**
* The parameter of a `callHierarchy/outgoingCalls` request.
*
* @since 3.16.0
*/
export interface CallHierarchyOutgoingCallsParams extends WorkDoneProgressParams, PartialResultParams {
item: CallHierarchyItem;
}
/**
* A request to resolve the outgoing calls for a given `CallHierarchyItem`.
*
* @since 3.16.0
*/
export declare namespace CallHierarchyOutgoingCallsRequest {
const method: 'callHierarchy/outgoingCalls';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<CallHierarchyOutgoingCallsParams, CallHierarchyOutgoingCall[] | null, CallHierarchyOutgoingCall[], void, void>;
type HandlerSignature = RequestHandler<CallHierarchyOutgoingCallsParams, CallHierarchyOutgoingCall[] | null, void>;
const capabilities: CM<"textDocument.callHierarchy", "callHierarchyProvider">;
}
@@ -0,0 +1,45 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) TypeFox, Microsoft and others. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.CallHierarchyPrepareRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to result a `CallHierarchyItem` in a document at a given position.
* Can be used as an input to an incoming or outgoing call hierarchy.
*
* @since 3.16.0
*/
var CallHierarchyPrepareRequest;
(function (CallHierarchyPrepareRequest) {
CallHierarchyPrepareRequest.method = 'textDocument/prepareCallHierarchy';
CallHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CallHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(CallHierarchyPrepareRequest.method);
CallHierarchyPrepareRequest.capabilities = messages_1.CM.create('textDocument.callHierarchy', 'callHierarchyProvider');
})(CallHierarchyPrepareRequest || (exports.CallHierarchyPrepareRequest = CallHierarchyPrepareRequest = {}));
/**
* A request to resolve the incoming calls for a given `CallHierarchyItem`.
*
* @since 3.16.0
*/
var CallHierarchyIncomingCallsRequest;
(function (CallHierarchyIncomingCallsRequest) {
CallHierarchyIncomingCallsRequest.method = 'callHierarchy/incomingCalls';
CallHierarchyIncomingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CallHierarchyIncomingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyIncomingCallsRequest.method);
CallHierarchyIncomingCallsRequest.capabilities = messages_1.CM.create('textDocument.callHierarchy', 'callHierarchyProvider');
})(CallHierarchyIncomingCallsRequest || (exports.CallHierarchyIncomingCallsRequest = CallHierarchyIncomingCallsRequest = {}));
/**
* A request to resolve the outgoing calls for a given `CallHierarchyItem`.
*
* @since 3.16.0
*/
var CallHierarchyOutgoingCallsRequest;
(function (CallHierarchyOutgoingCallsRequest) {
CallHierarchyOutgoingCallsRequest.method = 'callHierarchy/outgoingCalls';
CallHierarchyOutgoingCallsRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CallHierarchyOutgoingCallsRequest.type = new messages_1.ProtocolRequestType(CallHierarchyOutgoingCallsRequest.method);
CallHierarchyOutgoingCallsRequest.capabilities = messages_1.CM.create('textDocument.callHierarchy', 'callHierarchyProvider');
})(CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = CallHierarchyOutgoingCallsRequest = {}));
@@ -0,0 +1,68 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Range, Color, ColorInformation, ColorPresentation } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
export interface DocumentColorClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `DocumentColorRegistrationOptions` return value
* for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
}
export interface DocumentColorOptions extends WorkDoneProgressOptions {
}
export interface DocumentColorRegistrationOptions extends TextDocumentRegistrationOptions, StaticRegistrationOptions, DocumentColorOptions {
}
/**
* Parameters for a {@link DocumentColorRequest}.
*/
export interface DocumentColorParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
}
/**
* A request to list all color symbols found in a given text document. The request's
* parameter is of type {@link DocumentColorParams} the
* response is of type {@link ColorInformation ColorInformation[]} or a Thenable
* that resolves to such.
*/
export declare namespace DocumentColorRequest {
const method: 'textDocument/documentColor';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<DocumentColorParams, ColorInformation[], ColorInformation[], void, DocumentColorRegistrationOptions>;
type HandlerSignature = RequestHandler<DocumentColorParams, ColorInformation[], void>;
const capabilities: CM<"textDocument.colorProvider", "colorProvider">;
}
/**
* Parameters for a {@link ColorPresentationRequest}.
*/
export interface ColorPresentationParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The color to request presentations for.
*/
color: Color;
/**
* The range where the color would be inserted. Serves as a context.
*/
range: Range;
}
/**
* A request to list all presentation for a color. The request's
* parameter is of type {@link ColorPresentationParams} the
* response is of type {@link ColorPresentation ColorPresentation[]} or a Thenable
* that resolves to such.
*/
export declare namespace ColorPresentationRequest {
const method: 'textDocument/colorPresentation';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<ColorPresentationParams, ColorPresentation[], ColorPresentation[], void, DocumentColorRegistrationOptions>;
type HandlerSignature = RequestHandler<ColorPresentationParams, ColorPresentation[], void>;
const capabilities: CM<"textDocument.colorProvider", "colorProvider">;
}
@@ -0,0 +1,34 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ColorPresentationRequest = exports.DocumentColorRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to list all color symbols found in a given text document. The request's
* parameter is of type {@link DocumentColorParams} the
* response is of type {@link ColorInformation ColorInformation[]} or a Thenable
* that resolves to such.
*/
var DocumentColorRequest;
(function (DocumentColorRequest) {
DocumentColorRequest.method = 'textDocument/documentColor';
DocumentColorRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentColorRequest.type = new messages_1.ProtocolRequestType(DocumentColorRequest.method);
DocumentColorRequest.capabilities = messages_1.CM.create('textDocument.colorProvider', 'colorProvider');
})(DocumentColorRequest || (exports.DocumentColorRequest = DocumentColorRequest = {}));
/**
* A request to list all presentation for a color. The request's
* parameter is of type {@link ColorPresentationParams} the
* response is of type {@link ColorPresentation ColorPresentation[]} or a Thenable
* that resolves to such.
*/
var ColorPresentationRequest;
(function (ColorPresentationRequest) {
ColorPresentationRequest.method = 'textDocument/colorPresentation';
ColorPresentationRequest.messageDirection = messages_1.MessageDirection.clientToServer;
ColorPresentationRequest.type = new messages_1.ProtocolRequestType(ColorPresentationRequest.method);
ColorPresentationRequest.capabilities = messages_1.CM.create('textDocument.colorProvider', 'colorProvider');
})(ColorPresentationRequest || (exports.ColorPresentationRequest = ColorPresentationRequest = {}));
@@ -0,0 +1,36 @@
import { RequestHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
import { LSPAny, URI } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
/**
* The 'workspace/configuration' request is sent from the server to the client to fetch a certain
* configuration setting.
*
* This pull model replaces the old push model were the client signaled configuration change via an
* event. If the server still needs to react to configuration changes (since the server caches the
* result of `workspace/configuration` requests) the server should register for an empty configuration
* change event and empty the cache if such an event is received.
*/
export declare namespace ConfigurationRequest {
const method: 'workspace/configuration';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<ConfigurationParams, any[], never, void, void>;
type HandlerSignature = RequestHandler<ConfigurationParams, LSPAny[], void>;
type MiddlewareSignature = (params: ConfigurationParams, token: CancellationToken, next: HandlerSignature) => HandlerResult<LSPAny[], void>;
const capabilities: CM<"workspace.configuration", undefined>;
}
export interface ConfigurationItem {
/**
* The scope to get the configuration section for.
*/
scopeUri?: URI;
/**
* The configuration section asked for.
*/
section?: string;
}
/**
* The parameters of a configuration request.
*/
export interface ConfigurationParams {
items: ConfigurationItem[];
}
@@ -0,0 +1,25 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigurationRequest = void 0;
const messages_1 = require("./messages");
//---- Get Configuration request ----
/**
* The 'workspace/configuration' request is sent from the server to the client to fetch a certain
* configuration setting.
*
* This pull model replaces the old push model were the client signaled configuration change via an
* event. If the server still needs to react to configuration changes (since the server caches the
* result of `workspace/configuration` requests) the server should register for an empty configuration
* change event and empty the cache if such an event is received.
*/
var ConfigurationRequest;
(function (ConfigurationRequest) {
ConfigurationRequest.method = 'workspace/configuration';
ConfigurationRequest.messageDirection = messages_1.MessageDirection.serverToClient;
ConfigurationRequest.type = new messages_1.ProtocolRequestType(ConfigurationRequest.method);
ConfigurationRequest.capabilities = messages_1.CM.create('workspace.configuration', undefined);
})(ConfigurationRequest || (exports.ConfigurationRequest = ConfigurationRequest = {}));
File diff suppressed because one or more lines are too long
@@ -0,0 +1,38 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Declaration, DeclarationLink, Location, LocationLink } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* @since 3.14.0
*/
export interface DeclarationClientCapabilities {
/**
* Whether declaration supports dynamic registration. If this is set to `true`
* the client supports the new `DeclarationRegistrationOptions` return value
* for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The client supports additional metadata in the form of declaration links.
*/
linkSupport?: boolean;
}
export interface DeclarationOptions extends WorkDoneProgressOptions {
}
export interface DeclarationRegistrationOptions extends DeclarationOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
}
export interface DeclarationParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
}
/**
* A request to resolve the type definition locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
* or a Thenable that resolves to such.
*/
export declare namespace DeclarationRequest {
const method: 'textDocument/declaration';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<DeclarationParams, Declaration | LocationLink[] | null, Location[] | LocationLink[], void, DeclarationRegistrationOptions>;
type HandlerSignature = RequestHandler<DeclarationParams, Declaration | DeclarationLink[] | null, void>;
const capabilities: CM<"textDocument.declaration", "declarationProvider">;
}
@@ -0,0 +1,23 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.DeclarationRequest = void 0;
const messages_1 = require("./messages");
// @ts-ignore: to avoid inlining LocationLink as dynamic import
let __noDynamicImport;
/**
* A request to resolve the type definition locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
* or a Thenable that resolves to such.
*/
var DeclarationRequest;
(function (DeclarationRequest) {
DeclarationRequest.method = 'textDocument/declaration';
DeclarationRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DeclarationRequest.type = new messages_1.ProtocolRequestType(DeclarationRequest.method);
DeclarationRequest.capabilities = messages_1.CM.create('textDocument.declaration', 'declarationProvider');
})(DeclarationRequest || (exports.DeclarationRequest = DeclarationRequest = {}));
@@ -0,0 +1,369 @@
import { RequestHandler0, RequestHandler, ProgressType } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Diagnostic, DocumentUri, integer } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType0, ProtocolRequestType, CM } from './messages';
import { type PartialResultParams, type StaticRegistrationOptions, type WorkDoneProgressParams, type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type DiagnosticsCapabilities } from './protocol';
/**
* Client capabilities specific to diagnostic pull requests.
*
* @since 3.17.0
*/
export type DiagnosticClientCapabilities = DiagnosticsCapabilities & {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* Whether the clients supports related documents for document diagnostic pulls.
*/
relatedDocumentSupport?: boolean;
/**
* Whether the client supports `MarkupContent` in diagnostic messages.
*
* @since 3.18.0
*/
markupMessageSupport?: boolean;
};
/**
* Workspace client capabilities specific to diagnostic pull requests.
*
* @since 3.17.0
*/
export type DiagnosticWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from
* the server to the client.
*
* Note that this event is global and will force the client to refresh all
* pulled diagnostics currently shown. It should be used with absolute care and
* is useful for situation where a server for example detects a project wide
* change that requires such a calculation.
*/
refreshSupport?: boolean;
};
/**
* Diagnostic options.
*
* @since 3.17.0
*/
export type DiagnosticOptions = WorkDoneProgressOptions & {
/**
* An optional identifier under which the diagnostics are
* managed by the client.
*/
identifier?: string;
/**
* Whether the language has inter file dependencies meaning that
* editing code in one file can result in a different diagnostic
* set in another file. Inter file dependencies are common for
* most programming languages and typically uncommon for linters.
*/
interFileDependencies: boolean;
/**
* The server provides support for workspace diagnostics as well.
*/
workspaceDiagnostics: boolean;
};
/**
* Diagnostic registration options.
*
* @since 3.17.0
*/
export type DiagnosticRegistrationOptions = TextDocumentRegistrationOptions & DiagnosticOptions & StaticRegistrationOptions;
export type $DiagnosticServerCapabilities = {
diagnosticProvider?: DiagnosticOptions;
};
/**
* Cancellation data returned from a diagnostic request.
*
* @since 3.17.0
*/
export type DiagnosticServerCancellationData = {
retriggerRequest: boolean;
};
/**
* @since 3.17.0
*/
export declare namespace DiagnosticServerCancellationData {
function is(value: any): value is DiagnosticServerCancellationData;
}
/**
* Parameters of the document diagnostic request.
*
* @since 3.17.0
*/
export type DocumentDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The additional identifier provided during registration.
*/
identifier?: string;
/**
* The result id of a previous response if provided.
*/
previousResultId?: string;
};
/**
* The document diagnostic report kinds.
*
* @since 3.17.0
*/
export declare namespace DocumentDiagnosticReportKind {
/**
* A diagnostic report with a full
* set of problems.
*/
const Full = "full";
/**
* A report indicating that the last
* returned report is still accurate.
*/
const Unchanged = "unchanged";
}
export type DocumentDiagnosticReportKind = 'full' | 'unchanged';
/**
* A diagnostic report with a full set of problems.
*
* @since 3.17.0
*/
export type FullDocumentDiagnosticReport = {
/**
* A full document diagnostic report.
*/
kind: typeof DocumentDiagnosticReportKind.Full;
/**
* An optional result id. If provided it will
* be sent on the next diagnostic request for the
* same document.
*/
resultId?: string;
/**
* The actual items.
*/
items: Diagnostic[];
};
/**
* A full diagnostic report with a set of related documents.
*
* @since 3.17.0
*/
export type RelatedFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
/**
* Diagnostics of related documents. This information is useful
* in programming languages where code in a file A can generate
* diagnostics in a file B which A depends on. An example of
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
* @since 3.17.0
*/
relatedDocuments?: {
[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
};
};
/**
* A diagnostic report indicating that the last returned
* report is still accurate.
*
* @since 3.17.0
*/
export type UnchangedDocumentDiagnosticReport = {
/**
* A document diagnostic report indicating
* no changes to the last result. A server can
* only return `unchanged` if result ids are
* provided.
*/
kind: typeof DocumentDiagnosticReportKind.Unchanged;
/**
* A result id which will be sent on the next
* diagnostic request for the same document.
*/
resultId: string;
};
/**
* An unchanged diagnostic report with a set of related documents.
*
* @since 3.17.0
*/
export type RelatedUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
/**
* Diagnostics of related documents. This information is useful
* in programming languages where code in a file A can generate
* diagnostics in a file B which A depends on. An example of
* such a language is C/C++ where marco definitions in a file
* a.cpp and result in errors in a header file b.hpp.
*
* @since 3.17.0
*/
relatedDocuments?: {
[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
};
};
/**
* The result of a document diagnostic pull request. A report can
* either be a full report containing all diagnostics for the
* requested document or an unchanged report indicating that nothing
* has changed in terms of diagnostics in comparison to the last
* pull request.
*
* @since 3.17.0
*/
export type DocumentDiagnosticReport = RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport;
/**
* A partial result for a document diagnostic report.
*
* @since 3.17.0
*/
export type DocumentDiagnosticReportPartialResult = {
relatedDocuments: {
[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
};
};
/**
* The document diagnostic report used when reporting partial result.
*
* When using partial results, the first literal sent needs to be a
* DocumentDiagnosticReport providing the diagnostics on the document
* followed by n DocumentDiagnosticReportPartialResult literals providing
* the diagnostics for related documents.
*
* ```
* DocumentDiagnosticReport
* DocumentDiagnosticReportPartialResult
* DocumentDiagnosticReportPartialResult
* ...
* ```
*
* @since 3.18.1
*/
export type DocumentDiagnosticReportProgress = DocumentDiagnosticReport | DocumentDiagnosticReportPartialResult;
/**
* The document diagnostic request definition.
*
*
* @since 3.17.0
*/
export declare namespace DocumentDiagnosticRequest {
const method: 'textDocument/diagnostic';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<DocumentDiagnosticParams, DocumentDiagnosticReport, DocumentDiagnosticReportProgress, DiagnosticServerCancellationData, DiagnosticRegistrationOptions>;
const partialResult: ProgressType<DocumentDiagnosticReportProgress>;
type HandlerSignature = RequestHandler<DocumentDiagnosticParams, DocumentDiagnosticReport, void>;
const capabilities: CM<"textDocument.diagnostic", "diagnosticProvider">;
}
/**
* A previous result id in a workspace pull request.
*
* @since 3.17.0
*/
export type PreviousResultId = {
/**
* The URI for which the client knowns a
* result id.
*/
uri: DocumentUri;
/**
* The value of the previous result id.
*/
value: string;
};
/**
* Parameters of the workspace diagnostic request.
*
* @since 3.17.0
*/
export type WorkspaceDiagnosticParams = WorkDoneProgressParams & PartialResultParams & {
/**
* The additional identifier provided during registration.
*/
identifier?: string;
/**
* The currently known diagnostic reports with their
* previous result ids.
*/
previousResultIds: PreviousResultId[];
};
/**
* A full document diagnostic report for a workspace diagnostic result.
*
* @since 3.17.0
*/
export type WorkspaceFullDocumentDiagnosticReport = FullDocumentDiagnosticReport & {
/**
* The URI for which diagnostic information is reported.
*/
uri: DocumentUri;
/**
* The version number for which the diagnostics are reported.
* If the document is not marked as open `null` can be provided.
*/
version: integer | null;
};
/**
* An unchanged document diagnostic report for a workspace diagnostic result.
*
* @since 3.17.0
*/
export type WorkspaceUnchangedDocumentDiagnosticReport = UnchangedDocumentDiagnosticReport & {
/**
* The URI for which diagnostic information is reported.
*/
uri: DocumentUri;
/**
* The version number for which the diagnostics are reported.
* If the document is not marked as open `null` can be provided.
*/
version: integer | null;
};
/**
* A workspace diagnostic document report.
*
* @since 3.17.0
*/
export type WorkspaceDocumentDiagnosticReport = WorkspaceFullDocumentDiagnosticReport | WorkspaceUnchangedDocumentDiagnosticReport;
/**
* A workspace diagnostic report.
*
* @since 3.17.0
*/
export type WorkspaceDiagnosticReport = {
items: WorkspaceDocumentDiagnosticReport[];
};
/**
* A partial result for a workspace diagnostic report.
*
* @since 3.17.0
*/
export type WorkspaceDiagnosticReportPartialResult = {
items: WorkspaceDocumentDiagnosticReport[];
};
/**
* The workspace diagnostic request definition.
*
* @since 3.17.0
*/
export declare namespace WorkspaceDiagnosticRequest {
const method: 'workspace/diagnostic';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<WorkspaceDiagnosticParams, WorkspaceDiagnosticReport, WorkspaceDiagnosticReportPartialResult, DiagnosticServerCancellationData, void>;
const partialResult: ProgressType<WorkspaceDiagnosticReportPartialResult>;
type HandlerSignature = RequestHandler<WorkspaceDiagnosticParams, WorkspaceDiagnosticReport | null, void>;
const capabilities: CM<"workspace.diagnostics", "diagnosticProvider.workspaceDiagnostics">;
}
/**
* The diagnostic refresh request definition.
*
* @since 3.17.0
*/
export declare namespace DiagnosticRefreshRequest {
const method: `workspace/diagnostic/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<void, void, void, void>;
type HandlerSignature = RequestHandler0<void, void>;
const capabilities: CM<"workspace.diagnostics.refreshSupport", undefined>;
}
@@ -0,0 +1,111 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
const Is = __importStar(require("./utils/is"));
const messages_1 = require("./messages");
/**
* @since 3.17.0
*/
var DiagnosticServerCancellationData;
(function (DiagnosticServerCancellationData) {
function is(value) {
const candidate = value;
return candidate && Is.boolean(candidate.retriggerRequest);
}
DiagnosticServerCancellationData.is = is;
})(DiagnosticServerCancellationData || (exports.DiagnosticServerCancellationData = DiagnosticServerCancellationData = {}));
/**
* The document diagnostic report kinds.
*
* @since 3.17.0
*/
var DocumentDiagnosticReportKind;
(function (DocumentDiagnosticReportKind) {
/**
* A diagnostic report with a full
* set of problems.
*/
DocumentDiagnosticReportKind.Full = 'full';
/**
* A report indicating that the last
* returned report is still accurate.
*/
DocumentDiagnosticReportKind.Unchanged = 'unchanged';
})(DocumentDiagnosticReportKind || (exports.DocumentDiagnosticReportKind = DocumentDiagnosticReportKind = {}));
/**
* The document diagnostic request definition.
*
*
* @since 3.17.0
*/
var DocumentDiagnosticRequest;
(function (DocumentDiagnosticRequest) {
DocumentDiagnosticRequest.method = 'textDocument/diagnostic';
DocumentDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentDiagnosticRequest.type = new messages_1.ProtocolRequestType(DocumentDiagnosticRequest.method);
DocumentDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();
DocumentDiagnosticRequest.capabilities = messages_1.CM.create('textDocument.diagnostic', 'diagnosticProvider');
})(DocumentDiagnosticRequest || (exports.DocumentDiagnosticRequest = DocumentDiagnosticRequest = {}));
/**
* The workspace diagnostic request definition.
*
* @since 3.17.0
*/
var WorkspaceDiagnosticRequest;
(function (WorkspaceDiagnosticRequest) {
WorkspaceDiagnosticRequest.method = 'workspace/diagnostic';
WorkspaceDiagnosticRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WorkspaceDiagnosticRequest.type = new messages_1.ProtocolRequestType(WorkspaceDiagnosticRequest.method);
WorkspaceDiagnosticRequest.partialResult = new vscode_jsonrpc_1.ProgressType();
WorkspaceDiagnosticRequest.capabilities = messages_1.CM.create('workspace.diagnostics', 'diagnosticProvider.workspaceDiagnostics');
})(WorkspaceDiagnosticRequest || (exports.WorkspaceDiagnosticRequest = WorkspaceDiagnosticRequest = {}));
/**
* The diagnostic refresh request definition.
*
* @since 3.17.0
*/
var DiagnosticRefreshRequest;
(function (DiagnosticRefreshRequest) {
DiagnosticRefreshRequest.method = `workspace/diagnostic/refresh`;
DiagnosticRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
DiagnosticRefreshRequest.type = new messages_1.ProtocolRequestType0(DiagnosticRefreshRequest.method);
DiagnosticRefreshRequest.capabilities = messages_1.CM.create('workspace.diagnostics.refreshSupport', undefined);
})(DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = DiagnosticRefreshRequest = {}));
@@ -0,0 +1,312 @@
import { NotificationHandler, RequestHandler } from 'vscode-jsonrpc';
import { WorkspaceEdit, type DocumentUri } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolNotificationType, ProtocolRequestType } from './messages';
/**
* Options for notifications/requests for user operations on files.
*
* @since 3.16.0
*/
export interface FileOperationOptions {
/**
* The server is interested in receiving didCreateFiles notifications.
*/
didCreate?: FileOperationRegistrationOptions;
/**
* The server is interested in receiving willCreateFiles requests.
*/
willCreate?: FileOperationRegistrationOptions;
/**
* The server is interested in receiving didRenameFiles notifications.
*/
didRename?: FileOperationRegistrationOptions;
/**
* The server is interested in receiving willRenameFiles requests.
*/
willRename?: FileOperationRegistrationOptions;
/**
* The server is interested in receiving didDeleteFiles file notifications.
*/
didDelete?: FileOperationRegistrationOptions;
/**
* The server is interested in receiving willDeleteFiles file requests.
*/
willDelete?: FileOperationRegistrationOptions;
}
/**
* The options to register for file operations.
*
* @since 3.16.0
*/
export interface FileOperationRegistrationOptions {
/**
* The actual filters.
*/
filters: FileOperationFilter[];
}
/**
* A pattern kind describing if a glob pattern matches a file a folder or
* both.
*
* @since 3.16.0
*/
export declare namespace FileOperationPatternKind {
/**
* The pattern matches a file only.
*/
const file: 'file';
/**
* The pattern matches a folder only.
*/
const folder: 'folder';
}
export type FileOperationPatternKind = 'file' | 'folder';
/**
* Matching options for the file operation pattern.
*
* @since 3.16.0
*/
export interface FileOperationPatternOptions {
/**
* The pattern should be matched ignoring casing.
*/
ignoreCase?: boolean;
}
/**
* A pattern to describe in which file operation requests or notifications
* the server is interested in receiving.
*
* @since 3.16.0
*/
interface FileOperationPattern {
/**
* The glob pattern to match. Glob patterns can have the following syntax:
* - `*` to match zero or more characters in a path segment
* - `?` to match on one character in a path segment
* - `**` to match any number of path segments, including none
* - `{}` to group sub patterns into an OR expression. (e.g. `**​/*.{ts,js}` matches all TypeScript and JavaScript files)
* - `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
* - `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
*/
glob: string;
/**
* Whether to match files or folders with this pattern.
*
* Matches both if undefined.
*/
matches?: FileOperationPatternKind;
/**
* Additional options used during matching.
*/
options?: FileOperationPatternOptions;
}
/**
* A filter to describe in which file operation requests or notifications
* the server is interested in receiving.
*
* @since 3.16.0
*/
export interface FileOperationFilter {
/**
* A Uri scheme like `file` or `untitled`.
*/
scheme?: string;
/**
* The actual file operation pattern.
*/
pattern: FileOperationPattern;
}
/**
* Capabilities relating to events from file operations by the user in the client.
*
* These events do not come from the file system, they come from user operations
* like renaming a file in the UI.
*
* @since 3.16.0
*/
export interface FileOperationClientCapabilities {
/**
* Whether the client supports dynamic registration for file requests/notifications.
*/
dynamicRegistration?: boolean;
/**
* The client has support for sending didCreateFiles notifications.
*/
didCreate?: boolean;
/**
* The client has support for sending willCreateFiles requests.
*/
willCreate?: boolean;
/**
* The client has support for sending didRenameFiles notifications.
*/
didRename?: boolean;
/**
* The client has support for sending willRenameFiles requests.
*/
willRename?: boolean;
/**
* The client has support for sending didDeleteFiles notifications.
*/
didDelete?: boolean;
/**
* The client has support for sending willDeleteFiles requests.
*/
willDelete?: boolean;
}
/**
* The parameters sent in notifications/requests for user-initiated creation of
* files.
*
* @since 3.16.0
*/
export interface CreateFilesParams {
/**
* An array of all files/folders created in this operation.
*/
files: FileCreate[];
}
/**
* Represents information on a file/folder create.
*
* @since 3.16.0
*/
export interface FileCreate {
/**
* A URI for the location of the file/folder being created.
*/
uri: DocumentUri;
}
/**
* The parameters sent in notifications/requests for user-initiated renames of
* files.
*
* @since 3.16.0
*/
export interface RenameFilesParams {
/**
* An array of all files/folders renamed in this operation. When a folder is renamed, only
* the folder will be included, and not its children.
*/
files: FileRename[];
}
/**
* Represents information on a file/folder rename.
*
* @since 3.16.0
*/
export interface FileRename {
/**
* A URI for the original location of the file/folder being renamed.
*/
oldUri: DocumentUri;
/**
* A URI for the new location of the file/folder being renamed.
*/
newUri: DocumentUri;
}
/**
* The parameters sent in notifications/requests for user-initiated deletes of
* files.
*
* @since 3.16.0
*/
export interface DeleteFilesParams {
/**
* An array of all files/folders deleted in this operation.
*/
files: FileDelete[];
}
/**
* Represents information on a file/folder delete.
*
* @since 3.16.0
*/
export interface FileDelete {
/**
* A URI for the location of the file/folder being deleted.
*/
uri: DocumentUri;
}
/**
* The will create files request is sent from the client to the server before files are actually
* created as long as the creation is triggered from within the client.
*
* The request can return a `WorkspaceEdit` which will be applied to workspace before the
* files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
* to be created.
*
* @since 3.16.0
*/
export declare namespace WillCreateFilesRequest {
const method: 'workspace/willCreateFiles';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<CreateFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
type HandlerSignature = RequestHandler<CreateFilesParams, WorkspaceEdit | undefined | null, void>;
const capabilities: CM<"workspace.fileOperations.willCreate", "workspace.fileOperations.willCreate">;
}
/**
* The did create files notification is sent from the client to the server when
* files were created from within the client.
*
* @since 3.16.0
*/
export declare namespace DidCreateFilesNotification {
const method: 'workspace/didCreateFiles';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<CreateFilesParams, FileOperationRegistrationOptions>;
type HandlerSignature = NotificationHandler<CreateFilesParams>;
const capabilities: CM<"workspace.fileOperations.didCreate", "workspace.fileOperations.didCreate">;
}
/**
* The will rename files request is sent from the client to the server before files are actually
* renamed as long as the rename is triggered from within the client.
*
* @since 3.16.0
*/
export declare namespace WillRenameFilesRequest {
const method: 'workspace/willRenameFiles';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<RenameFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
type HandlerSignature = RequestHandler<RenameFilesParams, WorkspaceEdit | undefined | null, void>;
const capabilities: CM<"workspace.fileOperations.willRename", "workspace.fileOperations.willRename">;
}
/**
* The did rename files notification is sent from the client to the server when
* files were renamed from within the client.
*
* @since 3.16.0
*/
export declare namespace DidRenameFilesNotification {
const method: 'workspace/didRenameFiles';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<RenameFilesParams, FileOperationRegistrationOptions>;
type HandlerSignature = NotificationHandler<RenameFilesParams>;
const capabilities: CM<"workspace.fileOperations.didRename", "workspace.fileOperations.didRename">;
}
/**
* The will delete files request is sent from the client to the server before files are actually
* deleted as long as the deletion is triggered from within the client.
*
* @since 3.16.0
*/
export declare namespace DidDeleteFilesNotification {
const method: 'workspace/didDeleteFiles';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DeleteFilesParams, FileOperationRegistrationOptions>;
type HandlerSignature = NotificationHandler<DeleteFilesParams>;
const capabilities: CM<"workspace.fileOperations.didDelete", "workspace.fileOperations.didDelete">;
}
/**
* The did delete files notification is sent from the client to the server when
* files were deleted from within the client.
*
* @since 3.16.0
*/
export declare namespace WillDeleteFilesRequest {
const method: 'workspace/willDeleteFiles';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<DeleteFilesParams, WorkspaceEdit | null, never, void, FileOperationRegistrationOptions>;
type HandlerSignature = RequestHandler<DeleteFilesParams, WorkspaceEdit | undefined | null, void>;
const capabilities: CM<"workspace.fileOperations.willDelete", "workspace.fileOperations.willDelete">;
}
export {};
@@ -0,0 +1,107 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.DidRenameFilesNotification = exports.WillRenameFilesRequest = exports.DidCreateFilesNotification = exports.WillCreateFilesRequest = exports.FileOperationPatternKind = void 0;
const messages_1 = require("./messages");
/**
* A pattern kind describing if a glob pattern matches a file a folder or
* both.
*
* @since 3.16.0
*/
var FileOperationPatternKind;
(function (FileOperationPatternKind) {
/**
* The pattern matches a file only.
*/
FileOperationPatternKind.file = 'file';
/**
* The pattern matches a folder only.
*/
FileOperationPatternKind.folder = 'folder';
})(FileOperationPatternKind || (exports.FileOperationPatternKind = FileOperationPatternKind = {}));
/**
* The will create files request is sent from the client to the server before files are actually
* created as long as the creation is triggered from within the client.
*
* The request can return a `WorkspaceEdit` which will be applied to workspace before the
* files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
* to be created.
*
* @since 3.16.0
*/
var WillCreateFilesRequest;
(function (WillCreateFilesRequest) {
WillCreateFilesRequest.method = 'workspace/willCreateFiles';
WillCreateFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WillCreateFilesRequest.type = new messages_1.ProtocolRequestType(WillCreateFilesRequest.method);
WillCreateFilesRequest.capabilities = messages_1.CM.create('workspace.fileOperations.willCreate', 'workspace.fileOperations.willCreate');
})(WillCreateFilesRequest || (exports.WillCreateFilesRequest = WillCreateFilesRequest = {}));
/**
* The did create files notification is sent from the client to the server when
* files were created from within the client.
*
* @since 3.16.0
*/
var DidCreateFilesNotification;
(function (DidCreateFilesNotification) {
DidCreateFilesNotification.method = 'workspace/didCreateFiles';
DidCreateFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidCreateFilesNotification.type = new messages_1.ProtocolNotificationType(DidCreateFilesNotification.method);
DidCreateFilesNotification.capabilities = messages_1.CM.create('workspace.fileOperations.didCreate', 'workspace.fileOperations.didCreate');
})(DidCreateFilesNotification || (exports.DidCreateFilesNotification = DidCreateFilesNotification = {}));
/**
* The will rename files request is sent from the client to the server before files are actually
* renamed as long as the rename is triggered from within the client.
*
* @since 3.16.0
*/
var WillRenameFilesRequest;
(function (WillRenameFilesRequest) {
WillRenameFilesRequest.method = 'workspace/willRenameFiles';
WillRenameFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WillRenameFilesRequest.type = new messages_1.ProtocolRequestType(WillRenameFilesRequest.method);
WillRenameFilesRequest.capabilities = messages_1.CM.create('workspace.fileOperations.willRename', 'workspace.fileOperations.willRename');
})(WillRenameFilesRequest || (exports.WillRenameFilesRequest = WillRenameFilesRequest = {}));
/**
* The did rename files notification is sent from the client to the server when
* files were renamed from within the client.
*
* @since 3.16.0
*/
var DidRenameFilesNotification;
(function (DidRenameFilesNotification) {
DidRenameFilesNotification.method = 'workspace/didRenameFiles';
DidRenameFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidRenameFilesNotification.type = new messages_1.ProtocolNotificationType(DidRenameFilesNotification.method);
DidRenameFilesNotification.capabilities = messages_1.CM.create('workspace.fileOperations.didRename', 'workspace.fileOperations.didRename');
})(DidRenameFilesNotification || (exports.DidRenameFilesNotification = DidRenameFilesNotification = {}));
/**
* The will delete files request is sent from the client to the server before files are actually
* deleted as long as the deletion is triggered from within the client.
*
* @since 3.16.0
*/
var DidDeleteFilesNotification;
(function (DidDeleteFilesNotification) {
DidDeleteFilesNotification.method = 'workspace/didDeleteFiles';
DidDeleteFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidDeleteFilesNotification.type = new messages_1.ProtocolNotificationType(DidDeleteFilesNotification.method);
DidDeleteFilesNotification.capabilities = messages_1.CM.create('workspace.fileOperations.didDelete', 'workspace.fileOperations.didDelete');
})(DidDeleteFilesNotification || (exports.DidDeleteFilesNotification = DidDeleteFilesNotification = {}));
/**
* The did delete files notification is sent from the client to the server when
* files were deleted from within the client.
*
* @since 3.16.0
*/
var WillDeleteFilesRequest;
(function (WillDeleteFilesRequest) {
WillDeleteFilesRequest.method = 'workspace/willDeleteFiles';
WillDeleteFilesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WillDeleteFilesRequest.type = new messages_1.ProtocolRequestType(WillDeleteFilesRequest.method);
WillDeleteFilesRequest.capabilities = messages_1.CM.create('workspace.fileOperations.willDelete', 'workspace.fileOperations.willDelete');
})(WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = WillDeleteFilesRequest = {}));
@@ -0,0 +1,118 @@
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, uinteger, FoldingRange, FoldingRangeKind } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* @since 3.18.0
*/
export type ClientFoldingRangeKindOptions = {
/**
* The folding range kind values the client supports. When this
* property exists the client also guarantees that it will
* handle values outside its set gracefully and falls back
* to a default value when unknown.
*/
valueSet?: FoldingRangeKind[];
};
/**
* @since 3.18.0
*/
export type ClientFoldingRangeOptions = {
/**
* If set, the client signals that it supports setting collapsedText on
* folding ranges to display custom labels instead of the default text.
*
* @since 3.17.0
*/
collapsedText?: boolean;
};
export interface FoldingRangeClientCapabilities {
/**
* Whether implementation supports dynamic registration for folding range
* providers. If this is set to `true` the client supports the new
* `FoldingRangeRegistrationOptions` return value for the corresponding
* server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The maximum number of folding ranges that the client prefers to receive
* per document. The value serves as a hint, servers are free to follow the
* limit.
*/
rangeLimit?: uinteger;
/**
* If set, the client signals that it only supports folding complete lines.
* If set, client will ignore specified `startCharacter` and `endCharacter`
* properties in a FoldingRange.
*/
lineFoldingOnly?: boolean;
/**
* Specific options for the folding range kind.
*
* @since 3.17.0
*/
foldingRangeKind?: ClientFoldingRangeKindOptions;
/**
* Specific options for the folding range.
*
* @since 3.17.0
*/
foldingRange?: ClientFoldingRangeOptions;
}
/**
* Client workspace capabilities specific to folding ranges
*
* @since 3.18.0
*/
export type FoldingRangeWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
*
* Note that this event is global and will force the client to refresh all
* folding ranges currently shown. It should be used with absolute care and is
* useful for situation where a server for example detects a project wide
* change that requires such a calculation.
*
* @since 3.18.0
*/
refreshSupport?: boolean;
};
export interface FoldingRangeOptions extends WorkDoneProgressOptions {
}
export interface FoldingRangeRegistrationOptions extends TextDocumentRegistrationOptions, FoldingRangeOptions, StaticRegistrationOptions {
}
/**
* Parameters for a {@link FoldingRangeRequest}.
*/
export interface FoldingRangeParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
}
/**
* A request to provide folding ranges in a document. The request's
* parameter is of type {@link FoldingRangeParams}, the
* response is of type {@link FoldingRangeList} or a Thenable
* that resolves to such.
*/
export declare namespace FoldingRangeRequest {
const method: 'textDocument/foldingRange';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<FoldingRangeParams, FoldingRange[] | null, FoldingRange[], void, FoldingRangeRegistrationOptions>;
type HandlerSignature = RequestHandler<FoldingRangeParams, FoldingRange[] | null, void>;
const capabilities: CM<"textDocument.foldingRange", "foldingRangeProvider">;
}
/**
* A request to refresh the folding ranges in a document.
*
* @since 3.18.0
*/
export declare namespace FoldingRangeRefreshRequest {
const method: `workspace/foldingRange/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<void, void, void, void>;
type HandlerSignature = RequestHandler0<void, void>;
const capabilities: CM<"workspace.foldingRange.refreshSupport", undefined>;
}
@@ -0,0 +1,33 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.FoldingRangeRefreshRequest = exports.FoldingRangeRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide folding ranges in a document. The request's
* parameter is of type {@link FoldingRangeParams}, the
* response is of type {@link FoldingRangeList} or a Thenable
* that resolves to such.
*/
var FoldingRangeRequest;
(function (FoldingRangeRequest) {
FoldingRangeRequest.method = 'textDocument/foldingRange';
FoldingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
FoldingRangeRequest.type = new messages_1.ProtocolRequestType(FoldingRangeRequest.method);
FoldingRangeRequest.capabilities = messages_1.CM.create('textDocument.foldingRange', 'foldingRangeProvider');
})(FoldingRangeRequest || (exports.FoldingRangeRequest = FoldingRangeRequest = {}));
/**
* A request to refresh the folding ranges in a document.
*
* @since 3.18.0
*/
var FoldingRangeRefreshRequest;
(function (FoldingRangeRefreshRequest) {
FoldingRangeRefreshRequest.method = `workspace/foldingRange/refresh`;
FoldingRangeRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
FoldingRangeRefreshRequest.type = new messages_1.ProtocolRequestType0(FoldingRangeRefreshRequest.method);
FoldingRangeRefreshRequest.capabilities = messages_1.CM.create('workspace.foldingRange.refreshSupport', undefined);
})(FoldingRangeRefreshRequest || (exports.FoldingRangeRefreshRequest = FoldingRangeRefreshRequest = {}));
@@ -0,0 +1,39 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Definition, DefinitionLink, Location, LocationLink } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* @since 3.6.0
*/
export interface ImplementationClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `ImplementationRegistrationOptions` return value
* for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The client supports additional metadata in the form of definition links.
*
* @since 3.14.0
*/
linkSupport?: boolean;
}
export interface ImplementationOptions extends WorkDoneProgressOptions {
}
export interface ImplementationRegistrationOptions extends TextDocumentRegistrationOptions, ImplementationOptions, StaticRegistrationOptions {
}
export interface ImplementationParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
}
/**
* A request to resolve the implementation locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Definition} or a Thenable that resolves to such.
*/
export declare namespace ImplementationRequest {
const method: 'textDocument/implementation';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<ImplementationParams, Definition | LocationLink[] | null, Location[] | LocationLink[], void, ImplementationRegistrationOptions>;
type HandlerSignature = RequestHandler<ImplementationParams, Definition | DefinitionLink[] | null, void>;
const capabilities: CM<"textDocument.implementation", "implementationProvider">;
}
@@ -0,0 +1,22 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImplementationRequest = void 0;
const messages_1 = require("./messages");
// @ts-ignore: to avoid inlining LocationLink as dynamic import
let __noDynamicImport;
/**
* A request to resolve the implementation locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Definition} or a Thenable that resolves to such.
*/
var ImplementationRequest;
(function (ImplementationRequest) {
ImplementationRequest.method = 'textDocument/implementation';
ImplementationRequest.messageDirection = messages_1.MessageDirection.clientToServer;
ImplementationRequest.type = new messages_1.ProtocolRequestType(ImplementationRequest.method);
ImplementationRequest.capabilities = messages_1.CM.create('textDocument.implementation', 'implementationProvider');
})(ImplementationRequest || (exports.ImplementationRequest = ImplementationRequest = {}));
@@ -0,0 +1,117 @@
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { Range, TextDocumentIdentifier, InlayHint } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import { type PartialResultParams, type StaticRegistrationOptions, type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type WorkDoneProgressParams } from './protocol';
/**
* @since 3.18.0
*/
export type ClientInlayHintResolveOptions = {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
};
/**
* Inlay hint client capabilities.
*
* @since 3.17.0
*/
export type InlayHintClientCapabilities = {
/**
* Whether inlay hints support dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Indicates which properties a client can resolve lazily on an inlay
* hint.
*/
resolveSupport?: ClientInlayHintResolveOptions;
};
/**
* Client workspace capabilities specific to inlay hints.
*
* @since 3.17.0
*/
export type InlayHintWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from
* the server to the client.
*
* Note that this event is global and will force the client to refresh all
* inlay hints currently shown. It should be used with absolute care and
* is useful for situation where a server for example detects a project wide
* change that requires such a calculation.
*/
refreshSupport?: boolean;
};
/**
* Inlay hint options used during static registration.
*
* @since 3.17.0
*/
export type InlayHintOptions = WorkDoneProgressOptions & {
/**
* The server provides support to resolve additional
* information for an inlay hint item.
*/
resolveProvider?: boolean;
};
/**
* Inlay hint options used during static or dynamic registration.
*
* @since 3.17.0
*/
export type InlayHintRegistrationOptions = InlayHintOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inlay hint requests.
*
* @since 3.17.0
*/
export type InlayHintParams = WorkDoneProgressParams & PartialResultParams & {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The document range for which inlay hints should be computed.
*/
range: Range;
};
/**
* A request to provide inlay hints in a document. The request's parameter is of
* type {@link InlayHintsParams}, the response is of type
* {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
export declare namespace InlayHintRequest {
const method: 'textDocument/inlayHint';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<InlayHintParams, InlayHint[] | null, InlayHint[], void, InlayHintRegistrationOptions>;
type HandlerSignature = RequestHandler<InlayHintParams, InlayHint[] | null, void>;
const capabilities: CM<"textDocument.inlayHint", "inlayHintProvider">;
}
/**
* A request to resolve additional properties for an inlay hint.
* The request's parameter is of type {@link InlayHint}, the response is
* of type {@link InlayHint} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
export declare namespace InlayHintResolveRequest {
const method: 'inlayHint/resolve';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<InlayHint, InlayHint, never, void, void>;
type HandlerSignature = RequestHandler<InlayHint, InlayHint, void>;
const capabilities: CM<"textDocument.inlayHint.resolveSupport", "inlayHintProvider.resolveProvider">;
}
/**
* @since 3.17.0
*/
export declare namespace InlayHintRefreshRequest {
const method: `workspace/inlayHint/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<void, void, void, void>;
type HandlerSignature = RequestHandler0<void, void>;
const capabilities: CM<"workspace.inlayHint.refreshSupport", undefined>;
}
@@ -0,0 +1,46 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide inlay hints in a document. The request's parameter is of
* type {@link InlayHintsParams}, the response is of type
* {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
var InlayHintRequest;
(function (InlayHintRequest) {
InlayHintRequest.method = 'textDocument/inlayHint';
InlayHintRequest.messageDirection = messages_1.MessageDirection.clientToServer;
InlayHintRequest.type = new messages_1.ProtocolRequestType(InlayHintRequest.method);
InlayHintRequest.capabilities = messages_1.CM.create('textDocument.inlayHint', 'inlayHintProvider');
})(InlayHintRequest || (exports.InlayHintRequest = InlayHintRequest = {}));
/**
* A request to resolve additional properties for an inlay hint.
* The request's parameter is of type {@link InlayHint}, the response is
* of type {@link InlayHint} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
var InlayHintResolveRequest;
(function (InlayHintResolveRequest) {
InlayHintResolveRequest.method = 'inlayHint/resolve';
InlayHintResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
InlayHintResolveRequest.type = new messages_1.ProtocolRequestType(InlayHintResolveRequest.method);
InlayHintResolveRequest.capabilities = messages_1.CM.create('textDocument.inlayHint.resolveSupport', 'inlayHintProvider.resolveProvider');
})(InlayHintResolveRequest || (exports.InlayHintResolveRequest = InlayHintResolveRequest = {}));
/**
* @since 3.17.0
*/
var InlayHintRefreshRequest;
(function (InlayHintRefreshRequest) {
InlayHintRefreshRequest.method = `workspace/inlayHint/refresh`;
InlayHintRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
InlayHintRefreshRequest.type = new messages_1.ProtocolRequestType0(InlayHintRefreshRequest.method);
InlayHintRefreshRequest.capabilities = messages_1.CM.create('workspace.inlayHint.refreshSupport', undefined);
})(InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = InlayHintRefreshRequest = {}));
@@ -0,0 +1,53 @@
import { InlineCompletionItem, InlineCompletionContext, InlineCompletionList } from 'vscode-languageserver-types';
import { RequestHandler } from 'vscode-jsonrpc';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type StaticRegistrationOptions, type WorkDoneProgressParams, type TextDocumentPositionParams, type PartialResultParams } from './protocol';
/**
* Client capabilities specific to inline completions.
*
* @since 3.18.0
*/
export type InlineCompletionClientCapabilities = {
/**
* Whether implementation supports dynamic registration for inline completion providers.
*/
dynamicRegistration?: boolean;
};
/**
* Inline completion options used during static registration.
*
* @since 3.18.0
*/
export type InlineCompletionOptions = WorkDoneProgressOptions;
/**
* Inline completion options used during static or dynamic registration.
*
* @since 3.18.0
*/
export type InlineCompletionRegistrationOptions = InlineCompletionOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inline completion requests.
*
* @since 3.18.0
*/
export type InlineCompletionParams = WorkDoneProgressParams & TextDocumentPositionParams & PartialResultParams & {
/**
* Additional information about the context in which inline completions were
* requested.
*/
context: InlineCompletionContext;
};
/**
* A request to provide inline completions in a document. The request's parameter is of
* type {@link InlineCompletionParams}, the response is of type
* {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
*
* @since 3.18.0
*/
export declare namespace InlineCompletionRequest {
const method: 'textDocument/inlineCompletion';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<InlineCompletionParams, InlineCompletionList | InlineCompletionItem[] | null, InlineCompletionItem[], void, InlineCompletionRegistrationOptions>;
type HandlerSignature = RequestHandler<InlineCompletionParams, InlineCompletionList | InlineCompletionItem[] | null, void>;
const capabilities: CM<"textDocument.inlineCompletion", "inlineCompletionProvider">;
}
@@ -0,0 +1,22 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.InlineCompletionRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide inline completions in a document. The request's parameter is of
* type {@link InlineCompletionParams}, the response is of type
* {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
*
* @since 3.18.0
*/
var InlineCompletionRequest;
(function (InlineCompletionRequest) {
InlineCompletionRequest.method = 'textDocument/inlineCompletion';
InlineCompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
InlineCompletionRequest.type = new messages_1.ProtocolRequestType(InlineCompletionRequest.method);
InlineCompletionRequest.capabilities = messages_1.CM.create('textDocument.inlineCompletion', 'inlineCompletionProvider');
})(InlineCompletionRequest || (exports.InlineCompletionRequest = InlineCompletionRequest = {}));
@@ -0,0 +1,88 @@
import { TextDocumentIdentifier, Range, InlineValue, InlineValueContext } from 'vscode-languageserver-types';
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { CM, MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import { type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type StaticRegistrationOptions, type WorkDoneProgressParams, type PartialResultParams } from './protocol';
/**
* Client capabilities specific to inline values.
*
* @since 3.17.0
*/
export type InlineValueClientCapabilities = {
/**
* Whether implementation supports dynamic registration for inline value providers.
*/
dynamicRegistration?: boolean;
};
/**
* Client workspace capabilities specific to inline values.
*
* @since 3.17.0
*/
export type InlineValueWorkspaceClientCapabilities = {
/**
* Whether the client implementation supports a refresh request sent from the
* server to the client.
*
* Note that this event is global and will force the client to refresh all
* inline values currently shown. It should be used with absolute care and is
* useful for situation where a server for example detects a project wide
* change that requires such a calculation.
*/
refreshSupport?: boolean;
};
/**
* Inline value options used during static registration.
*
* @since 3.17.0
*/
export type InlineValueOptions = WorkDoneProgressOptions;
/**
* Inline value options used during static or dynamic registration.
*
* @since 3.17.0
*/
export type InlineValueRegistrationOptions = InlineValueOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inline value requests.
*
* @since 3.17.0
*/
export type InlineValueParams = WorkDoneProgressParams & PartialResultParams & {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The document range for which inline values information will be returned.
*/
range: Range;
/**
* Additional information about the context in which inline values information was
* requested.
*/
context: InlineValueContext;
};
/**
* A request to provide inline values in a document. The request's parameter is of
* type {@link InlineValueParams}, the response is of type
* {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
export declare namespace InlineValueRequest {
const method: 'textDocument/inlineValue';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<InlineValueParams, InlineValue[] | null, InlineValue[], void, InlineValueRegistrationOptions>;
type HandlerSignature = RequestHandler<InlineValueParams, InlineValue[] | null, void>;
const capabilities: CM<"textDocument.inlineValue", "inlineValueProvider">;
}
/**
* @since 3.17.0
*/
export declare namespace InlineValueRefreshRequest {
const method: `workspace/inlineValue/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<void, void, void, void>;
type HandlerSignature = RequestHandler0<void, void>;
const capabilities: CM<"workspace.inlineValue.refreshSupport", undefined>;
}
@@ -0,0 +1,32 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.InlineValueRefreshRequest = exports.InlineValueRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide inline values in a document. The request's parameter is of
* type {@link InlineValueParams}, the response is of type
* {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
*
* @since 3.17.0
*/
var InlineValueRequest;
(function (InlineValueRequest) {
InlineValueRequest.method = 'textDocument/inlineValue';
InlineValueRequest.messageDirection = messages_1.MessageDirection.clientToServer;
InlineValueRequest.type = new messages_1.ProtocolRequestType(InlineValueRequest.method);
InlineValueRequest.capabilities = messages_1.CM.create('textDocument.inlineValue', 'inlineValueProvider');
})(InlineValueRequest || (exports.InlineValueRequest = InlineValueRequest = {}));
/**
* @since 3.17.0
*/
var InlineValueRefreshRequest;
(function (InlineValueRefreshRequest) {
InlineValueRefreshRequest.method = `workspace/inlineValue/refresh`;
InlineValueRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
InlineValueRefreshRequest.type = new messages_1.ProtocolRequestType0(InlineValueRefreshRequest.method);
InlineValueRefreshRequest.capabilities = messages_1.CM.create('workspace.inlineValue.refreshSupport', undefined);
})(InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = InlineValueRefreshRequest = {}));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,53 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Range } from 'vscode-languageserver-types';
import { CM, MessageDirection, ProtocolRequestType } from './messages';
import { type StaticRegistrationOptions, type TextDocumentPositionParams, type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type WorkDoneProgressParams } from './protocol';
/**
* Client capabilities for the linked editing range request.
*
* @since 3.16.0
*/
export interface LinkedEditingRangeClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
}
export interface LinkedEditingRangeParams extends TextDocumentPositionParams, WorkDoneProgressParams {
}
export interface LinkedEditingRangeOptions extends WorkDoneProgressOptions {
}
export interface LinkedEditingRangeRegistrationOptions extends TextDocumentRegistrationOptions, LinkedEditingRangeOptions, StaticRegistrationOptions {
}
/**
* The result of a linked editing range request.
*
* @since 3.16.0
*/
export interface LinkedEditingRanges {
/**
* A list of ranges that can be edited together. The ranges must have
* identical length and contain identical text content. The ranges cannot overlap.
*/
ranges: Range[];
/**
* An optional word pattern (regular expression) that describes valid contents for
* the given ranges. If no pattern is provided, the client configuration's word
* pattern will be used.
*/
wordPattern?: string;
}
/**
* A request to provide ranges that can be edited together.
*
* @since 3.16.0
*/
export declare namespace LinkedEditingRangeRequest {
const method: 'textDocument/linkedEditingRange';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<LinkedEditingRangeParams, LinkedEditingRanges | null, void, void, LinkedEditingRangeRegistrationOptions>;
type HandlerSignature = RequestHandler<LinkedEditingRangeParams, LinkedEditingRanges | null, void>;
const capabilities: CM<"textDocument.linkedEditingRange", "linkedEditingRangeProvider">;
}
@@ -0,0 +1,20 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.LinkedEditingRangeRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide ranges that can be edited together.
*
* @since 3.16.0
*/
var LinkedEditingRangeRequest;
(function (LinkedEditingRangeRequest) {
LinkedEditingRangeRequest.method = 'textDocument/linkedEditingRange';
LinkedEditingRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
LinkedEditingRangeRequest.type = new messages_1.ProtocolRequestType(LinkedEditingRangeRequest.method);
LinkedEditingRangeRequest.capabilities = messages_1.CM.create('textDocument.linkedEditingRange', 'linkedEditingRangeProvider');
})(LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = LinkedEditingRangeRequest = {}));
@@ -0,0 +1,107 @@
import { MessageDirection, ProtocolRequestType, CM } from './messages';
import { type WorkDoneProgressOptions, type WorkDoneProgressParams, type PartialResultParams, type TextDocumentRegistrationOptions, type TextDocumentPositionParams } from './protocol';
/**
* Moniker uniqueness level to define scope of the moniker.
*
* @since 3.16.0
*/
export declare namespace UniquenessLevel {
/**
* The moniker is only unique inside a document
*/
const document = "document";
/**
* The moniker is unique inside a project for which a dump got created
*/
const project = "project";
/**
* The moniker is unique inside the group to which a project belongs
*/
const group = "group";
/**
* The moniker is unique inside the moniker scheme.
*/
const scheme = "scheme";
/**
* The moniker is globally unique
*/
const global = "global";
}
export type UniquenessLevel = 'document' | 'project' | 'group' | 'scheme' | 'global';
/**
* The moniker kind.
*
* @since 3.16.0
*/
export declare namespace MonikerKind {
/**
* The moniker represent a symbol that is imported into a project
*/
const $import = "import";
/**
* The moniker represents a symbol that is exported from a project
*/
const $export = "export";
/**
* The moniker represents a symbol that is local to a project (e.g. a local
* variable of a function, a class not visible outside the project, ...)
*/
const local = "local";
}
export type MonikerKind = 'import' | 'export' | 'local';
/**
* Moniker definition to match LSIF 0.5 moniker definition.
*
* @since 3.16.0
*/
export interface Moniker {
/**
* The scheme of the moniker. For example tsc or .Net
*/
scheme: string;
/**
* The identifier of the moniker. The value is opaque in LSIF however
* schema owners are allowed to define the structure if they want.
*/
identifier: string;
/**
* The scope in which the moniker is unique
*/
unique: UniquenessLevel;
/**
* The moniker kind if known.
*/
kind?: MonikerKind;
}
/**
* Client capabilities specific to the moniker request.
*
* @since 3.16.0
*/
export interface MonikerClientCapabilities {
/**
* Whether moniker supports dynamic registration. If this is set to `true`
* the client supports the new `MonikerRegistrationOptions` return value
* for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
}
export interface MonikerServerCapabilities {
}
export interface MonikerOptions extends WorkDoneProgressOptions {
}
export interface MonikerRegistrationOptions extends TextDocumentRegistrationOptions, MonikerOptions {
}
export interface MonikerParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
}
/**
* A request to get the moniker of a symbol at a given text document position.
* The request parameter is of type {@link TextDocumentPositionParams}.
* The response is of type {@link Moniker Moniker[]} or `null`.
*/
export declare namespace MonikerRequest {
const method: 'textDocument/moniker';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<MonikerParams, Moniker[] | null, Moniker[], void, MonikerRegistrationOptions>;
const capabilities: CM<"textDocument.moniker", "monikerProvider">;
}
@@ -0,0 +1,69 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = void 0;
const messages_1 = require("./messages");
/**
* Moniker uniqueness level to define scope of the moniker.
*
* @since 3.16.0
*/
var UniquenessLevel;
(function (UniquenessLevel) {
/**
* The moniker is only unique inside a document
*/
UniquenessLevel.document = 'document';
/**
* The moniker is unique inside a project for which a dump got created
*/
UniquenessLevel.project = 'project';
/**
* The moniker is unique inside the group to which a project belongs
*/
UniquenessLevel.group = 'group';
/**
* The moniker is unique inside the moniker scheme.
*/
UniquenessLevel.scheme = 'scheme';
/**
* The moniker is globally unique
*/
UniquenessLevel.global = 'global';
})(UniquenessLevel || (exports.UniquenessLevel = UniquenessLevel = {}));
/**
* The moniker kind.
*
* @since 3.16.0
*/
var MonikerKind;
(function (MonikerKind) {
/**
* The moniker represent a symbol that is imported into a project
*/
MonikerKind.$import = 'import';
/**
* The moniker represents a symbol that is exported from a project
*/
MonikerKind.$export = 'export';
/**
* The moniker represents a symbol that is local to a project (e.g. a local
* variable of a function, a class not visible outside the project, ...)
*/
MonikerKind.local = 'local';
})(MonikerKind || (exports.MonikerKind = MonikerKind = {}));
/**
* A request to get the moniker of a symbol at a given text document position.
* The request parameter is of type {@link TextDocumentPositionParams}.
* The response is of type {@link Moniker Moniker[]} or `null`.
*/
var MonikerRequest;
(function (MonikerRequest) {
MonikerRequest.method = 'textDocument/moniker';
MonikerRequest.messageDirection = messages_1.MessageDirection.clientToServer;
MonikerRequest.type = new messages_1.ProtocolRequestType(MonikerRequest.method);
MonikerRequest.capabilities = messages_1.CM.create('textDocument.moniker', 'monikerProvider');
})(MonikerRequest || (exports.MonikerRequest = MonikerRequest = {}));
@@ -0,0 +1,428 @@
import { URI, integer, DocumentUri, uinteger, TextDocumentItem, TextDocumentIdentifier, VersionedTextDocumentIdentifier, LSPObject } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolNotificationType, RegistrationType } from './messages';
import type { StaticRegistrationOptions, NotebookDocumentFilter, TextDocumentContentChangeEvent } from './protocol';
/**
* Notebook specific client capabilities.
*
* @since 3.17.0
*/
export type NotebookDocumentSyncClientCapabilities = {
/**
* Whether implementation supports dynamic registration. If this is
* set to `true` the client supports the new
* `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The client supports sending execution summary data per cell.
*/
executionSummarySupport?: boolean;
};
/**
* A notebook cell kind.
*
* @since 3.17.0
*/
export declare namespace NotebookCellKind {
/**
* A markup-cell is formatted source that is used for display.
*/
const Markup: 1;
/**
* A code-cell is source code.
*/
const Code: 2;
function is(value: any): value is NotebookCellKind;
}
export type NotebookCellKind = 1 | 2;
export type ExecutionSummary = {
/**
* A strict monotonically increasing value
* indicating the execution order of a cell
* inside a notebook.
*/
executionOrder: uinteger;
/**
* Whether the execution was successful or
* not if known by the client.
*/
success?: boolean;
};
export declare namespace ExecutionSummary {
function create(executionOrder: number, success?: boolean): ExecutionSummary;
function is(value: any): value is ExecutionSummary;
function equals(one: ExecutionSummary | undefined, other: ExecutionSummary | undefined): boolean;
}
/**
* A notebook cell.
*
* A cell's document URI must be unique across ALL notebook
* cells and can therefore be used to uniquely identify a
* notebook cell or the cell's text document.
*
* @since 3.17.0
*/
export type NotebookCell = {
/**
* The cell's kind
*/
kind: NotebookCellKind;
/**
* The URI of the cell's text document
* content.
*/
document: DocumentUri;
/**
* Additional metadata stored with the cell.
*
* Note: should always be an object literal (e.g. LSPObject)
*/
metadata?: LSPObject;
/**
* Additional execution summary information
* if supported by the client.
*/
executionSummary?: ExecutionSummary;
};
export declare namespace NotebookCell {
function create(kind: NotebookCellKind, document: DocumentUri): NotebookCell;
function is(value: any): value is NotebookCell;
function diff(one: NotebookCell, two: NotebookCell): Set<keyof NotebookCell>;
}
/**
* A notebook document.
*
* @since 3.17.0
*/
export type NotebookDocument = {
/**
* The notebook document's uri.
*/
uri: URI;
/**
* The type of the notebook.
*/
notebookType: string;
/**
* The version number of this document (it will increase after each
* change, including undo/redo).
*/
version: integer;
/**
* Additional metadata stored with the notebook
* document.
*
* Note: should always be an object literal (e.g. LSPObject)
*/
metadata?: LSPObject;
/**
* The cells of a notebook.
*/
cells: NotebookCell[];
};
export declare namespace NotebookDocument {
function create(uri: URI, notebookType: string, version: integer, cells: NotebookCell[]): NotebookDocument;
function is(value: any): value is NotebookDocument;
}
/**
* A literal to identify a notebook document in the client.
*
* @since 3.17.0
*/
export type NotebookDocumentIdentifier = {
/**
* The notebook document's uri.
*/
uri: URI;
};
/**
* A versioned notebook document identifier.
*
* @since 3.17.0
*/
export type VersionedNotebookDocumentIdentifier = {
/**
* The version number of this notebook document.
*/
version: integer;
/**
* The notebook document's uri.
*/
uri: URI;
};
/**
* @since 3.18.0
*/
export type NotebookCellLanguage = {
language: string;
};
/**
* @since 3.18.0
*/
export type NotebookDocumentFilterWithNotebook = {
/**
* The notebook to be synced If a string
* value is provided it matches against the
* notebook type. '*' matches every notebook.
*/
notebook: string | NotebookDocumentFilter;
/**
* The cells of the matching notebook to be synced.
*/
cells?: NotebookCellLanguage[];
};
/**
* @since 3.18.0
*/
export type NotebookDocumentFilterWithCells = {
/**
* The notebook to be synced If a string
* value is provided it matches against the
* notebook type. '*' matches every notebook.
*/
notebook?: string | NotebookDocumentFilter;
/**
* The cells of the matching notebook to be synced.
*/
cells: NotebookCellLanguage[];
};
/**
* Options specific to a notebook plus its cells
* to be synced to the server.
*
* If a selector provides a notebook document
* filter but no cell selector all cells of a
* matching notebook document will be synced.
*
* If a selector provides no notebook document
* filter but only a cell selector all notebook
* document that contain at least one matching
* cell will be synced.
*
* @since 3.17.0
*/
export type NotebookDocumentSyncOptions = {
/**
* The notebooks to be synced
*/
notebookSelector: (NotebookDocumentFilterWithNotebook | NotebookDocumentFilterWithCells)[];
/**
* Whether save notification should be forwarded to
* the server. Will only be honored if mode === `notebook`.
*/
save?: boolean;
};
/**
* Registration options specific to a notebook.
*
* @since 3.17.0
*/
export type NotebookDocumentSyncRegistrationOptions = NotebookDocumentSyncOptions & StaticRegistrationOptions;
export declare namespace NotebookDocumentSyncRegistrationType {
const method: 'notebookDocument/sync';
const messageDirection: MessageDirection;
const type: RegistrationType<NotebookDocumentSyncRegistrationOptions>;
}
/**
* The params sent in an open notebook document notification.
*
* @since 3.17.0
*/
export type DidOpenNotebookDocumentParams = {
/**
* The notebook document that got opened.
*/
notebookDocument: NotebookDocument;
/**
* The text documents that represent the content
* of a notebook cell.
*/
cellTextDocuments: TextDocumentItem[];
};
/**
* A notification sent when a notebook opens.
*
* @since 3.17.0
*/
export declare namespace DidOpenNotebookDocumentNotification {
const method: 'notebookDocument/didOpen';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DidOpenNotebookDocumentParams, NotebookDocumentSyncRegistrationOptions>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* A change describing how to move a `NotebookCell`
* array from state S to S'.
*
* @since 3.17.0
*/
export type NotebookCellArrayChange = {
/**
* The start oftest of the cell that changed.
*/
start: uinteger;
/**
* The deleted cells
*/
deleteCount: uinteger;
/**
* The new cells, if any
*/
cells?: NotebookCell[];
};
export declare namespace NotebookCellArrayChange {
function is(value: any): value is NotebookCellArrayChange;
function create(start: uinteger, deleteCount: uinteger, cells?: NotebookCell[]): NotebookCellArrayChange;
}
/**
* Structural changes to cells in a notebook document.
*
* @since 3.18.0
*/
export type NotebookDocumentCellChangeStructure = {
/**
* The change to the cell array.
*/
array: NotebookCellArrayChange;
/**
* Additional opened cell text documents.
*/
didOpen?: TextDocumentItem[];
/**
* Additional closed cell text documents.
*/
didClose?: TextDocumentIdentifier[];
};
/**
* Content changes to a cell in a notebook document.
*
* @since 3.18.0
*/
export type NotebookDocumentCellContentChanges = {
document: VersionedTextDocumentIdentifier;
changes: TextDocumentContentChangeEvent[];
};
/**
* Cell changes to a notebook document.
*
* @since 3.18.0
*/
export type NotebookDocumentCellChanges = {
/**
* Changes to the cell structure to add or
* remove cells.
*/
structure?: NotebookDocumentCellChangeStructure;
/**
* Changes to notebook cells properties like its
* kind, execution summary or metadata.
*/
data?: NotebookCell[];
/**
* Changes to the text content of notebook cells.
*/
textContent?: NotebookDocumentCellContentChanges[];
};
/**
* A change event for a notebook document.
*
* @since 3.17.0
*/
export type NotebookDocumentChangeEvent = {
/**
* The changed meta data if any.
*
* Note: should always be an object literal (e.g. LSPObject)
*/
metadata?: LSPObject;
/**
* Changes to cells
*/
cells?: NotebookDocumentCellChanges;
};
/**
* The params sent in a change notebook document notification.
*
* @since 3.17.0
*/
export type DidChangeNotebookDocumentParams = {
/**
* The notebook document that did change. The version number points
* to the version after all provided changes have been applied. If
* only the text document content of a cell changes the notebook version
* doesn't necessarily have to change.
*/
notebookDocument: VersionedNotebookDocumentIdentifier;
/**
* The actual changes to the notebook document.
*
* The changes describe single state changes to the notebook document.
* So if there are two changes c1 (at array index 0) and c2 (at array
* index 1) for a notebook in state S then c1 moves the notebook from
* S to S' and c2 from S' to S''. So c1 is computed on the state S and
* c2 is computed on the state S'.
*
* To mirror the content of a notebook using change events use the following approach:
* - start with the same initial content
* - apply the 'notebookDocument/didChange' notifications in the order you receive them.
* - apply the `NotebookChangeEvent`s in a single notification in the order
* you receive them.
*/
change: NotebookDocumentChangeEvent;
};
export declare namespace DidChangeNotebookDocumentNotification {
const method: 'notebookDocument/didChange';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DidChangeNotebookDocumentParams, NotebookDocumentSyncRegistrationOptions>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* The params sent in a save notebook document notification.
*
* @since 3.17.0
*/
export type DidSaveNotebookDocumentParams = {
/**
* The notebook document that got saved.
*/
notebookDocument: NotebookDocumentIdentifier;
};
/**
* A notification sent when a notebook document is saved.
*
* @since 3.17.0
*/
export declare namespace DidSaveNotebookDocumentNotification {
const method: 'notebookDocument/didSave';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DidSaveNotebookDocumentParams, NotebookDocumentSyncRegistrationOptions>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* The params sent in a close notebook document notification.
*
* @since 3.17.0
*/
export type DidCloseNotebookDocumentParams = {
/**
* The notebook document that got closed.
*/
notebookDocument: NotebookDocumentIdentifier;
/**
* The text documents that represent the content
* of a notebook cell that got closed.
*/
cellTextDocuments: TextDocumentIdentifier[];
};
/**
* A notification sent when a notebook closes.
*
* @since 3.17.0
*/
export declare namespace DidCloseNotebookDocumentNotification {
const method: 'notebookDocument/didClose';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DidCloseNotebookDocumentParams, NotebookDocumentSyncRegistrationOptions>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
@@ -0,0 +1,247 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = void 0;
const vscode_languageserver_types_1 = require("vscode-languageserver-types");
const Is = __importStar(require("./utils/is"));
const messages_1 = require("./messages");
/**
* A notebook cell kind.
*
* @since 3.17.0
*/
var NotebookCellKind;
(function (NotebookCellKind) {
/**
* A markup-cell is formatted source that is used for display.
*/
NotebookCellKind.Markup = 1;
/**
* A code-cell is source code.
*/
NotebookCellKind.Code = 2;
function is(value) {
return value === 1 || value === 2;
}
NotebookCellKind.is = is;
})(NotebookCellKind || (exports.NotebookCellKind = NotebookCellKind = {}));
var ExecutionSummary;
(function (ExecutionSummary) {
function create(executionOrder, success) {
const result = { executionOrder };
if (success === true || success === false) {
result.success = success;
}
return result;
}
ExecutionSummary.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.executionOrder) && (candidate.success === undefined || Is.boolean(candidate.success));
}
ExecutionSummary.is = is;
function equals(one, other) {
if (one === other) {
return true;
}
if (one === null || one === undefined || other === null || other === undefined) {
return false;
}
return one.executionOrder === other.executionOrder && one.success === other.success;
}
ExecutionSummary.equals = equals;
})(ExecutionSummary || (exports.ExecutionSummary = ExecutionSummary = {}));
var NotebookCell;
(function (NotebookCell) {
function create(kind, document) {
return { kind, document };
}
NotebookCell.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && NotebookCellKind.is(candidate.kind) && vscode_languageserver_types_1.DocumentUri.is(candidate.document) &&
(candidate.metadata === undefined || Is.objectLiteral(candidate.metadata));
}
NotebookCell.is = is;
function diff(one, two) {
const result = new Set();
if (one.document !== two.document) {
result.add('document');
}
if (one.kind !== two.kind) {
result.add('kind');
}
if (one.executionSummary !== two.executionSummary) {
result.add('executionSummary');
}
if ((one.metadata !== undefined || two.metadata !== undefined) && !equalsMetadata(one.metadata, two.metadata)) {
result.add('metadata');
}
if ((one.executionSummary !== undefined || two.executionSummary !== undefined) && !ExecutionSummary.equals(one.executionSummary, two.executionSummary)) {
result.add('executionSummary');
}
return result;
}
NotebookCell.diff = diff;
function equalsMetadata(one, other) {
if (one === other) {
return true;
}
if (one === null || one === undefined || other === null || other === undefined) {
return false;
}
if (typeof one !== typeof other) {
return false;
}
if (typeof one !== 'object') {
return false;
}
const oneArray = Array.isArray(one);
const otherArray = Array.isArray(other);
if (oneArray !== otherArray) {
return false;
}
if (oneArray && otherArray) {
if (one.length !== other.length) {
return false;
}
for (let i = 0; i < one.length; i++) {
if (!equalsMetadata(one[i], other[i])) {
return false;
}
}
}
if (Is.objectLiteral(one) && Is.objectLiteral(other)) {
const oneKeys = Object.keys(one);
const otherKeys = Object.keys(other);
if (oneKeys.length !== otherKeys.length) {
return false;
}
oneKeys.sort();
otherKeys.sort();
if (!equalsMetadata(oneKeys, otherKeys)) {
return false;
}
for (let i = 0; i < oneKeys.length; i++) {
const prop = oneKeys[i];
if (!equalsMetadata(one[prop], other[prop])) {
return false;
}
}
}
return true;
}
})(NotebookCell || (exports.NotebookCell = NotebookCell = {}));
var NotebookDocument;
(function (NotebookDocument) {
function create(uri, notebookType, version, cells) {
return { uri, notebookType, version, cells };
}
NotebookDocument.create = create;
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && Is.string(candidate.uri) && vscode_languageserver_types_1.integer.is(candidate.version) && Is.typedArray(candidate.cells, NotebookCell.is);
}
NotebookDocument.is = is;
})(NotebookDocument || (exports.NotebookDocument = NotebookDocument = {}));
var NotebookDocumentSyncRegistrationType;
(function (NotebookDocumentSyncRegistrationType) {
NotebookDocumentSyncRegistrationType.method = 'notebookDocument/sync';
NotebookDocumentSyncRegistrationType.messageDirection = messages_1.MessageDirection.clientToServer;
NotebookDocumentSyncRegistrationType.type = new messages_1.RegistrationType(NotebookDocumentSyncRegistrationType.method);
})(NotebookDocumentSyncRegistrationType || (exports.NotebookDocumentSyncRegistrationType = NotebookDocumentSyncRegistrationType = {}));
/**
* A notification sent when a notebook opens.
*
* @since 3.17.0
*/
var DidOpenNotebookDocumentNotification;
(function (DidOpenNotebookDocumentNotification) {
DidOpenNotebookDocumentNotification.method = 'notebookDocument/didOpen';
DidOpenNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidOpenNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenNotebookDocumentNotification.method);
DidOpenNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
})(DidOpenNotebookDocumentNotification || (exports.DidOpenNotebookDocumentNotification = DidOpenNotebookDocumentNotification = {}));
var NotebookCellArrayChange;
(function (NotebookCellArrayChange) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && vscode_languageserver_types_1.uinteger.is(candidate.start) && vscode_languageserver_types_1.uinteger.is(candidate.deleteCount) && (candidate.cells === undefined || Is.typedArray(candidate.cells, NotebookCell.is));
}
NotebookCellArrayChange.is = is;
function create(start, deleteCount, cells) {
const result = { start, deleteCount };
if (cells !== undefined) {
result.cells = cells;
}
return result;
}
NotebookCellArrayChange.create = create;
})(NotebookCellArrayChange || (exports.NotebookCellArrayChange = NotebookCellArrayChange = {}));
var DidChangeNotebookDocumentNotification;
(function (DidChangeNotebookDocumentNotification) {
DidChangeNotebookDocumentNotification.method = 'notebookDocument/didChange';
DidChangeNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidChangeNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeNotebookDocumentNotification.method);
DidChangeNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
})(DidChangeNotebookDocumentNotification || (exports.DidChangeNotebookDocumentNotification = DidChangeNotebookDocumentNotification = {}));
/**
* A notification sent when a notebook document is saved.
*
* @since 3.17.0
*/
var DidSaveNotebookDocumentNotification;
(function (DidSaveNotebookDocumentNotification) {
DidSaveNotebookDocumentNotification.method = 'notebookDocument/didSave';
DidSaveNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidSaveNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveNotebookDocumentNotification.method);
DidSaveNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
})(DidSaveNotebookDocumentNotification || (exports.DidSaveNotebookDocumentNotification = DidSaveNotebookDocumentNotification = {}));
/**
* A notification sent when a notebook closes.
*
* @since 3.17.0
*/
var DidCloseNotebookDocumentNotification;
(function (DidCloseNotebookDocumentNotification) {
DidCloseNotebookDocumentNotification.method = 'notebookDocument/didClose';
DidCloseNotebookDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidCloseNotebookDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseNotebookDocumentNotification.method);
DidCloseNotebookDocumentNotification.registrationMethod = NotebookDocumentSyncRegistrationType.method;
})(DidCloseNotebookDocumentNotification || (exports.DidCloseNotebookDocumentNotification = DidCloseNotebookDocumentNotification = {}));
@@ -0,0 +1,108 @@
import { NotificationHandler, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
import { uinteger } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, ProtocolNotificationType, CM } from './messages';
export interface WorkDoneProgressBegin {
kind: 'begin';
/**
* Mandatory title of the progress operation. Used to briefly inform about
* the kind of operation being performed.
*
* Examples: "Indexing" or "Linking dependencies".
*/
title: string;
/**
* Controls if a cancel button should show to allow the user to cancel the
* long running operation. Clients that don't support cancellation are allowed
* to ignore the setting.
*/
cancellable?: boolean;
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
message?: string;
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule. The value range is [0, 100].
*/
percentage?: uinteger;
}
export interface WorkDoneProgressReport {
kind: 'report';
/**
* Controls enablement state of a cancel button.
*
* Clients that don't support cancellation or don't support controlling the button's
* enablement state are allowed to ignore the property.
*/
cancellable?: boolean;
/**
* Optional, more detailed associated progress message. Contains
* complementary information to the `title`.
*
* Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
* If unset, the previous progress message (if any) is still valid.
*/
message?: string;
/**
* Optional progress percentage to display (value 100 is considered 100%).
* If not provided infinite progress is assumed and clients are allowed
* to ignore the `percentage` value in subsequent in report notifications.
*
* The value should be steadily rising. Clients are free to ignore values
* that are not following this rule. The value range is [0, 100]
*/
percentage?: uinteger;
}
export interface WorkDoneProgressEnd {
kind: 'end';
/**
* Optional, a final message indicating to for example indicate the outcome
* of the operation.
*/
message?: string;
}
export declare namespace WorkDoneProgress {
const type: ProgressType<WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd>;
function is(value: ProgressType<any>): value is typeof type;
}
export interface WorkDoneProgressCreateParams {
/**
* The token to be used to report progress.
*/
token: ProgressToken;
}
/**
* The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
* reporting from the server.
*/
export declare namespace WorkDoneProgressCreateRequest {
const method: 'window/workDoneProgress/create';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<WorkDoneProgressCreateParams, void, never, void, void>;
type HandlerSignature = RequestHandler<WorkDoneProgressCreateParams, void, void>;
const capabilities: CM<"window.workDoneProgress", undefined>;
}
export interface WorkDoneProgressCancelParams {
/**
* The token to be used to report progress.
*/
token: ProgressToken;
}
/**
* The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
* initiated on the server side.
*/
export declare namespace WorkDoneProgressCancelNotification {
const method: 'window/workDoneProgress/cancel';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<WorkDoneProgressCancelParams, void>;
type HandlerSignature = NotificationHandler<WorkDoneProgressCancelParams>;
}
@@ -0,0 +1,38 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = void 0;
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
const messages_1 = require("./messages");
var WorkDoneProgress;
(function (WorkDoneProgress) {
WorkDoneProgress.type = new vscode_jsonrpc_1.ProgressType();
function is(value) {
return value === WorkDoneProgress.type;
}
WorkDoneProgress.is = is;
})(WorkDoneProgress || (exports.WorkDoneProgress = WorkDoneProgress = {}));
/**
* The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
* reporting from the server.
*/
var WorkDoneProgressCreateRequest;
(function (WorkDoneProgressCreateRequest) {
WorkDoneProgressCreateRequest.method = 'window/workDoneProgress/create';
WorkDoneProgressCreateRequest.messageDirection = messages_1.MessageDirection.serverToClient;
WorkDoneProgressCreateRequest.type = new messages_1.ProtocolRequestType(WorkDoneProgressCreateRequest.method);
WorkDoneProgressCreateRequest.capabilities = messages_1.CM.create('window.workDoneProgress', undefined);
})(WorkDoneProgressCreateRequest || (exports.WorkDoneProgressCreateRequest = WorkDoneProgressCreateRequest = {}));
/**
* The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
* initiated on the server side.
*/
var WorkDoneProgressCancelNotification;
(function (WorkDoneProgressCancelNotification) {
WorkDoneProgressCancelNotification.method = 'window/workDoneProgress/cancel';
WorkDoneProgressCancelNotification.messageDirection = messages_1.MessageDirection.clientToServer;
WorkDoneProgressCancelNotification.type = new messages_1.ProtocolNotificationType(WorkDoneProgressCancelNotification.method);
})(WorkDoneProgressCancelNotification || (exports.WorkDoneProgressCancelNotification = WorkDoneProgressCancelNotification = {}));
@@ -0,0 +1,42 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Position, SelectionRange } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, CM } from './messages';
import { type TextDocumentRegistrationOptions, type WorkDoneProgressOptions, type StaticRegistrationOptions, type WorkDoneProgressParams, type PartialResultParams } from './protocol';
export interface SelectionRangeClientCapabilities {
/**
* Whether implementation supports dynamic registration for selection range providers. If this is set to `true`
* the client supports the new `SelectionRangeRegistrationOptions` return value for the corresponding server
* capability as well.
*/
dynamicRegistration?: boolean;
}
export interface SelectionRangeOptions extends WorkDoneProgressOptions {
}
export interface SelectionRangeRegistrationOptions extends SelectionRangeOptions, TextDocumentRegistrationOptions, StaticRegistrationOptions {
}
/**
* A parameter literal used in selection range requests.
*/
export interface SelectionRangeParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The positions inside the text document.
*/
positions: Position[];
}
/**
* A request to provide selection ranges in a document. The request's
* parameter is of type {@link SelectionRangeParams}, the
* response is of type {@link SelectionRange SelectionRange[]} or a Thenable
* that resolves to such.
*/
export declare namespace SelectionRangeRequest {
const method: 'textDocument/selectionRange';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<SelectionRangeParams, SelectionRange[] | null, SelectionRange[], void, SelectionRangeRegistrationOptions>;
type HandlerSignature = RequestHandler<SelectionRangeParams, SelectionRange[] | null, void>;
const capabilities: CM<"textDocument.selectionRange", "selectionRangeProvider">;
}
@@ -0,0 +1,21 @@
"use strict";
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionRangeRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to provide selection ranges in a document. The request's
* parameter is of type {@link SelectionRangeParams}, the
* response is of type {@link SelectionRange SelectionRange[]} or a Thenable
* that resolves to such.
*/
var SelectionRangeRequest;
(function (SelectionRangeRequest) {
SelectionRangeRequest.method = 'textDocument/selectionRange';
SelectionRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
SelectionRangeRequest.type = new messages_1.ProtocolRequestType(SelectionRangeRequest.method);
SelectionRangeRequest.capabilities = messages_1.CM.create('textDocument.selectionRange', 'selectionRangeProvider');
})(SelectionRangeRequest || (exports.SelectionRangeRequest = SelectionRangeRequest = {}));
@@ -0,0 +1,241 @@
import { TextDocumentIdentifier, Range, uinteger, SemanticTokensEdit, SemanticTokensLegend, SemanticTokens, SemanticTokensDelta } from 'vscode-languageserver-types';
import { RequestHandler0, RequestHandler } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType, ProtocolRequestType0, RegistrationType, CM } from './messages';
import { type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions, type TextDocumentRegistrationOptions, type StaticRegistrationOptions } from './protocol';
/**
* @since 3.16.0
*/
export interface SemanticTokensPartialResult {
data: uinteger[];
}
/**
* @since 3.16.0
*/
export interface SemanticTokensDeltaPartialResult {
edits: SemanticTokensEdit[];
}
export declare namespace TokenFormat {
const Relative: 'relative';
}
export type TokenFormat = 'relative';
/**
* @since 3.18.0
*/
export type ClientSemanticTokensRequestFullDelta = {
/**
* The client will send the `textDocument/semanticTokens/full/delta` request if
* the server provides a corresponding handler.
*/
delta?: boolean;
};
/**
* @since 3.18.0
*/
export type ClientSemanticTokensRequestOptions = {
/**
* The client will send the `textDocument/semanticTokens/range` request if
* the server provides a corresponding handler.
*/
range?: boolean | {};
/**
* The client will send the `textDocument/semanticTokens/full` request if
* the server provides a corresponding handler.
*/
full?: boolean | ClientSemanticTokensRequestFullDelta;
};
/**
* @since 3.16.0
*/
export interface SemanticTokensClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* Which requests the client supports and might send to the server
* depending on the server's capability. Please note that clients might not
* show semantic tokens or degrade some of the user experience if a range
* or full request is advertised by the client but not provided by the
* server. If for example the client capability `requests.full` and
* `request.range` are both set to true but the server only provides a
* range provider the client might not render a minimap correctly or might
* even decide to not show any semantic tokens at all.
*/
requests: ClientSemanticTokensRequestOptions;
/**
* The token types that the client supports.
*/
tokenTypes: string[];
/**
* The token modifiers that the client supports.
*/
tokenModifiers: string[];
/**
* The token formats the clients supports.
*/
formats: TokenFormat[];
/**
* Whether the client supports tokens that can overlap each other.
*/
overlappingTokenSupport?: boolean;
/**
* Whether the client supports tokens that can span multiple lines.
*/
multilineTokenSupport?: boolean;
/**
* Whether the client allows the server to actively cancel a
* semantic token request, e.g. supports returning
* LSPErrorCodes.ServerCancelled. If a server does the client
* needs to retrigger the request.
*
* @since 3.17.0
*/
serverCancelSupport?: boolean;
/**
* Whether the client uses semantic tokens to augment existing
* syntax tokens. If set to `true` client side created syntax
* tokens and semantic tokens are both used for colorization. If
* set to `false` the client only uses the returned semantic tokens
* for colorization.
*
* If the value is `undefined` then the client behavior is not
* specified.
*
* @since 3.17.0
*/
augmentsSyntaxTokens?: boolean;
}
/**
* Semantic tokens options to support deltas for full documents
*
* @since 3.18.0
*/
export type SemanticTokensFullDelta = {
/**
* The server supports deltas for full documents.
*/
delta?: boolean;
};
/**
* @since 3.16.0
*/
export interface SemanticTokensOptions extends WorkDoneProgressOptions {
/**
* The legend used by the server
*/
legend: SemanticTokensLegend;
/**
* Server supports providing semantic tokens for a specific range
* of a document.
*/
range?: boolean | {};
/**
* Server supports providing semantic tokens for a full document.
*/
full?: boolean | SemanticTokensFullDelta;
}
/**
* @since 3.16.0
*/
export interface SemanticTokensRegistrationOptions extends TextDocumentRegistrationOptions, SemanticTokensOptions, StaticRegistrationOptions {
}
export declare namespace SemanticTokensRegistrationType {
const method: 'textDocument/semanticTokens';
const type: RegistrationType<SemanticTokensRegistrationOptions>;
}
/**
* @since 3.16.0
*/
export interface SemanticTokensParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
}
/**
* @since 3.16.0
*/
export declare namespace SemanticTokensRequest {
const method: 'textDocument/semanticTokens/full';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<SemanticTokensParams, SemanticTokens | null, SemanticTokensPartialResult, void, SemanticTokensRegistrationOptions>;
const registrationMethod: typeof SemanticTokensRegistrationType.method;
type HandlerSignature = RequestHandler<SemanticTokensDeltaParams, SemanticTokens | null, void>;
const capabilities: CM<"textDocument.semanticTokens", "semanticTokensProvider">;
}
/**
* @since 3.16.0
*/
export interface SemanticTokensDeltaParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The result id of a previous response. The result Id can either point to a full response
* or a delta response depending on what was received last.
*/
previousResultId: string;
}
/**
* @since 3.16.0
*/
export declare namespace SemanticTokensDeltaRequest {
const method: 'textDocument/semanticTokens/full/delta';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<SemanticTokensDeltaParams, SemanticTokens | SemanticTokensDelta | null, SemanticTokensPartialResult | SemanticTokensDeltaPartialResult, void, SemanticTokensRegistrationOptions>;
const registrationMethod: typeof SemanticTokensRegistrationType.method;
type HandlerSignature = RequestHandler<SemanticTokensDeltaParams, SemanticTokens | SemanticTokensDelta | null, void>;
const capabilities: CM<"textDocument.semanticTokens.requests.full.delta", "semanticTokensProvider.full.delta">;
}
/**
* @since 3.16.0
*/
export interface SemanticTokensRangeParams extends WorkDoneProgressParams, PartialResultParams {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The range the semantic tokens are requested for.
*/
range: Range;
}
/**
* @since 3.16.0
*/
export declare namespace SemanticTokensRangeRequest {
const method: 'textDocument/semanticTokens/range';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<SemanticTokensRangeParams, SemanticTokens | null, SemanticTokensPartialResult, void, void>;
const registrationMethod: typeof SemanticTokensRegistrationType.method;
type HandlerSignature = RequestHandler<SemanticTokensRangeParams, SemanticTokens | null, void>;
const capabilities: CM<"textDocument.semanticTokens.requests.range", "semanticTokensProvider.range">;
}
/**
* @since 3.16.0
*/
export interface SemanticTokensWorkspaceClientCapabilities {
/**
* Whether the client implementation supports a refresh request sent from
* the server to the client.
*
* Note that this event is global and will force the client to refresh all
* semantic tokens currently shown. It should be used with absolute care
* and is useful for situation where a server for example detects a project
* wide change that requires such a calculation.
*/
refreshSupport?: boolean;
}
/**
* @since 3.16.0
*/
export declare namespace SemanticTokensRefreshRequest {
const method: `workspace/semanticTokens/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<void, void, void, void>;
type HandlerSignature = RequestHandler0<void, void>;
const capabilities: CM<"workspace.semanticTokens.refreshSupport", undefined>;
}
@@ -0,0 +1,61 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.SemanticTokensRegistrationType = exports.TokenFormat = void 0;
const messages_1 = require("./messages");
//------- 'textDocument/semanticTokens' -----
var TokenFormat;
(function (TokenFormat) {
TokenFormat.Relative = 'relative';
})(TokenFormat || (exports.TokenFormat = TokenFormat = {}));
var SemanticTokensRegistrationType;
(function (SemanticTokensRegistrationType) {
SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';
SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);
})(SemanticTokensRegistrationType || (exports.SemanticTokensRegistrationType = SemanticTokensRegistrationType = {}));
/**
* @since 3.16.0
*/
var SemanticTokensRequest;
(function (SemanticTokensRequest) {
SemanticTokensRequest.method = 'textDocument/semanticTokens/full';
SemanticTokensRequest.messageDirection = messages_1.MessageDirection.clientToServer;
SemanticTokensRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRequest.method);
SemanticTokensRequest.registrationMethod = SemanticTokensRegistrationType.method;
SemanticTokensRequest.capabilities = messages_1.CM.create('textDocument.semanticTokens', 'semanticTokensProvider');
})(SemanticTokensRequest || (exports.SemanticTokensRequest = SemanticTokensRequest = {}));
/**
* @since 3.16.0
*/
var SemanticTokensDeltaRequest;
(function (SemanticTokensDeltaRequest) {
SemanticTokensDeltaRequest.method = 'textDocument/semanticTokens/full/delta';
SemanticTokensDeltaRequest.messageDirection = messages_1.MessageDirection.clientToServer;
SemanticTokensDeltaRequest.type = new messages_1.ProtocolRequestType(SemanticTokensDeltaRequest.method);
SemanticTokensDeltaRequest.registrationMethod = SemanticTokensRegistrationType.method;
SemanticTokensDeltaRequest.capabilities = messages_1.CM.create('textDocument.semanticTokens.requests.full.delta', 'semanticTokensProvider.full.delta');
})(SemanticTokensDeltaRequest || (exports.SemanticTokensDeltaRequest = SemanticTokensDeltaRequest = {}));
/**
* @since 3.16.0
*/
var SemanticTokensRangeRequest;
(function (SemanticTokensRangeRequest) {
SemanticTokensRangeRequest.method = 'textDocument/semanticTokens/range';
SemanticTokensRangeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
SemanticTokensRangeRequest.type = new messages_1.ProtocolRequestType(SemanticTokensRangeRequest.method);
SemanticTokensRangeRequest.registrationMethod = SemanticTokensRegistrationType.method;
SemanticTokensRangeRequest.capabilities = messages_1.CM.create('textDocument.semanticTokens.requests.range', 'semanticTokensProvider.range');
})(SemanticTokensRangeRequest || (exports.SemanticTokensRangeRequest = SemanticTokensRangeRequest = {}));
/**
* @since 3.16.0
*/
var SemanticTokensRefreshRequest;
(function (SemanticTokensRefreshRequest) {
SemanticTokensRefreshRequest.method = `workspace/semanticTokens/refresh`;
SemanticTokensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
SemanticTokensRefreshRequest.type = new messages_1.ProtocolRequestType0(SemanticTokensRefreshRequest.method);
SemanticTokensRefreshRequest.capabilities = messages_1.CM.create('workspace.semanticTokens.refreshSupport', undefined);
})(SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = SemanticTokensRefreshRequest = {}));
@@ -0,0 +1,73 @@
import { CancellationToken, HandlerResult, RequestHandler } from 'vscode-jsonrpc';
import { Range, URI } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, CM } from './messages';
/**
* Client capabilities for the showDocument request.
*
* @since 3.16.0
*/
export interface ShowDocumentClientCapabilities {
/**
* The client has support for the showDocument
* request.
*/
support: boolean;
}
/**
* Params to show a resource in the UI.
*
* @since 3.16.0
*/
export interface ShowDocumentParams {
/**
* The uri to show.
*/
uri: URI;
/**
* Indicates to show the resource in an external program.
* To show, for example, `https://code.visualstudio.com/`
* in the default WEB browser set `external` to `true`.
*/
external?: boolean;
/**
* An optional property to indicate whether the editor
* showing the document should take focus or not.
* Clients might ignore this property if an external
* program is started.
*/
takeFocus?: boolean;
/**
* An optional selection range if the document is a text
* document. Clients might ignore the property if an
* external program is started or the file is not a text
* file.
*/
selection?: Range;
}
/**
* The result of a showDocument request.
*
* @since 3.16.0
*/
export interface ShowDocumentResult {
/**
* A boolean indicating if the show was successful.
*/
success: boolean;
}
/**
* A request to show a document. This request might open an
* external program depending on the value of the URI to open.
* For example a request to open `https://code.visualstudio.com/`
* will very likely open the URI in a WEB browser.
*
* @since 3.16.0
*/
export declare namespace ShowDocumentRequest {
const method: 'window/showDocument';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<ShowDocumentParams, ShowDocumentResult, void, void, void>;
type HandlerSignature = RequestHandler<ShowDocumentParams, ShowDocumentResult, void>;
type MiddlewareSignature = (params: ShowDocumentParams, token: CancellationToken, next: HandlerSignature) => HandlerResult<ShowDocumentResult, void>;
const capabilities: CM<"window.showDocument.support", undefined>;
}
@@ -0,0 +1,23 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShowDocumentRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to show a document. This request might open an
* external program depending on the value of the URI to open.
* For example a request to open `https://code.visualstudio.com/`
* will very likely open the URI in a WEB browser.
*
* @since 3.16.0
*/
var ShowDocumentRequest;
(function (ShowDocumentRequest) {
ShowDocumentRequest.method = 'window/showDocument';
ShowDocumentRequest.messageDirection = messages_1.MessageDirection.serverToClient;
ShowDocumentRequest.type = new messages_1.ProtocolRequestType(ShowDocumentRequest.method);
ShowDocumentRequest.capabilities = messages_1.CM.create('window.showDocument.support', undefined);
})(ShowDocumentRequest || (exports.ShowDocumentRequest = ShowDocumentRequest = {}));
@@ -0,0 +1,93 @@
import type { DocumentUri } from 'vscode-languageserver-types';
import type { RequestHandler } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType, CM } from './messages';
import { type StaticRegistrationOptions } from './protocol';
/**
* Client capabilities for a text document content provider.
*
* @since 3.18.0
*/
export type TextDocumentContentClientCapabilities = {
/**
* Text document content provider supports dynamic registration.
*/
dynamicRegistration?: boolean;
};
/**
* Text document content provider options.
*
* @since 3.18.0
*/
export type TextDocumentContentOptions = {
/**
* The schemes for which the server provides content.
*/
schemes: string[];
};
/**
* Text document content provider registration options.
*
* @since 3.18.0
*/
export type TextDocumentContentRegistrationOptions = TextDocumentContentOptions & StaticRegistrationOptions;
/**
* Parameters for the `workspace/textDocumentContent` request.
*
* @since 3.18.0
*/
export interface TextDocumentContentParams {
/**
* The uri of the text document.
*/
uri: DocumentUri;
}
/**
* Result of the `workspace/textDocumentContent` request.
*
* @since 3.18.0
*/
export interface TextDocumentContentResult {
/**
* The text content of the text document. Please note, that the content of
* any subsequent open notifications for the text document might differ
* from the returned content due to whitespace and line ending
* normalizations done on the client
*/
text: string;
}
/**
* The `workspace/textDocumentContent` request is sent from the client to the
* server to request the content of a text document.
*
* @since 3.18.0
*/
export declare namespace TextDocumentContentRequest {
const method: 'workspace/textDocumentContent';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TextDocumentContentParams, TextDocumentContentResult, void, void, TextDocumentContentRegistrationOptions>;
type HandlerSignature = RequestHandler<TextDocumentContentParams, TextDocumentContentResult, void>;
const capabilities: CM<"workspace.textDocumentContent", "workspace.textDocumentContent">;
}
/**
* Parameters for the `workspace/textDocumentContent/refresh` request.
*
* @since 3.18.0
*/
export interface TextDocumentContentRefreshParams {
/**
* The uri of the text document to refresh.
*/
uri: DocumentUri;
}
/**
* The `workspace/textDocumentContent` request is sent from the server to the client to refresh
* the content of a specific text document.
*
* @since 3.18.0
*/
export declare namespace TextDocumentContentRefreshRequest {
const method: `workspace/textDocumentContent/refresh`;
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TextDocumentContentRefreshParams, void, void, void, void>;
type HandlerSignature = RequestHandler<TextDocumentContentRefreshParams, void, void>;
}
@@ -0,0 +1,33 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextDocumentContentRefreshRequest = exports.TextDocumentContentRequest = void 0;
const messages_1 = require("./messages");
/**
* The `workspace/textDocumentContent` request is sent from the client to the
* server to request the content of a text document.
*
* @since 3.18.0
*/
var TextDocumentContentRequest;
(function (TextDocumentContentRequest) {
TextDocumentContentRequest.method = 'workspace/textDocumentContent';
TextDocumentContentRequest.messageDirection = messages_1.MessageDirection.clientToServer;
TextDocumentContentRequest.type = new messages_1.ProtocolRequestType(TextDocumentContentRequest.method);
TextDocumentContentRequest.capabilities = messages_1.CM.create('workspace.textDocumentContent', 'workspace.textDocumentContent');
})(TextDocumentContentRequest || (exports.TextDocumentContentRequest = TextDocumentContentRequest = {}));
/**
* The `workspace/textDocumentContent` request is sent from the server to the client to refresh
* the content of a specific text document.
*
* @since 3.18.0
*/
var TextDocumentContentRefreshRequest;
(function (TextDocumentContentRefreshRequest) {
TextDocumentContentRefreshRequest.method = `workspace/textDocumentContent/refresh`;
TextDocumentContentRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
TextDocumentContentRefreshRequest.type = new messages_1.ProtocolRequestType(TextDocumentContentRefreshRequest.method);
})(TextDocumentContentRefreshRequest || (exports.TextDocumentContentRefreshRequest = TextDocumentContentRefreshRequest = {}));
@@ -0,0 +1,39 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Definition, DefinitionLink, LocationLink, Location } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, CM } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* Since 3.6.0
*/
export interface TypeDefinitionClientCapabilities {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `TypeDefinitionRegistrationOptions` return value
* for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
/**
* The client supports additional metadata in the form of definition links.
*
* Since 3.14.0
*/
linkSupport?: boolean;
}
export interface TypeDefinitionOptions extends WorkDoneProgressOptions {
}
export interface TypeDefinitionRegistrationOptions extends TextDocumentRegistrationOptions, TypeDefinitionOptions, StaticRegistrationOptions {
}
export interface TypeDefinitionParams extends TextDocumentPositionParams, WorkDoneProgressParams, PartialResultParams {
}
/**
* A request to resolve the type definition locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Definition} or a Thenable that resolves to such.
*/
export declare namespace TypeDefinitionRequest {
const method: 'textDocument/typeDefinition';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TypeDefinitionParams, Definition | LocationLink[] | null, Location[] | LocationLink[], void, TypeDefinitionRegistrationOptions>;
type HandlerSignature = RequestHandler<TypeDefinitionParams, Definition | DefinitionLink[] | null, void>;
const capabilities: CM<"textDocument.typeDefinition", "typeDefinitionProvider">;
}
@@ -0,0 +1,22 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeDefinitionRequest = void 0;
const messages_1 = require("./messages");
// @ts-ignore: to avoid inlining LocationLink as dynamic import
let __noDynamicImport;
/**
* A request to resolve the type definition locations of a symbol at a given text
* document position. The request's parameter is of type {@link TextDocumentPositionParams}
* the response is of type {@link Definition} or a Thenable that resolves to such.
*/
var TypeDefinitionRequest;
(function (TypeDefinitionRequest) {
TypeDefinitionRequest.method = 'textDocument/typeDefinition';
TypeDefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
TypeDefinitionRequest.type = new messages_1.ProtocolRequestType(TypeDefinitionRequest.method);
TypeDefinitionRequest.capabilities = messages_1.CM.create('textDocument.typeDefinition', 'typeDefinitionProvider');
})(TypeDefinitionRequest || (exports.TypeDefinitionRequest = TypeDefinitionRequest = {}));
@@ -0,0 +1,84 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TypeHierarchyItem } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, CM } from './messages';
import { type TextDocumentRegistrationOptions, type StaticRegistrationOptions, type TextDocumentPositionParams, type PartialResultParams, type WorkDoneProgressParams, type WorkDoneProgressOptions } from './protocol';
/**
* @since 3.17.0
*/
export type TypeHierarchyClientCapabilities = {
/**
* Whether implementation supports dynamic registration. If this is set to `true`
* the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
* return value for the corresponding server capability as well.
*/
dynamicRegistration?: boolean;
};
/**
* Type hierarchy options used during static registration.
*
* @since 3.17.0
*/
export type TypeHierarchyOptions = WorkDoneProgressOptions;
/**
* Type hierarchy options used during static or dynamic registration.
*
* @since 3.17.0
*/
export type TypeHierarchyRegistrationOptions = TextDocumentRegistrationOptions & TypeHierarchyOptions & StaticRegistrationOptions;
/**
* The parameter of a `textDocument/prepareTypeHierarchy` request.
*
* @since 3.17.0
*/
export type TypeHierarchyPrepareParams = TextDocumentPositionParams & WorkDoneProgressParams;
/**
* A request to result a `TypeHierarchyItem` in a document at a given position.
* Can be used as an input to a subtypes or supertypes type hierarchy.
*
* @since 3.17.0
*/
export declare namespace TypeHierarchyPrepareRequest {
const method: 'textDocument/prepareTypeHierarchy';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TypeHierarchyPrepareParams, TypeHierarchyItem[] | null, never, void, TypeHierarchyRegistrationOptions>;
type HandlerSignature = RequestHandler<TypeHierarchyPrepareParams, TypeHierarchyItem[] | null, void>;
const capabilities: CM<"textDocument.typeHierarchy", "typeHierarchyProvider">;
}
/**
* The parameter of a `typeHierarchy/supertypes` request.
*
* @since 3.17.0
*/
export type TypeHierarchySupertypesParams = WorkDoneProgressParams & PartialResultParams & {
item: TypeHierarchyItem;
};
/**
* A request to resolve the supertypes for a given `TypeHierarchyItem`.
*
* @since 3.17.0
*/
export declare namespace TypeHierarchySupertypesRequest {
const method: 'typeHierarchy/supertypes';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TypeHierarchySupertypesParams, TypeHierarchyItem[] | null, TypeHierarchyItem[], void, void>;
type HandlerSignature = RequestHandler<TypeHierarchySupertypesParams, TypeHierarchyItem[] | null, void>;
}
/**
* The parameter of a `typeHierarchy/subtypes` request.
*
* @since 3.17.0
*/
export type TypeHierarchySubtypesParams = WorkDoneProgressParams & PartialResultParams & {
item: TypeHierarchyItem;
};
/**
* A request to resolve the subtypes for a given `TypeHierarchyItem`.
*
* @since 3.17.0
*/
export declare namespace TypeHierarchySubtypesRequest {
const method: 'typeHierarchy/subtypes';
const messageDirection: MessageDirection;
const type: ProtocolRequestType<TypeHierarchySubtypesParams, TypeHierarchyItem[] | null, TypeHierarchyItem[], void, void>;
type HandlerSignature = RequestHandler<TypeHierarchySubtypesParams, TypeHierarchyItem[] | null, void>;
}
@@ -0,0 +1,43 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) TypeFox, Microsoft and others. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.TypeHierarchySubtypesRequest = exports.TypeHierarchySupertypesRequest = exports.TypeHierarchyPrepareRequest = void 0;
const messages_1 = require("./messages");
/**
* A request to result a `TypeHierarchyItem` in a document at a given position.
* Can be used as an input to a subtypes or supertypes type hierarchy.
*
* @since 3.17.0
*/
var TypeHierarchyPrepareRequest;
(function (TypeHierarchyPrepareRequest) {
TypeHierarchyPrepareRequest.method = 'textDocument/prepareTypeHierarchy';
TypeHierarchyPrepareRequest.messageDirection = messages_1.MessageDirection.clientToServer;
TypeHierarchyPrepareRequest.type = new messages_1.ProtocolRequestType(TypeHierarchyPrepareRequest.method);
TypeHierarchyPrepareRequest.capabilities = messages_1.CM.create('textDocument.typeHierarchy', 'typeHierarchyProvider');
})(TypeHierarchyPrepareRequest || (exports.TypeHierarchyPrepareRequest = TypeHierarchyPrepareRequest = {}));
/**
* A request to resolve the supertypes for a given `TypeHierarchyItem`.
*
* @since 3.17.0
*/
var TypeHierarchySupertypesRequest;
(function (TypeHierarchySupertypesRequest) {
TypeHierarchySupertypesRequest.method = 'typeHierarchy/supertypes';
TypeHierarchySupertypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
TypeHierarchySupertypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySupertypesRequest.method);
})(TypeHierarchySupertypesRequest || (exports.TypeHierarchySupertypesRequest = TypeHierarchySupertypesRequest = {}));
/**
* A request to resolve the subtypes for a given `TypeHierarchyItem`.
*
* @since 3.17.0
*/
var TypeHierarchySubtypesRequest;
(function (TypeHierarchySubtypesRequest) {
TypeHierarchySubtypesRequest.method = 'typeHierarchy/subtypes';
TypeHierarchySubtypesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
TypeHierarchySubtypesRequest.type = new messages_1.ProtocolRequestType(TypeHierarchySubtypesRequest.method);
})(TypeHierarchySubtypesRequest || (exports.TypeHierarchySubtypesRequest = TypeHierarchySubtypesRequest = {}));
@@ -0,0 +1,76 @@
import { WorkspaceFolder } from 'vscode-languageserver-types';
import { RequestHandler0, NotificationHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType, CM } from './messages';
export interface WorkspaceFoldersInitializeParams {
/**
* The workspace folders configured in the client when the server starts.
*
* This property is only available if the client supports workspace folders.
* It can be `null` if the client supports workspace folders but none are
* configured.
*
* @since 3.6.0
*/
workspaceFolders?: WorkspaceFolder[] | null;
}
export interface WorkspaceFoldersServerCapabilities {
/**
* The server has support for workspace folders
*/
supported?: boolean;
/**
* Whether the server wants to receive workspace folder
* change notifications.
*
* If a string is provided the string is treated as an ID
* under which the notification is registered on the client
* side. The ID can be used to unregister for these events
* using the `client/unregisterCapability` request.
*/
changeNotifications?: string | boolean;
}
/**
* The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
*/
export declare namespace WorkspaceFoldersRequest {
const method: 'workspace/workspaceFolders';
const messageDirection: MessageDirection;
const type: ProtocolRequestType0<WorkspaceFolder[] | null, never, void, void>;
type HandlerSignature = RequestHandler0<WorkspaceFolder[] | null, void>;
type MiddlewareSignature = (token: CancellationToken, next: HandlerSignature) => HandlerResult<WorkspaceFolder[] | null, void>;
const capabilities: CM<"workspace.workspaceFolders", "workspace.workspaceFolders">;
}
/**
* The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
* folder configuration changes.
*/
export declare namespace DidChangeWorkspaceFoldersNotification {
const method: 'workspace/didChangeWorkspaceFolders';
const messageDirection: MessageDirection;
const type: ProtocolNotificationType<DidChangeWorkspaceFoldersParams, void>;
type HandlerSignature = NotificationHandler<DidChangeWorkspaceFoldersParams>;
type MiddlewareSignature = (params: DidChangeWorkspaceFoldersParams, next: HandlerSignature) => void;
const capabilities: CM<undefined, "workspace.workspaceFolders.changeNotifications">;
}
/**
* The parameters of a `workspace/didChangeWorkspaceFolders` notification.
*/
export interface DidChangeWorkspaceFoldersParams {
/**
* The actual workspace folder change event.
*/
event: WorkspaceFoldersChangeEvent;
}
/**
* The workspace folder change event.
*/
export interface WorkspaceFoldersChangeEvent {
/**
* The array of added workspace folders
*/
added: WorkspaceFolder[];
/**
* The array of the removed workspace folders
*/
removed: WorkspaceFolder[];
}
@@ -0,0 +1,29 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
Object.defineProperty(exports, "__esModule", { value: true });
exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = void 0;
const messages_1 = require("./messages");
/**
* The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
*/
var WorkspaceFoldersRequest;
(function (WorkspaceFoldersRequest) {
WorkspaceFoldersRequest.method = 'workspace/workspaceFolders';
WorkspaceFoldersRequest.messageDirection = messages_1.MessageDirection.serverToClient;
WorkspaceFoldersRequest.type = new messages_1.ProtocolRequestType0(WorkspaceFoldersRequest.method);
WorkspaceFoldersRequest.capabilities = messages_1.CM.create('workspace.workspaceFolders', 'workspace.workspaceFolders');
})(WorkspaceFoldersRequest || (exports.WorkspaceFoldersRequest = WorkspaceFoldersRequest = {}));
/**
* The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
* folder configuration changes.
*/
var DidChangeWorkspaceFoldersNotification;
(function (DidChangeWorkspaceFoldersNotification) {
DidChangeWorkspaceFoldersNotification.method = 'workspace/didChangeWorkspaceFolders';
DidChangeWorkspaceFoldersNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidChangeWorkspaceFoldersNotification.type = new messages_1.ProtocolNotificationType(DidChangeWorkspaceFoldersNotification.method);
DidChangeWorkspaceFoldersNotification.capabilities = messages_1.CM.create(undefined, 'workspace.workspaceFolders.changeNotifications');
})(DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = DidChangeWorkspaceFoldersNotification = {}));
@@ -0,0 +1,9 @@
export declare function boolean(value: any): value is boolean;
export declare function string(value: any): value is string;
export declare function number(value: any): value is number;
export declare function error(value: any): value is Error;
export declare function func(value: any): value is Function;
export declare function array<T>(value: any): value is T[];
export declare function stringArray(value: any): value is string[];
export declare function typedArray<T>(value: any, check: (value: any) => boolean): value is T[];
export declare function objectLiteral(value: any): value is object;
@@ -0,0 +1,45 @@
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
exports.boolean = boolean;
exports.string = string;
exports.number = number;
exports.error = error;
exports.func = func;
exports.array = array;
exports.stringArray = stringArray;
exports.typedArray = typedArray;
exports.objectLiteral = objectLiteral;
function boolean(value) {
return value === true || value === false;
}
function string(value) {
return typeof value === 'string' || value instanceof String;
}
function number(value) {
return typeof value === 'number' || value instanceof Number;
}
function error(value) {
return value instanceof Error;
}
function func(value) {
return typeof value === 'function';
}
function array(value) {
return Array.isArray(value);
}
function stringArray(value) {
return array(value) && value.every(elem => string(elem));
}
function typedArray(value, check) {
return Array.isArray(value) && value.every(check);
}
function objectLiteral(value) {
// Strictly speaking class instances pass this check as well. Since the LSP
// doesn't use classes we ignore this for now. If we do we need to add something
// like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`
return value !== null && typeof value === 'object';
}
@@ -0,0 +1,5 @@
import { MessageReader, MessageWriter, Logger, ConnectionStrategy, ConnectionOptions, ProtocolConnection } from '../common/api';
export * from 'vscode-jsonrpc/node';
export * from '../common/api';
export declare function createProtocolConnection(input: MessageReader, output: MessageWriter, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
export declare function createProtocolConnection(input: NodeJS.ReadableStream, output: NodeJS.WritableStream, logger?: Logger, options?: ConnectionStrategy | ConnectionOptions): ProtocolConnection;
@@ -0,0 +1,27 @@
"use strict";
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createProtocolConnection = createProtocolConnection;
const node_1 = require("vscode-jsonrpc/node");
__exportStar(require("vscode-jsonrpc/node"), exports);
__exportStar(require("../common/api"), exports);
function createProtocolConnection(input, output, logger, options) {
return (0, node_1.createMessageConnection)(input, output, logger, options);
}
@@ -0,0 +1,864 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"AndType": {
"additionalProperties": false,
"description": "Represents an `and` type (e.g. TextDocumentParams & WorkDoneProgressParams`).",
"properties": {
"items": {
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
},
"kind": {
"const": "and",
"type": "string"
}
},
"required": [
"kind",
"items"
],
"type": "object"
},
"ArrayType": {
"additionalProperties": false,
"description": "Represents an array type (e.g. `TextDocument[]`).",
"properties": {
"element": {
"$ref": "#/definitions/Type"
},
"kind": {
"const": "array",
"type": "string"
}
},
"required": [
"kind",
"element"
],
"type": "object"
},
"BaseType": {
"additionalProperties": false,
"description": "Represents a base type like `string` or `DocumentUri`.",
"properties": {
"kind": {
"const": "base",
"type": "string"
},
"name": {
"$ref": "#/definitions/BaseTypes"
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"BaseTypes": {
"enum": [
"URI",
"DocumentUri",
"integer",
"uinteger",
"decimal",
"RegExp",
"string",
"boolean",
"null"
],
"type": "string"
},
"BooleanLiteralType": {
"additionalProperties": false,
"description": "Represents a boolean literal type (e.g. `kind: true`).",
"properties": {
"kind": {
"const": "booleanLiteral",
"type": "string"
},
"value": {
"type": "boolean"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"Enumeration": {
"additionalProperties": false,
"description": "Defines an enumeration.",
"properties": {
"deprecated": {
"description": "Whether the enumeration is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation.",
"type": "string"
},
"name": {
"description": "The name of the enumeration.",
"type": "string"
},
"proposed": {
"description": "Whether this is a proposed enumeration. If omitted, the enumeration is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this enumeration is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"supportsCustomValues": {
"description": "Whether the enumeration supports custom values (e.g. values which are not part of the set defined in `values`). If omitted no custom values are supported.",
"type": "boolean"
},
"type": {
"$ref": "#/definitions/EnumerationType",
"description": "The type of the elements."
},
"values": {
"description": "The enum values.",
"items": {
"$ref": "#/definitions/EnumerationEntry"
},
"type": "array"
}
},
"required": [
"name",
"type",
"values"
],
"type": "object"
},
"EnumerationEntry": {
"additionalProperties": false,
"description": "Defines an enumeration entry.",
"properties": {
"deprecated": {
"description": "Whether the enum entry is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation.",
"type": "string"
},
"name": {
"description": "The name of the enum item.",
"type": "string"
},
"proposed": {
"description": "Whether this is a proposed enumeration entry. If omitted, the enumeration entry is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this enumeration entry is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"value": {
"description": "The value.",
"type": [
"string",
"number"
]
}
},
"required": [
"name",
"value"
],
"type": "object"
},
"EnumerationType": {
"additionalProperties": false,
"properties": {
"kind": {
"const": "base",
"type": "string"
},
"name": {
"enum": [
"string",
"integer",
"uinteger"
],
"type": "string"
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"IntegerLiteralType": {
"additionalProperties": false,
"properties": {
"kind": {
"const": "integerLiteral",
"description": "Represents an integer literal type (e.g. `kind: 1`).",
"type": "string"
},
"value": {
"type": "number"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"MapKeyType": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"kind": {
"const": "base",
"type": "string"
},
"name": {
"enum": [
"URI",
"DocumentUri",
"string",
"integer"
],
"type": "string"
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
{
"$ref": "#/definitions/ReferenceType"
}
],
"description": "Represents a type that can be used as a key in a map type. If a reference type is used then the type must either resolve to a `string` or `integer` type. (e.g. `type ChangeAnnotationIdentifier === string`)."
},
"MapType": {
"additionalProperties": false,
"description": "Represents a JSON object map (e.g. `interface Map<K extends string | integer, V> { [key: K] => V; }`).",
"properties": {
"key": {
"$ref": "#/definitions/MapKeyType"
},
"kind": {
"const": "map",
"type": "string"
},
"value": {
"$ref": "#/definitions/Type"
}
},
"required": [
"kind",
"key",
"value"
],
"type": "object"
},
"MessageDirection": {
"description": "Indicates in which direction a message is sent in the protocol.",
"enum": [
"clientToServer",
"serverToClient",
"both"
],
"type": "string"
},
"MetaData": {
"additionalProperties": false,
"properties": {
"version": {
"description": "The protocol version.",
"type": "string"
}
},
"required": [
"version"
],
"type": "object"
},
"MetaModel": {
"additionalProperties": false,
"description": "The actual meta model.",
"properties": {
"enumerations": {
"description": "The enumerations.",
"items": {
"$ref": "#/definitions/Enumeration"
},
"type": "array"
},
"metaData": {
"$ref": "#/definitions/MetaData",
"description": "Additional meta data."
},
"notifications": {
"description": "The notifications.",
"items": {
"$ref": "#/definitions/Notification"
},
"type": "array"
},
"requests": {
"description": "The requests.",
"items": {
"$ref": "#/definitions/Request"
},
"type": "array"
},
"structures": {
"description": "The structures.",
"items": {
"$ref": "#/definitions/Structure"
},
"type": "array"
},
"typeAliases": {
"description": "The type aliases.",
"items": {
"$ref": "#/definitions/TypeAlias"
},
"type": "array"
}
},
"required": [
"metaData",
"requests",
"notifications",
"structures",
"enumerations",
"typeAliases"
],
"type": "object"
},
"Notification": {
"additionalProperties": false,
"description": "Represents a LSP notification",
"properties": {
"clientCapability": {
"description": "The client capability property path if any.",
"type": "string"
},
"deprecated": {
"description": "Whether the notification is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation;",
"type": "string"
},
"messageDirection": {
"$ref": "#/definitions/MessageDirection",
"description": "The direction in which this notification is sent in the protocol."
},
"method": {
"description": "The notifications's method name.",
"type": "string"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/Type"
},
{
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
}
],
"description": "The parameter type(s) if any."
},
"proposed": {
"description": "Whether this is a proposed notification. If omitted the notification is final.",
"type": "boolean"
},
"registrationMethod": {
"description": "Optional a dynamic registration method if it different from the notifications's method.",
"type": "string"
},
"registrationOptions": {
"$ref": "#/definitions/Type",
"description": "Optional registration options if the notification supports dynamic registration."
},
"serverCapability": {
"description": "The server capability property path if any.",
"type": "string"
},
"since": {
"description": "Since when (release number) this notification is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"typeName": {
"description": "The type name of the notifications if any.",
"type": "string"
}
},
"required": [
"method",
"messageDirection"
],
"type": "object"
},
"OrType": {
"additionalProperties": false,
"description": "Represents an `or` type (e.g. `Location | LocationLink`).",
"properties": {
"items": {
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
},
"kind": {
"const": "or",
"type": "string"
}
},
"required": [
"kind",
"items"
],
"type": "object"
},
"Property": {
"additionalProperties": false,
"description": "Represents an object property.",
"properties": {
"deprecated": {
"description": "Whether the property is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation.",
"type": "string"
},
"name": {
"description": "The property name;",
"type": "string"
},
"optional": {
"description": "Whether the property is optional. If omitted, the property is mandatory.",
"type": "boolean"
},
"proposed": {
"description": "Whether this is a proposed property. If omitted, the structure is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this property is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"$ref": "#/definitions/Type",
"description": "The type of the property"
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"ReferenceType": {
"additionalProperties": false,
"description": "Represents a reference to another type (e.g. `TextDocument`). This is either a `Structure`, a `Enumeration` or a `TypeAlias` in the same meta model.",
"properties": {
"kind": {
"const": "reference",
"type": "string"
},
"name": {
"type": "string"
}
},
"required": [
"kind",
"name"
],
"type": "object"
},
"Request": {
"additionalProperties": false,
"description": "Represents a LSP request",
"properties": {
"clientCapability": {
"description": "The client capability property path if any.",
"type": "string"
},
"deprecated": {
"description": "Whether the request is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation;",
"type": "string"
},
"errorData": {
"$ref": "#/definitions/Type",
"description": "An optional error data type."
},
"messageDirection": {
"$ref": "#/definitions/MessageDirection",
"description": "The direction in which this request is sent in the protocol."
},
"method": {
"description": "The request's method name.",
"type": "string"
},
"params": {
"anyOf": [
{
"$ref": "#/definitions/Type"
},
{
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
}
],
"description": "The parameter type(s) if any."
},
"partialResult": {
"$ref": "#/definitions/Type",
"description": "Optional partial result type if the request supports partial result reporting."
},
"proposed": {
"description": "Whether this is a proposed feature. If omitted the feature is final.",
"type": "boolean"
},
"registrationMethod": {
"description": "Optional a dynamic registration method if it different from the request's method.",
"type": "string"
},
"registrationOptions": {
"$ref": "#/definitions/Type",
"description": "Optional registration options if the request supports dynamic registration."
},
"result": {
"$ref": "#/definitions/Type",
"description": "The result type."
},
"serverCapability": {
"description": "The server capability property path if any.",
"type": "string"
},
"since": {
"description": "Since when (release number) this request is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"typeName": {
"description": "The type name of the request if any.",
"type": "string"
}
},
"required": [
"method",
"result",
"messageDirection"
],
"type": "object"
},
"StringLiteralType": {
"additionalProperties": false,
"description": "Represents a string literal type (e.g. `kind: 'rename'`).",
"properties": {
"kind": {
"const": "stringLiteral",
"type": "string"
},
"value": {
"type": "string"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"Structure": {
"additionalProperties": false,
"description": "Defines the structure of an object literal.",
"properties": {
"deprecated": {
"description": "Whether the structure is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation;",
"type": "string"
},
"extends": {
"description": "Structures extended from. This structures form a polymorphic type hierarchy.",
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
},
"mixins": {
"description": "Structures to mix in. The properties of these structures are `copied` into this structure. Mixins don't form a polymorphic type hierarchy in LSP.",
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
},
"name": {
"description": "The name of the structure.",
"type": "string"
},
"properties": {
"description": "The properties.",
"items": {
"$ref": "#/definitions/Property"
},
"type": "array"
},
"proposed": {
"description": "Whether this is a proposed structure. If omitted, the structure is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this structure is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"name",
"properties"
],
"type": "object"
},
"StructureLiteral": {
"additionalProperties": false,
"description": "Defines an unnamed structure of an object literal.",
"properties": {
"deprecated": {
"description": "Whether the literal is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation.",
"type": "string"
},
"properties": {
"description": "The properties.",
"items": {
"$ref": "#/definitions/Property"
},
"type": "array"
},
"proposed": {
"description": "Whether this is a proposed structure. If omitted, the structure is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this structure is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"properties"
],
"type": "object"
},
"StructureLiteralType": {
"additionalProperties": false,
"description": "Represents a literal structure (e.g. `property: { start: uinteger; end: uinteger; }`).",
"properties": {
"kind": {
"const": "literal",
"type": "string"
},
"value": {
"$ref": "#/definitions/StructureLiteral"
}
},
"required": [
"kind",
"value"
],
"type": "object"
},
"TupleType": {
"additionalProperties": false,
"description": "Represents a `tuple` type (e.g. `[integer, integer]`).",
"properties": {
"items": {
"items": {
"$ref": "#/definitions/Type"
},
"type": "array"
},
"kind": {
"const": "tuple",
"type": "string"
}
},
"required": [
"kind",
"items"
],
"type": "object"
},
"Type": {
"anyOf": [
{
"$ref": "#/definitions/BaseType"
},
{
"$ref": "#/definitions/ReferenceType"
},
{
"$ref": "#/definitions/ArrayType"
},
{
"$ref": "#/definitions/MapType"
},
{
"$ref": "#/definitions/AndType"
},
{
"$ref": "#/definitions/OrType"
},
{
"$ref": "#/definitions/TupleType"
},
{
"$ref": "#/definitions/StructureLiteralType"
},
{
"$ref": "#/definitions/StringLiteralType"
},
{
"$ref": "#/definitions/IntegerLiteralType"
},
{
"$ref": "#/definitions/BooleanLiteralType"
}
]
},
"TypeAlias": {
"additionalProperties": false,
"description": "Defines a type alias. (e.g. `type Definition = Location | LocationLink`)",
"properties": {
"deprecated": {
"description": "Whether the type alias is deprecated or not. If deprecated the property contains the deprecation message.",
"type": "string"
},
"documentation": {
"description": "An optional documentation.",
"type": "string"
},
"name": {
"description": "The name of the type alias.",
"type": "string"
},
"proposed": {
"description": "Whether this is a proposed type alias. If omitted, the type alias is final.",
"type": "boolean"
},
"since": {
"description": "Since when (release number) this structure is available. Is undefined if not known.",
"type": "string"
},
"sinceTags": {
"description": "All since tags in case there was more than one tag. Is undefined if not known.",
"items": {
"type": "string"
},
"type": "array"
},
"type": {
"$ref": "#/definitions/Type",
"description": "The aliased type."
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"TypeKind": {
"enum": [
"base",
"reference",
"array",
"map",
"and",
"or",
"tuple",
"literal",
"stringLiteral",
"integerLiteral",
"booleanLiteral"
],
"type": "string"
}
}
}
@@ -0,0 +1,55 @@
{
"name": "vscode-languageserver-protocol",
"description": "VSCode Language Server Protocol implementation",
"version": "3.18.5",
"author": "Microsoft Corporation",
"license": "MIT",
"homepage": "https://github.com/microsoft/vscode-languageserver-node/tree/main/protocol",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-languageserver-node.git",
"directory": "protocol"
},
"bugs": {
"url": "https://github.com/Microsoft/vscode-languageserver-node/issues"
},
"exports": {
".": {
"types": "./lib/common/api.d.ts",
"default": "./lib/common/api.js"
},
"./node": {
"types": "./lib/node/main.d.ts",
"node": "./lib/node/main.js"
},
"./browser": {
"types": "./lib/browser/main.d.ts",
"browser": "./lib/browser/main.js"
}
},
"dependencies": {
"vscode-jsonrpc": "10.0.0",
"vscode-languageserver-types": "3.18.5"
},
"scripts": {
"prepublishOnly": "npm run all:publish",
"prepack": "npm run all:publish",
"postpublish": "node ../build/npm/post-publish.js",
"preversion": "npm test",
"compile": "tsc -b ./tsconfig.json",
"watch": "tsc -b ./tsconfig.watch.json -w",
"clean": "rimraf lib && rimraf dist",
"lint": "eslint src",
"test": "npm run test:node && npm run test:browser",
"test:node": "node ../node_modules/mocha/bin/_mocha",
"test:browser": "npm run webpack:test:silent && node ../build/bin/runBrowserTests.js http://127.0.0.1:8080/protocol/src/browser/test/",
"webpack:test": "cd ../types && npm run compile:esm && cd ../protocol && node ../build/bin/webpack --mode none --config ./src/browser/test/webpack.config.js",
"webpack:test:silent": "cd ../types && npm run compile:esm && cd ../protocol && node ../build/bin/webpack --no-stats --mode none --config ./src/browser/test/webpack.config.js",
"compile:metaModelTool": "cd ../tools && npm run compile && cd ../protocol",
"generate:metaModel": "node ../tools/lib/generator-main.js -p ./src/common/tsconfig.json > ./metaModel.json",
"generate:metaModelSchema": "ts-json-schema-generator --tsconfig ../tools/tsconfig.json --path ../tools/src/metaModel.ts > ./metaModel.schema.json",
"all": "npm run clean && npm run compile && npm run lint && npm run test && npm run compile:metaModelTool && npm run generate:metaModel && npm run generate:metaModelSchema",
"compile:publish": "tsc -b ./tsconfig.publish.json",
"all:publish": "git clean -xfd . && npm install && npm run compile:publish && npm run lint && npm run test && npm run compile:metaModelTool && npm run generate:metaModel && npm run generate:metaModelSchema"
}
}
@@ -0,0 +1,31 @@
THIRD-PARTY SOFTWARE NOTICES AND INFORMATION
For Microsoft vscode-languageclient
This project incorporates material from the project(s) listed below (collectively, “Third Party Code”).
Microsoft is not the original author of the Third Party Code. The original copyright notice and license
under which Microsoft received such Third Party Code are set out below. This Third Party Code is licensed
to you under their original license terms set forth below. Microsoft reserves all other rights not expressly
granted, whether by implication, estoppel or otherwise.
1. DefinitelyTyped version 0.0.1 (https://github.com/borisyankov/DefinitelyTyped)
This project is licensed under the MIT license.
Copyrights are respective of each contributor listed at the beginning of each definition file.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.