🎉 initiate project *astro_rewrite*

This commit is contained in:
sindrekjelsrud 2023-07-19 21:31:30 +02:00
parent ffd4d5e86c
commit 2ba37bfbe3
8658 changed files with 2268794 additions and 2538 deletions

View file

@ -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;

View file

@ -0,0 +1,28 @@
"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 = void 0;
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);
}
exports.createProtocolConnection = createProtocolConnection;

View file

@ -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 as 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 declare type LSPErrorCodes = integer;
export declare namespace Proposed {
}

View file

@ -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 as 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 || (exports.LSPErrorCodes = {}));

View file

@ -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 } 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: P, token?: CancellationToken): Promise<R>;
sendRequest<P, R, E>(type: RequestType<P, R, E>, params: 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: RequestHandler0<R, E>): Disposable;
onRequest<R, E>(type: RequestType0<R, E>, handler: 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: RequestHandler<P, R, E>): Disposable;
onRequest<P, R, E>(type: RequestType<P, R, E>, handler: 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?: P): Promise<void>;
sendNotification<P>(type: NotificationType<P>, params?: 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: NotificationHandler<P>): Disposable;
onNotification<P>(type: NotificationType<P>, handler: 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: 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: 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;

View file

@ -0,0 +1,15 @@
"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 = void 0;
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);
}
exports.createProtocolConnection = createProtocolConnection;

View file

@ -0,0 +1,49 @@
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, 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, 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);
}

View file

@ -0,0 +1,44 @@
"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.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 || (exports.MessageDirection = {}));
class RegistrationType {
constructor(method) {
this.method = method;
}
}
exports.RegistrationType = RegistrationType;
class ProtocolRequestType0 extends vscode_jsonrpc_1.RequestType0 {
constructor(method) {
super(method);
}
}
exports.ProtocolRequestType0 = ProtocolRequestType0;
class ProtocolRequestType extends vscode_jsonrpc_1.RequestType {
constructor(method) {
super(method, vscode_jsonrpc_1.ParameterStructures.byName);
}
}
exports.ProtocolRequestType = ProtocolRequestType;
class ProtocolNotificationType0 extends vscode_jsonrpc_1.NotificationType0 {
constructor(method) {
super(method);
}
}
exports.ProtocolNotificationType0 = ProtocolNotificationType0;
class ProtocolNotificationType extends vscode_jsonrpc_1.NotificationType {
constructor(method) {
super(method, vscode_jsonrpc_1.ParameterStructures.byName);
}
}
exports.ProtocolNotificationType = ProtocolNotificationType;

View file

@ -0,0 +1 @@
export {};

View file

@ -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 = {}));

View file

@ -0,0 +1,86 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { CallHierarchyItem, CallHierarchyIncomingCall, CallHierarchyOutgoingCall } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, 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>;
}
/**
* 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>;
}
/**
* 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>;
}

View file

@ -0,0 +1,42 @@
"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 = exports.CallHierarchyPrepareRequest || (exports.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 = exports.CallHierarchyIncomingCallsRequest || (exports.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 = exports.CallHierarchyOutgoingCallsRequest || (exports.CallHierarchyOutgoingCallsRequest = {}));

View file

@ -0,0 +1,66 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Range, Color, ColorInformation, ColorPresentation } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, PartialResultParams, WorkDoneProgressParams, 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>;
}
/**
* 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 ColorInformation ColorInformation[]} 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, WorkDoneProgressOptions & TextDocumentRegistrationOptions>;
type HandlerSignature = RequestHandler<ColorPresentationParams, ColorPresentation[], void>;
}

View file

@ -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.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 = exports.DocumentColorRequest || (exports.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 ColorInformation ColorInformation[]} 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 = exports.ColorPresentationRequest || (exports.ColorPresentationRequest = {}));

View file

@ -0,0 +1,35 @@
import { RequestHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
import { LSPAny } from 'vscode-languageserver-types';
import { 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>;
}
export interface ConfigurationItem {
/**
* The scope to get the configuration section for.
*/
scopeUri?: string;
/**
* The configuration section asked for.
*/
section?: string;
}
/**
* The parameters of a configuration request.
*/
export interface ConfigurationParams {
items: ConfigurationItem[];
}

View file

@ -0,0 +1,24 @@
"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 = exports.ConfigurationRequest || (exports.ConfigurationRequest = {}));

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,38 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Declaration, DeclarationLink, Location, LocationLink } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, 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 [TextDocumentPositionParams]
* (#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>;
}

View file

@ -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 [TextDocumentPositionParams]
* (#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 = exports.DeclarationRequest || (exports.DeclarationRequest = {}));

View file

@ -0,0 +1,341 @@
import { RequestHandler0, RequestHandler, ProgressType } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Diagnostic, DocumentUri, integer } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType0, ProtocolRequestType } from './messages';
import type { PartialResultParams, StaticRegistrationOptions, WorkDoneProgressParams, TextDocumentRegistrationOptions, WorkDoneProgressOptions } from './protocol';
/**
* Client capabilities specific to diagnostic pull requests.
*
* @since 3.17.0
*/
export declare type DiagnosticClientCapabilities = {
/**
* 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;
};
/**
* Workspace client capabilities specific to diagnostic pull requests.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare type DiagnosticRegistrationOptions = TextDocumentRegistrationOptions & DiagnosticOptions & StaticRegistrationOptions;
export declare type $DiagnosticServerCapabilities = {
diagnosticProvider?: DiagnosticOptions;
};
/**
* Cancellation data returned from a diagnostic request.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare type DocumentDiagnosticReportKind = 'full' | 'unchanged';
/**
* A diagnostic report with a full set of problems.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare 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 declare 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 declare type DocumentDiagnosticReport = RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport;
/**
* A partial result for a document diagnostic report.
*
* @since 3.17.0
*/
export declare type DocumentDiagnosticReportPartialResult = {
relatedDocuments: {
[uri: DocumentUri]: FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport;
};
};
/**
* 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, DocumentDiagnosticReportPartialResult, DiagnosticServerCancellationData, DiagnosticRegistrationOptions>;
const partialResult: ProgressType<DocumentDiagnosticReportPartialResult>;
type HandlerSignature = RequestHandler<DocumentDiagnosticParams, DocumentDiagnosticReport, void>;
}
/**
* A previous result id in a workspace pull request.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare 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 declare 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 declare type WorkspaceDocumentDiagnosticReport = WorkspaceFullDocumentDiagnosticReport | WorkspaceUnchangedDocumentDiagnosticReport;
/**
* A workspace diagnostic report.
*
* @since 3.17.0
*/
export declare type WorkspaceDiagnosticReport = {
items: WorkspaceDocumentDiagnosticReport[];
};
/**
* A partial result for a workspace diagnostic report.
*
* @since 3.17.0
*/
export declare 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>;
}
/**
* 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>;
}

View file

@ -0,0 +1,74 @@
"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.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = void 0;
const vscode_jsonrpc_1 = require("vscode-jsonrpc");
const Is = 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 || (exports.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 || (exports.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 = exports.DocumentDiagnosticRequest || (exports.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 = exports.WorkspaceDiagnosticRequest || (exports.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 = exports.DiagnosticRefreshRequest || (exports.DiagnosticRefreshRequest = {}));

View file

@ -0,0 +1,306 @@
import { NotificationHandler, RequestHandler } from 'vscode-jsonrpc';
import { WorkspaceEdit } from 'vscode-languageserver-types';
import { 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 declare 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 one 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 file:// URI for the location of the file/folder being created.
*/
uri: string;
}
/**
* 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 file:// URI for the original location of the file/folder being renamed.
*/
oldUri: string;
/**
* A file:// URI for the new location of the file/folder being renamed.
*/
newUri: string;
}
/**
* 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 file:// URI for the location of the file/folder being deleted.
*/
uri: string;
}
/**
* 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>;
}
/**
* 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>;
}
/**
* 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>;
}
/**
* 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>;
}
/**
* 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>;
}
/**
* 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>;
}
export {};

View file

@ -0,0 +1,101 @@
"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 || (exports.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 = exports.WillCreateFilesRequest || (exports.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 = exports.DidCreateFilesNotification || (exports.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 = exports.WillRenameFilesRequest || (exports.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 = exports.DidRenameFilesNotification || (exports.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 = exports.DidDeleteFilesNotification || (exports.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 = exports.WillDeleteFilesRequest || (exports.WillDeleteFilesRequest = {}));

View file

@ -0,0 +1,78 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, uinteger, FoldingRange, FoldingRangeKind } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
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?: {
/**
* 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[];
};
/**
* Specific options for the folding range.
*
* @since 3.17.0
*/
foldingRange?: {
/**
* 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 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>;
}

View file

@ -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.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 = exports.FoldingRangeRequest || (exports.FoldingRangeRequest = {}));

View file

@ -0,0 +1,39 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Definition, DefinitionLink, Location, LocationLink } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, 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 [TextDocumentPositionParams]
* (#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>;
}

View file

@ -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 [TextDocumentPositionParams]
* (#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 = exports.ImplementationRequest || (exports.ImplementationRequest = {}));

View file

@ -0,0 +1,110 @@
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { Range, TextDocumentIdentifier, InlayHint } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import type { StaticRegistrationOptions, TextDocumentRegistrationOptions, WorkDoneProgressOptions, WorkDoneProgressParams } from './protocol';
/**
* Inlay hint client capabilities.
*
* @since 3.17.0
*/
export declare type InlayHintClientCapabilities = {
/**
* Whether inlay hints support dynamic registration.
*/
dynamicRegistration?: boolean;
/**
* Indicates which properties a client can resolve lazily on an inlay
* hint.
*/
resolveSupport?: {
/**
* The properties that a client can resolve lazily.
*/
properties: string[];
};
};
/**
* Client workspace capabilities specific to inlay hints.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare type InlayHintRegistrationOptions = InlayHintOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inlay hint requests.
*
* @since 3.17.0
*/
export declare type InlayHintParams = WorkDoneProgressParams & {
/**
* 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>;
}
/**
* 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>;
}
/**
* @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>;
}

View file

@ -0,0 +1,43 @@
"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 = exports.InlayHintRequest || (exports.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 = exports.InlayHintResolveRequest || (exports.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 = exports.InlayHintRefreshRequest || (exports.InlayHintRefreshRequest = {}));

View file

@ -0,0 +1,86 @@
import { TextDocumentIdentifier, Range, InlineValue, InlineValueContext } from 'vscode-languageserver-types';
import { RequestHandler, RequestHandler0 } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType, ProtocolRequestType0 } from './messages';
import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistrationOptions, WorkDoneProgressParams } from './protocol';
/**
* Client capabilities specific to inline values.
*
* @since 3.17.0
*/
export declare 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 declare 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 declare type InlineValueOptions = WorkDoneProgressOptions;
/**
* Inline value options used during static or dynamic registration.
*
* @since 3.17.0
*/
export declare type InlineValueRegistrationOptions = InlineValueOptions & TextDocumentRegistrationOptions & StaticRegistrationOptions;
/**
* A parameter literal used in inline value requests.
*
* @since 3.17.0
*/
export declare type InlineValueParams = WorkDoneProgressParams & {
/**
* The text document.
*/
textDocument: TextDocumentIdentifier;
/**
* The document range for which inline values should be computed.
*/
range: Range;
/**
* Additional information about the context in which inline values were
* 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>;
}
/**
* @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>;
}

View file

@ -0,0 +1,30 @@
"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 = exports.InlineValueRequest || (exports.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 = exports.InlineValueRefreshRequest || (exports.InlineValueRefreshRequest = {}));

View file

@ -0,0 +1,923 @@
"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.WorkspaceSymbolRequest = exports.CodeActionResolveRequest = exports.CodeActionRequest = exports.DocumentSymbolRequest = exports.DocumentHighlightRequest = exports.ReferencesRequest = exports.DefinitionRequest = exports.SignatureHelpRequest = exports.SignatureHelpTriggerKind = exports.HoverRequest = exports.CompletionResolveRequest = exports.CompletionRequest = exports.CompletionTriggerKind = exports.PublishDiagnosticsNotification = exports.WatchKind = exports.RelativePattern = exports.FileChangeType = exports.DidChangeWatchedFilesNotification = exports.WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentNotification = exports.TextDocumentSaveReason = exports.DidSaveTextDocumentNotification = exports.DidCloseTextDocumentNotification = exports.DidChangeTextDocumentNotification = exports.TextDocumentContentChangeEvent = exports.DidOpenTextDocumentNotification = exports.TextDocumentSyncKind = exports.TelemetryEventNotification = exports.LogMessageNotification = exports.ShowMessageRequest = exports.ShowMessageNotification = exports.MessageType = exports.DidChangeConfigurationNotification = exports.ExitNotification = exports.ShutdownRequest = exports.InitializedNotification = exports.InitializeErrorCodes = exports.InitializeRequest = exports.WorkDoneProgressOptions = exports.TextDocumentRegistrationOptions = exports.StaticRegistrationOptions = exports.PositionEncodingKind = exports.FailureHandlingKind = exports.ResourceOperationKind = exports.UnregistrationRequest = exports.RegistrationRequest = exports.DocumentSelector = exports.NotebookCellTextDocumentFilter = exports.NotebookDocumentFilter = exports.TextDocumentFilter = void 0;
exports.TypeHierarchySubtypesRequest = exports.TypeHierarchyPrepareRequest = exports.MonikerRequest = exports.MonikerKind = exports.UniquenessLevel = exports.WillDeleteFilesRequest = exports.DidDeleteFilesNotification = exports.WillRenameFilesRequest = exports.DidRenameFilesNotification = exports.WillCreateFilesRequest = exports.DidCreateFilesNotification = exports.FileOperationPatternKind = exports.LinkedEditingRangeRequest = exports.ShowDocumentRequest = exports.SemanticTokensRegistrationType = exports.SemanticTokensRefreshRequest = exports.SemanticTokensRangeRequest = exports.SemanticTokensDeltaRequest = exports.SemanticTokensRequest = exports.TokenFormat = exports.CallHierarchyPrepareRequest = exports.CallHierarchyOutgoingCallsRequest = exports.CallHierarchyIncomingCallsRequest = exports.WorkDoneProgressCancelNotification = exports.WorkDoneProgressCreateRequest = exports.WorkDoneProgress = exports.SelectionRangeRequest = exports.DeclarationRequest = exports.FoldingRangeRequest = exports.ColorPresentationRequest = exports.DocumentColorRequest = exports.ConfigurationRequest = exports.DidChangeWorkspaceFoldersNotification = exports.WorkspaceFoldersRequest = exports.TypeDefinitionRequest = exports.ImplementationRequest = exports.ApplyWorkspaceEditRequest = exports.ExecuteCommandRequest = exports.PrepareRenameRequest = exports.RenameRequest = exports.PrepareSupportDefaultBehavior = exports.DocumentOnTypeFormattingRequest = exports.DocumentRangeFormattingRequest = exports.DocumentFormattingRequest = exports.DocumentLinkResolveRequest = exports.DocumentLinkRequest = exports.CodeLensRefreshRequest = exports.CodeLensResolveRequest = exports.CodeLensRequest = exports.WorkspaceSymbolResolveRequest = void 0;
exports.DidCloseNotebookDocumentNotification = exports.DidSaveNotebookDocumentNotification = exports.DidChangeNotebookDocumentNotification = exports.NotebookCellArrayChange = exports.DidOpenNotebookDocumentNotification = exports.NotebookDocumentSyncRegistrationType = exports.NotebookDocument = exports.NotebookCell = exports.ExecutionSummary = exports.NotebookCellKind = exports.DiagnosticRefreshRequest = exports.WorkspaceDiagnosticRequest = exports.DocumentDiagnosticRequest = exports.DocumentDiagnosticReportKind = exports.DiagnosticServerCancellationData = exports.InlayHintRefreshRequest = exports.InlayHintResolveRequest = exports.InlayHintRequest = exports.InlineValueRefreshRequest = exports.InlineValueRequest = exports.TypeHierarchySupertypesRequest = void 0;
const messages_1 = require("./messages");
const vscode_languageserver_types_1 = require("vscode-languageserver-types");
const Is = require("./utils/is");
const protocol_implementation_1 = require("./protocol.implementation");
Object.defineProperty(exports, "ImplementationRequest", { enumerable: true, get: function () { return protocol_implementation_1.ImplementationRequest; } });
const protocol_typeDefinition_1 = require("./protocol.typeDefinition");
Object.defineProperty(exports, "TypeDefinitionRequest", { enumerable: true, get: function () { return protocol_typeDefinition_1.TypeDefinitionRequest; } });
const protocol_workspaceFolder_1 = require("./protocol.workspaceFolder");
Object.defineProperty(exports, "WorkspaceFoldersRequest", { enumerable: true, get: function () { return protocol_workspaceFolder_1.WorkspaceFoldersRequest; } });
Object.defineProperty(exports, "DidChangeWorkspaceFoldersNotification", { enumerable: true, get: function () { return protocol_workspaceFolder_1.DidChangeWorkspaceFoldersNotification; } });
const protocol_configuration_1 = require("./protocol.configuration");
Object.defineProperty(exports, "ConfigurationRequest", { enumerable: true, get: function () { return protocol_configuration_1.ConfigurationRequest; } });
const protocol_colorProvider_1 = require("./protocol.colorProvider");
Object.defineProperty(exports, "DocumentColorRequest", { enumerable: true, get: function () { return protocol_colorProvider_1.DocumentColorRequest; } });
Object.defineProperty(exports, "ColorPresentationRequest", { enumerable: true, get: function () { return protocol_colorProvider_1.ColorPresentationRequest; } });
const protocol_foldingRange_1 = require("./protocol.foldingRange");
Object.defineProperty(exports, "FoldingRangeRequest", { enumerable: true, get: function () { return protocol_foldingRange_1.FoldingRangeRequest; } });
const protocol_declaration_1 = require("./protocol.declaration");
Object.defineProperty(exports, "DeclarationRequest", { enumerable: true, get: function () { return protocol_declaration_1.DeclarationRequest; } });
const protocol_selectionRange_1 = require("./protocol.selectionRange");
Object.defineProperty(exports, "SelectionRangeRequest", { enumerable: true, get: function () { return protocol_selectionRange_1.SelectionRangeRequest; } });
const protocol_progress_1 = require("./protocol.progress");
Object.defineProperty(exports, "WorkDoneProgress", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgress; } });
Object.defineProperty(exports, "WorkDoneProgressCreateRequest", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCreateRequest; } });
Object.defineProperty(exports, "WorkDoneProgressCancelNotification", { enumerable: true, get: function () { return protocol_progress_1.WorkDoneProgressCancelNotification; } });
const protocol_callHierarchy_1 = require("./protocol.callHierarchy");
Object.defineProperty(exports, "CallHierarchyIncomingCallsRequest", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyIncomingCallsRequest; } });
Object.defineProperty(exports, "CallHierarchyOutgoingCallsRequest", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyOutgoingCallsRequest; } });
Object.defineProperty(exports, "CallHierarchyPrepareRequest", { enumerable: true, get: function () { return protocol_callHierarchy_1.CallHierarchyPrepareRequest; } });
const protocol_semanticTokens_1 = require("./protocol.semanticTokens");
Object.defineProperty(exports, "TokenFormat", { enumerable: true, get: function () { return protocol_semanticTokens_1.TokenFormat; } });
Object.defineProperty(exports, "SemanticTokensRequest", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRequest; } });
Object.defineProperty(exports, "SemanticTokensDeltaRequest", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensDeltaRequest; } });
Object.defineProperty(exports, "SemanticTokensRangeRequest", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRangeRequest; } });
Object.defineProperty(exports, "SemanticTokensRefreshRequest", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRefreshRequest; } });
Object.defineProperty(exports, "SemanticTokensRegistrationType", { enumerable: true, get: function () { return protocol_semanticTokens_1.SemanticTokensRegistrationType; } });
const protocol_showDocument_1 = require("./protocol.showDocument");
Object.defineProperty(exports, "ShowDocumentRequest", { enumerable: true, get: function () { return protocol_showDocument_1.ShowDocumentRequest; } });
const protocol_linkedEditingRange_1 = require("./protocol.linkedEditingRange");
Object.defineProperty(exports, "LinkedEditingRangeRequest", { enumerable: true, get: function () { return protocol_linkedEditingRange_1.LinkedEditingRangeRequest; } });
const protocol_fileOperations_1 = require("./protocol.fileOperations");
Object.defineProperty(exports, "FileOperationPatternKind", { enumerable: true, get: function () { return protocol_fileOperations_1.FileOperationPatternKind; } });
Object.defineProperty(exports, "DidCreateFilesNotification", { enumerable: true, get: function () { return protocol_fileOperations_1.DidCreateFilesNotification; } });
Object.defineProperty(exports, "WillCreateFilesRequest", { enumerable: true, get: function () { return protocol_fileOperations_1.WillCreateFilesRequest; } });
Object.defineProperty(exports, "DidRenameFilesNotification", { enumerable: true, get: function () { return protocol_fileOperations_1.DidRenameFilesNotification; } });
Object.defineProperty(exports, "WillRenameFilesRequest", { enumerable: true, get: function () { return protocol_fileOperations_1.WillRenameFilesRequest; } });
Object.defineProperty(exports, "DidDeleteFilesNotification", { enumerable: true, get: function () { return protocol_fileOperations_1.DidDeleteFilesNotification; } });
Object.defineProperty(exports, "WillDeleteFilesRequest", { enumerable: true, get: function () { return protocol_fileOperations_1.WillDeleteFilesRequest; } });
const protocol_moniker_1 = require("./protocol.moniker");
Object.defineProperty(exports, "UniquenessLevel", { enumerable: true, get: function () { return protocol_moniker_1.UniquenessLevel; } });
Object.defineProperty(exports, "MonikerKind", { enumerable: true, get: function () { return protocol_moniker_1.MonikerKind; } });
Object.defineProperty(exports, "MonikerRequest", { enumerable: true, get: function () { return protocol_moniker_1.MonikerRequest; } });
const protocol_typeHierarchy_1 = require("./protocol.typeHierarchy");
Object.defineProperty(exports, "TypeHierarchyPrepareRequest", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchyPrepareRequest; } });
Object.defineProperty(exports, "TypeHierarchySubtypesRequest", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySubtypesRequest; } });
Object.defineProperty(exports, "TypeHierarchySupertypesRequest", { enumerable: true, get: function () { return protocol_typeHierarchy_1.TypeHierarchySupertypesRequest; } });
const protocol_inlineValue_1 = require("./protocol.inlineValue");
Object.defineProperty(exports, "InlineValueRequest", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRequest; } });
Object.defineProperty(exports, "InlineValueRefreshRequest", { enumerable: true, get: function () { return protocol_inlineValue_1.InlineValueRefreshRequest; } });
const protocol_inlayHint_1 = require("./protocol.inlayHint");
Object.defineProperty(exports, "InlayHintRequest", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRequest; } });
Object.defineProperty(exports, "InlayHintResolveRequest", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintResolveRequest; } });
Object.defineProperty(exports, "InlayHintRefreshRequest", { enumerable: true, get: function () { return protocol_inlayHint_1.InlayHintRefreshRequest; } });
const protocol_diagnostic_1 = require("./protocol.diagnostic");
Object.defineProperty(exports, "DiagnosticServerCancellationData", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticServerCancellationData; } });
Object.defineProperty(exports, "DocumentDiagnosticReportKind", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticReportKind; } });
Object.defineProperty(exports, "DocumentDiagnosticRequest", { enumerable: true, get: function () { return protocol_diagnostic_1.DocumentDiagnosticRequest; } });
Object.defineProperty(exports, "WorkspaceDiagnosticRequest", { enumerable: true, get: function () { return protocol_diagnostic_1.WorkspaceDiagnosticRequest; } });
Object.defineProperty(exports, "DiagnosticRefreshRequest", { enumerable: true, get: function () { return protocol_diagnostic_1.DiagnosticRefreshRequest; } });
const protocol_notebook_1 = require("./protocol.notebook");
Object.defineProperty(exports, "NotebookCellKind", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellKind; } });
Object.defineProperty(exports, "ExecutionSummary", { enumerable: true, get: function () { return protocol_notebook_1.ExecutionSummary; } });
Object.defineProperty(exports, "NotebookCell", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCell; } });
Object.defineProperty(exports, "NotebookDocument", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocument; } });
Object.defineProperty(exports, "NotebookDocumentSyncRegistrationType", { enumerable: true, get: function () { return protocol_notebook_1.NotebookDocumentSyncRegistrationType; } });
Object.defineProperty(exports, "DidOpenNotebookDocumentNotification", { enumerable: true, get: function () { return protocol_notebook_1.DidOpenNotebookDocumentNotification; } });
Object.defineProperty(exports, "NotebookCellArrayChange", { enumerable: true, get: function () { return protocol_notebook_1.NotebookCellArrayChange; } });
Object.defineProperty(exports, "DidChangeNotebookDocumentNotification", { enumerable: true, get: function () { return protocol_notebook_1.DidChangeNotebookDocumentNotification; } });
Object.defineProperty(exports, "DidSaveNotebookDocumentNotification", { enumerable: true, get: function () { return protocol_notebook_1.DidSaveNotebookDocumentNotification; } });
Object.defineProperty(exports, "DidCloseNotebookDocumentNotification", { enumerable: true, get: function () { return protocol_notebook_1.DidCloseNotebookDocumentNotification; } });
// @ts-ignore: to avoid inlining LocationLink as dynamic import
let __noDynamicImport;
/**
* The TextDocumentFilter namespace provides helper functions to work with
* {@link TextDocumentFilter} literals.
*
* @since 3.17.0
*/
var TextDocumentFilter;
(function (TextDocumentFilter) {
function is(value) {
const candidate = value;
return Is.string(candidate.language) || Is.string(candidate.scheme) || Is.string(candidate.pattern);
}
TextDocumentFilter.is = is;
})(TextDocumentFilter = exports.TextDocumentFilter || (exports.TextDocumentFilter = {}));
/**
* The NotebookDocumentFilter namespace provides helper functions to work with
* {@link NotebookDocumentFilter} literals.
*
* @since 3.17.0
*/
var NotebookDocumentFilter;
(function (NotebookDocumentFilter) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && (Is.string(candidate.notebookType) || Is.string(candidate.scheme) || Is.string(candidate.pattern));
}
NotebookDocumentFilter.is = is;
})(NotebookDocumentFilter = exports.NotebookDocumentFilter || (exports.NotebookDocumentFilter = {}));
/**
* The NotebookCellTextDocumentFilter namespace provides helper functions to work with
* {@link NotebookCellTextDocumentFilter} literals.
*
* @since 3.17.0
*/
var NotebookCellTextDocumentFilter;
(function (NotebookCellTextDocumentFilter) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate)
&& (Is.string(candidate.notebook) || NotebookDocumentFilter.is(candidate.notebook))
&& (candidate.language === undefined || Is.string(candidate.language));
}
NotebookCellTextDocumentFilter.is = is;
})(NotebookCellTextDocumentFilter = exports.NotebookCellTextDocumentFilter || (exports.NotebookCellTextDocumentFilter = {}));
/**
* The DocumentSelector namespace provides helper functions to work with
* {@link DocumentSelector}s.
*/
var DocumentSelector;
(function (DocumentSelector) {
function is(value) {
if (!Array.isArray(value)) {
return false;
}
for (let elem of value) {
if (!Is.string(elem) && !TextDocumentFilter.is(elem) && !NotebookCellTextDocumentFilter.is(elem)) {
return false;
}
}
return true;
}
DocumentSelector.is = is;
})(DocumentSelector = exports.DocumentSelector || (exports.DocumentSelector = {}));
/**
* The `client/registerCapability` request is sent from the server to the client to register a new capability
* handler on the client side.
*/
var RegistrationRequest;
(function (RegistrationRequest) {
RegistrationRequest.method = 'client/registerCapability';
RegistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;
RegistrationRequest.type = new messages_1.ProtocolRequestType(RegistrationRequest.method);
})(RegistrationRequest = exports.RegistrationRequest || (exports.RegistrationRequest = {}));
/**
* The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability
* handler on the client side.
*/
var UnregistrationRequest;
(function (UnregistrationRequest) {
UnregistrationRequest.method = 'client/unregisterCapability';
UnregistrationRequest.messageDirection = messages_1.MessageDirection.serverToClient;
UnregistrationRequest.type = new messages_1.ProtocolRequestType(UnregistrationRequest.method);
})(UnregistrationRequest = exports.UnregistrationRequest || (exports.UnregistrationRequest = {}));
var ResourceOperationKind;
(function (ResourceOperationKind) {
/**
* Supports creating new files and folders.
*/
ResourceOperationKind.Create = 'create';
/**
* Supports renaming existing files and folders.
*/
ResourceOperationKind.Rename = 'rename';
/**
* Supports deleting existing files and folders.
*/
ResourceOperationKind.Delete = 'delete';
})(ResourceOperationKind = exports.ResourceOperationKind || (exports.ResourceOperationKind = {}));
var FailureHandlingKind;
(function (FailureHandlingKind) {
/**
* Applying the workspace change is simply aborted if one of the changes provided
* fails. All operations executed before the failing operation stay executed.
*/
FailureHandlingKind.Abort = 'abort';
/**
* All operations are executed transactional. That means they either all
* succeed or no changes at all are applied to the workspace.
*/
FailureHandlingKind.Transactional = 'transactional';
/**
* If the workspace edit contains only textual file changes they are executed transactional.
* If resource changes (create, rename or delete file) are part of the change the failure
* handling strategy is abort.
*/
FailureHandlingKind.TextOnlyTransactional = 'textOnlyTransactional';
/**
* The client tries to undo the operations already executed. But there is no
* guarantee that this is succeeding.
*/
FailureHandlingKind.Undo = 'undo';
})(FailureHandlingKind = exports.FailureHandlingKind || (exports.FailureHandlingKind = {}));
/**
* A set of predefined position encoding kinds.
*
* @since 3.17.0
*/
var PositionEncodingKind;
(function (PositionEncodingKind) {
/**
* Character offsets count UTF-8 code units (e.g. bytes).
*/
PositionEncodingKind.UTF8 = 'utf-8';
/**
* Character offsets count UTF-16 code units.
*
* This is the default and must always be supported
* by servers
*/
PositionEncodingKind.UTF16 = 'utf-16';
/**
* Character offsets count UTF-32 code units.
*
* Implementation note: these are the same as Unicode codepoints,
* so this `PositionEncodingKind` may also be used for an
* encoding-agnostic representation of character offsets.
*/
PositionEncodingKind.UTF32 = 'utf-32';
})(PositionEncodingKind = exports.PositionEncodingKind || (exports.PositionEncodingKind = {}));
/**
* The StaticRegistrationOptions namespace provides helper functions to work with
* {@link StaticRegistrationOptions} literals.
*/
var StaticRegistrationOptions;
(function (StaticRegistrationOptions) {
function hasId(value) {
const candidate = value;
return candidate && Is.string(candidate.id) && candidate.id.length > 0;
}
StaticRegistrationOptions.hasId = hasId;
})(StaticRegistrationOptions = exports.StaticRegistrationOptions || (exports.StaticRegistrationOptions = {}));
/**
* The TextDocumentRegistrationOptions namespace provides helper functions to work with
* {@link TextDocumentRegistrationOptions} literals.
*/
var TextDocumentRegistrationOptions;
(function (TextDocumentRegistrationOptions) {
function is(value) {
const candidate = value;
return candidate && (candidate.documentSelector === null || DocumentSelector.is(candidate.documentSelector));
}
TextDocumentRegistrationOptions.is = is;
})(TextDocumentRegistrationOptions = exports.TextDocumentRegistrationOptions || (exports.TextDocumentRegistrationOptions = {}));
/**
* The WorkDoneProgressOptions namespace provides helper functions to work with
* {@link WorkDoneProgressOptions} literals.
*/
var WorkDoneProgressOptions;
(function (WorkDoneProgressOptions) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && (candidate.workDoneProgress === undefined || Is.boolean(candidate.workDoneProgress));
}
WorkDoneProgressOptions.is = is;
function hasWorkDoneProgress(value) {
const candidate = value;
return candidate && Is.boolean(candidate.workDoneProgress);
}
WorkDoneProgressOptions.hasWorkDoneProgress = hasWorkDoneProgress;
})(WorkDoneProgressOptions = exports.WorkDoneProgressOptions || (exports.WorkDoneProgressOptions = {}));
/**
* The initialize request is sent from the client to the server.
* It is sent once as the request after starting up the server.
* The requests parameter is of type {@link InitializeParams}
* the response if of type {@link InitializeResult} of a Thenable that
* resolves to such.
*/
var InitializeRequest;
(function (InitializeRequest) {
InitializeRequest.method = 'initialize';
InitializeRequest.messageDirection = messages_1.MessageDirection.clientToServer;
InitializeRequest.type = new messages_1.ProtocolRequestType(InitializeRequest.method);
})(InitializeRequest = exports.InitializeRequest || (exports.InitializeRequest = {}));
/**
* Known error codes for an `InitializeErrorCodes`;
*/
var InitializeErrorCodes;
(function (InitializeErrorCodes) {
/**
* If the protocol version provided by the client can't be handled by the server.
*
* @deprecated This initialize error got replaced by client capabilities. There is
* no version handshake in version 3.0x
*/
InitializeErrorCodes.unknownProtocolVersion = 1;
})(InitializeErrorCodes = exports.InitializeErrorCodes || (exports.InitializeErrorCodes = {}));
/**
* The initialized notification is sent from the client to the
* server after the client is fully initialized and the server
* is allowed to send requests from the server to the client.
*/
var InitializedNotification;
(function (InitializedNotification) {
InitializedNotification.method = 'initialized';
InitializedNotification.messageDirection = messages_1.MessageDirection.clientToServer;
InitializedNotification.type = new messages_1.ProtocolNotificationType(InitializedNotification.method);
})(InitializedNotification = exports.InitializedNotification || (exports.InitializedNotification = {}));
//---- Shutdown Method ----
/**
* A shutdown request is sent from the client to the server.
* It is sent once when the client decides to shutdown the
* server. The only notification that is sent after a shutdown request
* is the exit event.
*/
var ShutdownRequest;
(function (ShutdownRequest) {
ShutdownRequest.method = 'shutdown';
ShutdownRequest.messageDirection = messages_1.MessageDirection.clientToServer;
ShutdownRequest.type = new messages_1.ProtocolRequestType0(ShutdownRequest.method);
})(ShutdownRequest = exports.ShutdownRequest || (exports.ShutdownRequest = {}));
//---- Exit Notification ----
/**
* The exit event is sent from the client to the server to
* ask the server to exit its process.
*/
var ExitNotification;
(function (ExitNotification) {
ExitNotification.method = 'exit';
ExitNotification.messageDirection = messages_1.MessageDirection.clientToServer;
ExitNotification.type = new messages_1.ProtocolNotificationType0(ExitNotification.method);
})(ExitNotification = exports.ExitNotification || (exports.ExitNotification = {}));
/**
* The configuration change notification is sent from the client to the server
* when the client's configuration has changed. The notification contains
* the changed configuration as defined by the language client.
*/
var DidChangeConfigurationNotification;
(function (DidChangeConfigurationNotification) {
DidChangeConfigurationNotification.method = 'workspace/didChangeConfiguration';
DidChangeConfigurationNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidChangeConfigurationNotification.type = new messages_1.ProtocolNotificationType(DidChangeConfigurationNotification.method);
})(DidChangeConfigurationNotification = exports.DidChangeConfigurationNotification || (exports.DidChangeConfigurationNotification = {}));
//---- Message show and log notifications ----
/**
* The message type
*/
var MessageType;
(function (MessageType) {
/**
* An error message.
*/
MessageType.Error = 1;
/**
* A warning message.
*/
MessageType.Warning = 2;
/**
* An information message.
*/
MessageType.Info = 3;
/**
* A log message.
*/
MessageType.Log = 4;
})(MessageType = exports.MessageType || (exports.MessageType = {}));
/**
* The show message notification is sent from a server to a client to ask
* the client to display a particular message in the user interface.
*/
var ShowMessageNotification;
(function (ShowMessageNotification) {
ShowMessageNotification.method = 'window/showMessage';
ShowMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;
ShowMessageNotification.type = new messages_1.ProtocolNotificationType(ShowMessageNotification.method);
})(ShowMessageNotification = exports.ShowMessageNotification || (exports.ShowMessageNotification = {}));
/**
* The show message request is sent from the server to the client to show a message
* and a set of options actions to the user.
*/
var ShowMessageRequest;
(function (ShowMessageRequest) {
ShowMessageRequest.method = 'window/showMessageRequest';
ShowMessageRequest.messageDirection = messages_1.MessageDirection.serverToClient;
ShowMessageRequest.type = new messages_1.ProtocolRequestType(ShowMessageRequest.method);
})(ShowMessageRequest = exports.ShowMessageRequest || (exports.ShowMessageRequest = {}));
/**
* The log message notification is sent from the server to the client to ask
* the client to log a particular message.
*/
var LogMessageNotification;
(function (LogMessageNotification) {
LogMessageNotification.method = 'window/logMessage';
LogMessageNotification.messageDirection = messages_1.MessageDirection.serverToClient;
LogMessageNotification.type = new messages_1.ProtocolNotificationType(LogMessageNotification.method);
})(LogMessageNotification = exports.LogMessageNotification || (exports.LogMessageNotification = {}));
//---- Telemetry notification
/**
* The telemetry event notification is sent from the server to the client to ask
* the client to log telemetry data.
*/
var TelemetryEventNotification;
(function (TelemetryEventNotification) {
TelemetryEventNotification.method = 'telemetry/event';
TelemetryEventNotification.messageDirection = messages_1.MessageDirection.serverToClient;
TelemetryEventNotification.type = new messages_1.ProtocolNotificationType(TelemetryEventNotification.method);
})(TelemetryEventNotification = exports.TelemetryEventNotification || (exports.TelemetryEventNotification = {}));
/**
* Defines how the host (editor) should sync
* document changes to the language server.
*/
var TextDocumentSyncKind;
(function (TextDocumentSyncKind) {
/**
* Documents should not be synced at all.
*/
TextDocumentSyncKind.None = 0;
/**
* Documents are synced by always sending the full content
* of the document.
*/
TextDocumentSyncKind.Full = 1;
/**
* Documents are synced by sending the full content on open.
* After that only incremental updates to the document are
* send.
*/
TextDocumentSyncKind.Incremental = 2;
})(TextDocumentSyncKind = exports.TextDocumentSyncKind || (exports.TextDocumentSyncKind = {}));
/**
* The document open notification is sent from the client to the server to signal
* newly opened text documents. The document's truth is now managed by the client
* and the server must not try to read the document's truth using the document's
* uri. Open in this sense means it is managed by the client. It doesn't necessarily
* mean that its content is presented in an editor. An open notification must not
* be sent more than once without a corresponding close notification send before.
* This means open and close notification must be balanced and the max open count
* is one.
*/
var DidOpenTextDocumentNotification;
(function (DidOpenTextDocumentNotification) {
DidOpenTextDocumentNotification.method = 'textDocument/didOpen';
DidOpenTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidOpenTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidOpenTextDocumentNotification.method);
})(DidOpenTextDocumentNotification = exports.DidOpenTextDocumentNotification || (exports.DidOpenTextDocumentNotification = {}));
var TextDocumentContentChangeEvent;
(function (TextDocumentContentChangeEvent) {
/**
* Checks whether the information describes a delta event.
*/
function isIncremental(event) {
let candidate = event;
return candidate !== undefined && candidate !== null &&
typeof candidate.text === 'string' && candidate.range !== undefined &&
(candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number');
}
TextDocumentContentChangeEvent.isIncremental = isIncremental;
/**
* Checks whether the information describes a full replacement event.
*/
function isFull(event) {
let candidate = event;
return candidate !== undefined && candidate !== null &&
typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;
}
TextDocumentContentChangeEvent.isFull = isFull;
})(TextDocumentContentChangeEvent = exports.TextDocumentContentChangeEvent || (exports.TextDocumentContentChangeEvent = {}));
/**
* The document change notification is sent from the client to the server to signal
* changes to a text document.
*/
var DidChangeTextDocumentNotification;
(function (DidChangeTextDocumentNotification) {
DidChangeTextDocumentNotification.method = 'textDocument/didChange';
DidChangeTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidChangeTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidChangeTextDocumentNotification.method);
})(DidChangeTextDocumentNotification = exports.DidChangeTextDocumentNotification || (exports.DidChangeTextDocumentNotification = {}));
/**
* The document close notification is sent from the client to the server when
* the document got closed in the client. The document's truth now exists where
* the document's uri points to (e.g. if the document's uri is a file uri the
* truth now exists on disk). As with the open notification the close notification
* is about managing the document's content. Receiving a close notification
* doesn't mean that the document was open in an editor before. A close
* notification requires a previous open notification to be sent.
*/
var DidCloseTextDocumentNotification;
(function (DidCloseTextDocumentNotification) {
DidCloseTextDocumentNotification.method = 'textDocument/didClose';
DidCloseTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidCloseTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidCloseTextDocumentNotification.method);
})(DidCloseTextDocumentNotification = exports.DidCloseTextDocumentNotification || (exports.DidCloseTextDocumentNotification = {}));
/**
* The document save notification is sent from the client to the server when
* the document got saved in the client.
*/
var DidSaveTextDocumentNotification;
(function (DidSaveTextDocumentNotification) {
DidSaveTextDocumentNotification.method = 'textDocument/didSave';
DidSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(DidSaveTextDocumentNotification.method);
})(DidSaveTextDocumentNotification = exports.DidSaveTextDocumentNotification || (exports.DidSaveTextDocumentNotification = {}));
/**
* Represents reasons why a text document is saved.
*/
var TextDocumentSaveReason;
(function (TextDocumentSaveReason) {
/**
* Manually triggered, e.g. by the user pressing save, by starting debugging,
* or by an API call.
*/
TextDocumentSaveReason.Manual = 1;
/**
* Automatic after a delay.
*/
TextDocumentSaveReason.AfterDelay = 2;
/**
* When the editor lost focus.
*/
TextDocumentSaveReason.FocusOut = 3;
})(TextDocumentSaveReason = exports.TextDocumentSaveReason || (exports.TextDocumentSaveReason = {}));
/**
* A document will save notification is sent from the client to the server before
* the document is actually saved.
*/
var WillSaveTextDocumentNotification;
(function (WillSaveTextDocumentNotification) {
WillSaveTextDocumentNotification.method = 'textDocument/willSave';
WillSaveTextDocumentNotification.messageDirection = messages_1.MessageDirection.clientToServer;
WillSaveTextDocumentNotification.type = new messages_1.ProtocolNotificationType(WillSaveTextDocumentNotification.method);
})(WillSaveTextDocumentNotification = exports.WillSaveTextDocumentNotification || (exports.WillSaveTextDocumentNotification = {}));
/**
* A document will save request is sent from the client to the server before
* the document is actually saved. The request can return an array of TextEdits
* which will be applied to the text document before it is saved. Please note that
* clients might drop results if computing the text edits took too long or if a
* server constantly fails on this request. This is done to keep the save fast and
* reliable.
*/
var WillSaveTextDocumentWaitUntilRequest;
(function (WillSaveTextDocumentWaitUntilRequest) {
WillSaveTextDocumentWaitUntilRequest.method = 'textDocument/willSaveWaitUntil';
WillSaveTextDocumentWaitUntilRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WillSaveTextDocumentWaitUntilRequest.type = new messages_1.ProtocolRequestType(WillSaveTextDocumentWaitUntilRequest.method);
})(WillSaveTextDocumentWaitUntilRequest = exports.WillSaveTextDocumentWaitUntilRequest || (exports.WillSaveTextDocumentWaitUntilRequest = {}));
/**
* The watched files notification is sent from the client to the server when
* the client detects changes to file watched by the language client.
*/
var DidChangeWatchedFilesNotification;
(function (DidChangeWatchedFilesNotification) {
DidChangeWatchedFilesNotification.method = 'workspace/didChangeWatchedFiles';
DidChangeWatchedFilesNotification.messageDirection = messages_1.MessageDirection.clientToServer;
DidChangeWatchedFilesNotification.type = new messages_1.ProtocolNotificationType(DidChangeWatchedFilesNotification.method);
})(DidChangeWatchedFilesNotification = exports.DidChangeWatchedFilesNotification || (exports.DidChangeWatchedFilesNotification = {}));
/**
* The file event type
*/
var FileChangeType;
(function (FileChangeType) {
/**
* The file got created.
*/
FileChangeType.Created = 1;
/**
* The file got changed.
*/
FileChangeType.Changed = 2;
/**
* The file got deleted.
*/
FileChangeType.Deleted = 3;
})(FileChangeType = exports.FileChangeType || (exports.FileChangeType = {}));
var RelativePattern;
(function (RelativePattern) {
function is(value) {
const candidate = value;
return Is.objectLiteral(candidate) && (vscode_languageserver_types_1.URI.is(candidate.baseUri) || vscode_languageserver_types_1.WorkspaceFolder.is(candidate.baseUri)) && Is.string(candidate.pattern);
}
RelativePattern.is = is;
})(RelativePattern = exports.RelativePattern || (exports.RelativePattern = {}));
var WatchKind;
(function (WatchKind) {
/**
* Interested in create events.
*/
WatchKind.Create = 1;
/**
* Interested in change events
*/
WatchKind.Change = 2;
/**
* Interested in delete events
*/
WatchKind.Delete = 4;
})(WatchKind = exports.WatchKind || (exports.WatchKind = {}));
/**
* Diagnostics notification are sent from the server to the client to signal
* results of validation runs.
*/
var PublishDiagnosticsNotification;
(function (PublishDiagnosticsNotification) {
PublishDiagnosticsNotification.method = 'textDocument/publishDiagnostics';
PublishDiagnosticsNotification.messageDirection = messages_1.MessageDirection.serverToClient;
PublishDiagnosticsNotification.type = new messages_1.ProtocolNotificationType(PublishDiagnosticsNotification.method);
})(PublishDiagnosticsNotification = exports.PublishDiagnosticsNotification || (exports.PublishDiagnosticsNotification = {}));
/**
* How a completion was triggered
*/
var CompletionTriggerKind;
(function (CompletionTriggerKind) {
/**
* Completion was triggered by typing an identifier (24x7 code
* complete), manual invocation (e.g Ctrl+Space) or via API.
*/
CompletionTriggerKind.Invoked = 1;
/**
* Completion was triggered by a trigger character specified by
* the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
*/
CompletionTriggerKind.TriggerCharacter = 2;
/**
* Completion was re-triggered as current completion list is incomplete
*/
CompletionTriggerKind.TriggerForIncompleteCompletions = 3;
})(CompletionTriggerKind = exports.CompletionTriggerKind || (exports.CompletionTriggerKind = {}));
/**
* Request to request completion at a given text document position. The request's
* parameter is of type {@link TextDocumentPosition} the response
* is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}
* or a Thenable that resolves to such.
*
* The request can delay the computation of the {@link CompletionItem.detail `detail`}
* and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`
* request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
* `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
*/
var CompletionRequest;
(function (CompletionRequest) {
CompletionRequest.method = 'textDocument/completion';
CompletionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CompletionRequest.type = new messages_1.ProtocolRequestType(CompletionRequest.method);
})(CompletionRequest = exports.CompletionRequest || (exports.CompletionRequest = {}));
/**
* Request to resolve additional information for a given completion item.The request's
* parameter is of type {@link CompletionItem} the response
* is of type {@link CompletionItem} or a Thenable that resolves to such.
*/
var CompletionResolveRequest;
(function (CompletionResolveRequest) {
CompletionResolveRequest.method = 'completionItem/resolve';
CompletionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CompletionResolveRequest.type = new messages_1.ProtocolRequestType(CompletionResolveRequest.method);
})(CompletionResolveRequest = exports.CompletionResolveRequest || (exports.CompletionResolveRequest = {}));
/**
* Request to request hover information at a given text document position. The request's
* parameter is of type {@link TextDocumentPosition} the response is of
* type {@link Hover} or a Thenable that resolves to such.
*/
var HoverRequest;
(function (HoverRequest) {
HoverRequest.method = 'textDocument/hover';
HoverRequest.messageDirection = messages_1.MessageDirection.clientToServer;
HoverRequest.type = new messages_1.ProtocolRequestType(HoverRequest.method);
})(HoverRequest = exports.HoverRequest || (exports.HoverRequest = {}));
/**
* How a signature help was triggered.
*
* @since 3.15.0
*/
var SignatureHelpTriggerKind;
(function (SignatureHelpTriggerKind) {
/**
* Signature help was invoked manually by the user or by a command.
*/
SignatureHelpTriggerKind.Invoked = 1;
/**
* Signature help was triggered by a trigger character.
*/
SignatureHelpTriggerKind.TriggerCharacter = 2;
/**
* Signature help was triggered by the cursor moving or by the document content changing.
*/
SignatureHelpTriggerKind.ContentChange = 3;
})(SignatureHelpTriggerKind = exports.SignatureHelpTriggerKind || (exports.SignatureHelpTriggerKind = {}));
var SignatureHelpRequest;
(function (SignatureHelpRequest) {
SignatureHelpRequest.method = 'textDocument/signatureHelp';
SignatureHelpRequest.messageDirection = messages_1.MessageDirection.clientToServer;
SignatureHelpRequest.type = new messages_1.ProtocolRequestType(SignatureHelpRequest.method);
})(SignatureHelpRequest = exports.SignatureHelpRequest || (exports.SignatureHelpRequest = {}));
/**
* A request to resolve the definition location of a symbol at a given text
* document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the response is of either type {@link Definition}
* or a typed array of {@link DefinitionLink} or a Thenable that resolves
* to such.
*/
var DefinitionRequest;
(function (DefinitionRequest) {
DefinitionRequest.method = 'textDocument/definition';
DefinitionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DefinitionRequest.type = new messages_1.ProtocolRequestType(DefinitionRequest.method);
})(DefinitionRequest = exports.DefinitionRequest || (exports.DefinitionRequest = {}));
/**
* A request to resolve project-wide references for the symbol denoted
* by the given text document position. The request's parameter is of
* type {@link ReferenceParams} the response is of type
* {@link Location Location[]} or a Thenable that resolves to such.
*/
var ReferencesRequest;
(function (ReferencesRequest) {
ReferencesRequest.method = 'textDocument/references';
ReferencesRequest.messageDirection = messages_1.MessageDirection.clientToServer;
ReferencesRequest.type = new messages_1.ProtocolRequestType(ReferencesRequest.method);
})(ReferencesRequest = exports.ReferencesRequest || (exports.ReferencesRequest = {}));
/**
* Request to resolve a {@link DocumentHighlight} for a given
* text document position. The request's parameter is of type [TextDocumentPosition]
* (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]
* (#DocumentHighlight) or a Thenable that resolves to such.
*/
var DocumentHighlightRequest;
(function (DocumentHighlightRequest) {
DocumentHighlightRequest.method = 'textDocument/documentHighlight';
DocumentHighlightRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentHighlightRequest.type = new messages_1.ProtocolRequestType(DocumentHighlightRequest.method);
})(DocumentHighlightRequest = exports.DocumentHighlightRequest || (exports.DocumentHighlightRequest = {}));
/**
* A request to list all symbols found in a given text document. The request's
* parameter is of type {@link TextDocumentIdentifier} the
* response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable
* that resolves to such.
*/
var DocumentSymbolRequest;
(function (DocumentSymbolRequest) {
DocumentSymbolRequest.method = 'textDocument/documentSymbol';
DocumentSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentSymbolRequest.type = new messages_1.ProtocolRequestType(DocumentSymbolRequest.method);
})(DocumentSymbolRequest = exports.DocumentSymbolRequest || (exports.DocumentSymbolRequest = {}));
/**
* A request to provide commands for the given text document and range.
*/
var CodeActionRequest;
(function (CodeActionRequest) {
CodeActionRequest.method = 'textDocument/codeAction';
CodeActionRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CodeActionRequest.type = new messages_1.ProtocolRequestType(CodeActionRequest.method);
})(CodeActionRequest = exports.CodeActionRequest || (exports.CodeActionRequest = {}));
/**
* Request to resolve additional information for a given code action.The request's
* parameter is of type {@link CodeAction} the response
* is of type {@link CodeAction} or a Thenable that resolves to such.
*/
var CodeActionResolveRequest;
(function (CodeActionResolveRequest) {
CodeActionResolveRequest.method = 'codeAction/resolve';
CodeActionResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CodeActionResolveRequest.type = new messages_1.ProtocolRequestType(CodeActionResolveRequest.method);
})(CodeActionResolveRequest = exports.CodeActionResolveRequest || (exports.CodeActionResolveRequest = {}));
/**
* A request to list project-wide symbols matching the query string given
* by the {@link WorkspaceSymbolParams}. The response is
* of type {@link SymbolInformation SymbolInformation[]} or a Thenable that
* resolves to such.
*
* @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients
* need to advertise support for WorkspaceSymbols via the client capability
* `workspace.symbol.resolveSupport`.
*
*/
var WorkspaceSymbolRequest;
(function (WorkspaceSymbolRequest) {
WorkspaceSymbolRequest.method = 'workspace/symbol';
WorkspaceSymbolRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WorkspaceSymbolRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolRequest.method);
})(WorkspaceSymbolRequest = exports.WorkspaceSymbolRequest || (exports.WorkspaceSymbolRequest = {}));
/**
* A request to resolve the range inside the workspace
* symbol's location.
*
* @since 3.17.0
*/
var WorkspaceSymbolResolveRequest;
(function (WorkspaceSymbolResolveRequest) {
WorkspaceSymbolResolveRequest.method = 'workspaceSymbol/resolve';
WorkspaceSymbolResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
WorkspaceSymbolResolveRequest.type = new messages_1.ProtocolRequestType(WorkspaceSymbolResolveRequest.method);
})(WorkspaceSymbolResolveRequest = exports.WorkspaceSymbolResolveRequest || (exports.WorkspaceSymbolResolveRequest = {}));
/**
* A request to provide code lens for the given text document.
*/
var CodeLensRequest;
(function (CodeLensRequest) {
CodeLensRequest.method = 'textDocument/codeLens';
CodeLensRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CodeLensRequest.type = new messages_1.ProtocolRequestType(CodeLensRequest.method);
})(CodeLensRequest = exports.CodeLensRequest || (exports.CodeLensRequest = {}));
/**
* A request to resolve a command for a given code lens.
*/
var CodeLensResolveRequest;
(function (CodeLensResolveRequest) {
CodeLensResolveRequest.method = 'codeLens/resolve';
CodeLensResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
CodeLensResolveRequest.type = new messages_1.ProtocolRequestType(CodeLensResolveRequest.method);
})(CodeLensResolveRequest = exports.CodeLensResolveRequest || (exports.CodeLensResolveRequest = {}));
/**
* A request to refresh all code actions
*
* @since 3.16.0
*/
var CodeLensRefreshRequest;
(function (CodeLensRefreshRequest) {
CodeLensRefreshRequest.method = `workspace/codeLens/refresh`;
CodeLensRefreshRequest.messageDirection = messages_1.MessageDirection.serverToClient;
CodeLensRefreshRequest.type = new messages_1.ProtocolRequestType0(CodeLensRefreshRequest.method);
})(CodeLensRefreshRequest = exports.CodeLensRefreshRequest || (exports.CodeLensRefreshRequest = {}));
/**
* A request to provide document links
*/
var DocumentLinkRequest;
(function (DocumentLinkRequest) {
DocumentLinkRequest.method = 'textDocument/documentLink';
DocumentLinkRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentLinkRequest.type = new messages_1.ProtocolRequestType(DocumentLinkRequest.method);
})(DocumentLinkRequest = exports.DocumentLinkRequest || (exports.DocumentLinkRequest = {}));
/**
* Request to resolve additional information for a given document link. The request's
* parameter is of type {@link DocumentLink} the response
* is of type {@link DocumentLink} or a Thenable that resolves to such.
*/
var DocumentLinkResolveRequest;
(function (DocumentLinkResolveRequest) {
DocumentLinkResolveRequest.method = 'documentLink/resolve';
DocumentLinkResolveRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentLinkResolveRequest.type = new messages_1.ProtocolRequestType(DocumentLinkResolveRequest.method);
})(DocumentLinkResolveRequest = exports.DocumentLinkResolveRequest || (exports.DocumentLinkResolveRequest = {}));
/**
* A request to to format a whole document.
*/
var DocumentFormattingRequest;
(function (DocumentFormattingRequest) {
DocumentFormattingRequest.method = 'textDocument/formatting';
DocumentFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentFormattingRequest.method);
})(DocumentFormattingRequest = exports.DocumentFormattingRequest || (exports.DocumentFormattingRequest = {}));
/**
* A request to to format a range in a document.
*/
var DocumentRangeFormattingRequest;
(function (DocumentRangeFormattingRequest) {
DocumentRangeFormattingRequest.method = 'textDocument/rangeFormatting';
DocumentRangeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentRangeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentRangeFormattingRequest.method);
})(DocumentRangeFormattingRequest = exports.DocumentRangeFormattingRequest || (exports.DocumentRangeFormattingRequest = {}));
/**
* A request to format a document on type.
*/
var DocumentOnTypeFormattingRequest;
(function (DocumentOnTypeFormattingRequest) {
DocumentOnTypeFormattingRequest.method = 'textDocument/onTypeFormatting';
DocumentOnTypeFormattingRequest.messageDirection = messages_1.MessageDirection.clientToServer;
DocumentOnTypeFormattingRequest.type = new messages_1.ProtocolRequestType(DocumentOnTypeFormattingRequest.method);
})(DocumentOnTypeFormattingRequest = exports.DocumentOnTypeFormattingRequest || (exports.DocumentOnTypeFormattingRequest = {}));
//---- Rename ----------------------------------------------
var PrepareSupportDefaultBehavior;
(function (PrepareSupportDefaultBehavior) {
/**
* The client's default behavior is to select the identifier
* according the to language's syntax rule.
*/
PrepareSupportDefaultBehavior.Identifier = 1;
})(PrepareSupportDefaultBehavior = exports.PrepareSupportDefaultBehavior || (exports.PrepareSupportDefaultBehavior = {}));
/**
* A request to rename a symbol.
*/
var RenameRequest;
(function (RenameRequest) {
RenameRequest.method = 'textDocument/rename';
RenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;
RenameRequest.type = new messages_1.ProtocolRequestType(RenameRequest.method);
})(RenameRequest = exports.RenameRequest || (exports.RenameRequest = {}));
/**
* A request to test and perform the setup necessary for a rename.
*
* @since 3.16 - support for default behavior
*/
var PrepareRenameRequest;
(function (PrepareRenameRequest) {
PrepareRenameRequest.method = 'textDocument/prepareRename';
PrepareRenameRequest.messageDirection = messages_1.MessageDirection.clientToServer;
PrepareRenameRequest.type = new messages_1.ProtocolRequestType(PrepareRenameRequest.method);
})(PrepareRenameRequest = exports.PrepareRenameRequest || (exports.PrepareRenameRequest = {}));
/**
* A request send from the client to the server to execute a command. The request might return
* a workspace edit which the client will apply to the workspace.
*/
var ExecuteCommandRequest;
(function (ExecuteCommandRequest) {
ExecuteCommandRequest.method = 'workspace/executeCommand';
ExecuteCommandRequest.messageDirection = messages_1.MessageDirection.clientToServer;
ExecuteCommandRequest.type = new messages_1.ProtocolRequestType(ExecuteCommandRequest.method);
})(ExecuteCommandRequest = exports.ExecuteCommandRequest || (exports.ExecuteCommandRequest = {}));
/**
* A request sent from the server to the client to modified certain resources.
*/
var ApplyWorkspaceEditRequest;
(function (ApplyWorkspaceEditRequest) {
ApplyWorkspaceEditRequest.method = 'workspace/applyEdit';
ApplyWorkspaceEditRequest.messageDirection = messages_1.MessageDirection.serverToClient;
ApplyWorkspaceEditRequest.type = new messages_1.ProtocolRequestType('workspace/applyEdit');
})(ApplyWorkspaceEditRequest = exports.ApplyWorkspaceEditRequest || (exports.ApplyWorkspaceEditRequest = {}));

View file

@ -0,0 +1,52 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Range } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { StaticRegistrationOptions, TextDocumentPositionParams, TextDocumentRegistrationOptions, WorkDoneProgressOptions, 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>;
}

View file

@ -0,0 +1,19 @@
"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 = exports.LinkedEditingRangeRequest || (exports.LinkedEditingRangeRequest = {}));

View file

@ -0,0 +1,106 @@
import { MessageDirection, ProtocolRequestType } from './messages';
import type { WorkDoneProgressOptions, WorkDoneProgressParams, PartialResultParams, TextDocumentRegistrationOptions, 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 declare 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 declare 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>;
}

View file

@ -0,0 +1,68 @@
"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 || (exports.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 || (exports.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 = exports.MonikerRequest || (exports.MonikerRequest = {}));

View file

@ -0,0 +1,400 @@
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 declare 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 declare type NotebookCellKind = 1 | 2;
export declare 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 declare 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 declare 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 declare type NotebookDocumentIdentifier = {
/**
* The notebook document's uri.
*/
uri: URI;
};
/**
* A versioned notebook document identifier.
*
* @since 3.17.0
*/
export declare type VersionedNotebookDocumentIdentifier = {
/**
* The version number of this notebook document.
*/
version: integer;
/**
* The notebook document's uri.
*/
uri: URI;
};
/**
* 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 declare type NotebookDocumentSyncOptions = {
/**
* The notebooks to be synced
*/
notebookSelector: ({
/**
* 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?: {
language: string;
}[];
} | {
/**
* 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: {
language: string;
}[];
})[];
/**
* 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 declare 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 declare 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, void>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* A change describing how to move a `NotebookCell`
* array from state S to S'.
*
* @since 3.17.0
*/
export declare 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;
}
/**
* A change event for a notebook document.
*
* @since 3.17.0
*/
export declare type NotebookDocumentChangeEvent = {
/**
* The changed meta data if any.
*
* Note: should always be an object literal (e.g. LSPObject)
*/
metadata?: LSPObject;
/**
* Changes to cells
*/
cells?: {
/**
* Changes to the cell structure to add or
* remove cells.
*/
structure?: {
/**
* The change to the cell array.
*/
array: NotebookCellArrayChange;
/**
* Additional opened cell text documents.
*/
didOpen?: TextDocumentItem[];
/**
* Additional closed cell text documents.
*/
didClose?: TextDocumentIdentifier[];
};
/**
* Changes to notebook cells properties like its
* kind, execution summary or metadata.
*/
data?: NotebookCell[];
/**
* Changes to the text content of notebook cells.
*/
textContent?: {
document: VersionedTextDocumentIdentifier;
changes: TextDocumentContentChangeEvent[];
}[];
};
};
/**
* The params sent in a change notebook document notification.
*
* @since 3.17.0
*/
export declare 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, void>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* The params sent in a save notebook document notification.
*
* @since 3.17.0
*/
export declare 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, void>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}
/**
* The params sent in a close notebook document notification.
*
* @since 3.17.0
*/
export declare 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, void>;
const registrationMethod: typeof NotebookDocumentSyncRegistrationType.method;
}

View file

@ -0,0 +1,214 @@
"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.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 = 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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.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 || (exports.DidCloseNotebookDocumentNotification = {}));

View file

@ -0,0 +1,107 @@
import { NotificationHandler, RequestHandler, ProgressType, ProgressToken } from 'vscode-jsonrpc';
import { uinteger } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType, ProtocolNotificationType } 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>;
}
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>;
}

View file

@ -0,0 +1,37 @@
"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 || (exports.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 = exports.WorkDoneProgressCreateRequest || (exports.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 || (exports.WorkDoneProgressCancelNotification = {}));

View file

@ -0,0 +1,41 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TextDocumentIdentifier, Position, SelectionRange } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, WorkDoneProgressOptions, StaticRegistrationOptions, WorkDoneProgressParams, 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>;
}

View file

@ -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.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 = exports.SelectionRangeRequest || (exports.SelectionRangeRequest = {}));

View file

@ -0,0 +1,223 @@
import { TextDocumentIdentifier, Range, uinteger, SemanticTokensEdit, SemanticTokensLegend, SemanticTokens, SemanticTokensDelta } from 'vscode-languageserver-types';
import { RequestHandler0, RequestHandler } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType, ProtocolRequestType0, RegistrationType } from './messages';
import type { PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions, TextDocumentRegistrationOptions, 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 declare type TokenFormat = 'relative';
/**
* @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: {
/**
* 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 | {
/**
* The client will send the `textDocument/semanticTokens/full/delta` request if
* the server provides a corresponding handler.
*/
delta?: boolean;
};
};
/**
* 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;
}
/**
* @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 | {
/**
* The server supports deltas for full documents.
*/
delta?: boolean;
};
}
/**
* @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>;
}
/**
* @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>;
}
/**
* @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>;
}
/**
* @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>;
}

View file

@ -0,0 +1,57 @@
"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 || (exports.TokenFormat = {}));
var SemanticTokensRegistrationType;
(function (SemanticTokensRegistrationType) {
SemanticTokensRegistrationType.method = 'textDocument/semanticTokens';
SemanticTokensRegistrationType.type = new messages_1.RegistrationType(SemanticTokensRegistrationType.method);
})(SemanticTokensRegistrationType = exports.SemanticTokensRegistrationType || (exports.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 = exports.SemanticTokensRequest || (exports.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 = exports.SemanticTokensDeltaRequest || (exports.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 = exports.SemanticTokensRangeRequest || (exports.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 = exports.SemanticTokensRefreshRequest || (exports.SemanticTokensRefreshRequest = {}));

View file

@ -0,0 +1,72 @@
import { HandlerResult, RequestHandler } from 'vscode-jsonrpc';
import { Range, URI } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } 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, next: HandlerSignature) => HandlerResult<ShowDocumentResult, void>;
}

View file

@ -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.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 = exports.ShowDocumentRequest || (exports.ShowDocumentRequest = {}));

View file

@ -0,0 +1,39 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { Definition, DefinitionLink, LocationLink, Location } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, 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 [TextDocumentPositionParams]
* (#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>;
}

View file

@ -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 LocatioLink 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 [TextDocumentPositionParams]
* (#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 = exports.TypeDefinitionRequest || (exports.TypeDefinitionRequest = {}));

View file

@ -0,0 +1,83 @@
import { RequestHandler } from 'vscode-jsonrpc';
import { TypeHierarchyItem } from 'vscode-languageserver-types';
import { MessageDirection, ProtocolRequestType } from './messages';
import type { TextDocumentRegistrationOptions, StaticRegistrationOptions, TextDocumentPositionParams, PartialResultParams, WorkDoneProgressParams, WorkDoneProgressOptions } from './protocol';
/**
* @since 3.17.0
*/
export declare 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 declare type TypeHierarchyOptions = WorkDoneProgressOptions;
/**
* Type hierarchy options used during static or dynamic registration.
*
* @since 3.17.0
*/
export declare type TypeHierarchyRegistrationOptions = TextDocumentRegistrationOptions & TypeHierarchyOptions & StaticRegistrationOptions;
/**
* The parameter of a `textDocument/prepareTypeHierarchy` request.
*
* @since 3.17.0
*/
export declare 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>;
}
/**
* The parameter of a `typeHierarchy/supertypes` request.
*
* @since 3.17.0
*/
export declare 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 declare 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>;
}

View file

@ -0,0 +1,42 @@
"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 = exports.TypeHierarchyPrepareRequest || (exports.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 || (exports.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 || (exports.TypeHierarchySubtypesRequest = {}));

View file

@ -0,0 +1,74 @@
import { WorkspaceFolder } from 'vscode-languageserver-types';
import { RequestHandler0, NotificationHandler, HandlerResult, CancellationToken } from 'vscode-jsonrpc';
import { MessageDirection, ProtocolRequestType0, ProtocolNotificationType } 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>;
}
/**
* 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;
}
/**
* 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[];
}

View file

@ -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.
* ------------------------------------------------------------------------------------------ */
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 = exports.WorkspaceFoldersRequest || (exports.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 = exports.DidChangeWorkspaceFoldersNotification || (exports.DidChangeWorkspaceFoldersNotification = {}));

View file

@ -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;

View file

@ -0,0 +1,46 @@
/* --------------------------------------------------------------------------------------------
* 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.objectLiteral = exports.typedArray = exports.stringArray = exports.array = exports.func = exports.error = exports.number = exports.string = exports.boolean = void 0;
function boolean(value) {
return value === true || value === false;
}
exports.boolean = boolean;
function string(value) {
return typeof value === 'string' || value instanceof String;
}
exports.string = string;
function number(value) {
return typeof value === 'number' || value instanceof Number;
}
exports.number = number;
function error(value) {
return value instanceof Error;
}
exports.error = error;
function func(value) {
return typeof value === 'function';
}
exports.func = func;
function array(value) {
return Array.isArray(value);
}
exports.array = array;
function stringArray(value) {
return array(value) && value.every(elem => string(elem));
}
exports.stringArray = stringArray;
function typedArray(value, check) {
return Array.isArray(value) && value.every(check);
}
exports.typedArray = typedArray;
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';
}
exports.objectLiteral = objectLiteral;

View file

@ -0,0 +1,6 @@
/// <reference types="node" />
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;

View file

@ -0,0 +1,28 @@
"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 = void 0;
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);
}
exports.createProtocolConnection = createProtocolConnection;