Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vscode-languageclient

Package Overview
Dependencies
Maintainers
11
Versions
302
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-languageclient - npm Package Compare versions

Comparing version 8.0.0-next.2 to 8.0.0-next.3

lib/common/proposed.typeHierarchy.d.ts

34

lib/common/client.d.ts

@@ -1,2 +0,2 @@

import { TextDocumentChangeEvent, TextDocument, Disposable, OutputChannel, FileSystemWatcher as VFileSystemWatcher, DiagnosticCollection, Diagnostic as VDiagnostic, Uri, ProviderResult, CancellationToken, Position as VPosition, Location as VLocation, Range as VRange, CompletionItem as VCompletionItem, CompletionList as VCompletionList, SignatureHelp as VSignatureHelp, SignatureHelpContext as VSignatureHelpContext, Definition as VDefinition, DefinitionLink as VDefinitionLink, DocumentHighlight as VDocumentHighlight, SymbolInformation as VSymbolInformation, CodeActionContext as VCodeActionContext, Command as VCommand, CodeLens as VCodeLens, FormattingOptions as VFormattingOptions, TextEdit as VTextEdit, WorkspaceEdit as VWorkspaceEdit, Hover as VHover, CodeAction as VCodeAction, DocumentSymbol as VDocumentSymbol, DocumentLink as VDocumentLink, TextDocumentWillSaveEvent, WorkspaceFolder as VWorkspaceFolder, CompletionContext as VCompletionContext, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentSymbolProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentLinkProvider, DocumentColorProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, SelectionRangeProvider, TypeDefinitionProvider, WorkspaceSymbolProvider, CallHierarchyProvider, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, FileCreateEvent, FileDeleteEvent, FileRenameEvent, LinkedEditingRangeProvider, Event as VEvent, CancellationError } from 'vscode';
import { TextDocumentChangeEvent, TextDocument, Disposable, OutputChannel, FileSystemWatcher as VFileSystemWatcher, DiagnosticCollection, Diagnostic as VDiagnostic, Uri, ProviderResult, CancellationToken, Position as VPosition, Location as VLocation, Range as VRange, CompletionItem as VCompletionItem, CompletionList as VCompletionList, SignatureHelp as VSignatureHelp, SignatureHelpContext as VSignatureHelpContext, Definition as VDefinition, DefinitionLink as VDefinitionLink, DocumentHighlight as VDocumentHighlight, SymbolInformation as VSymbolInformation, CodeActionContext as VCodeActionContext, Command as VCommand, CodeLens as VCodeLens, FormattingOptions as VFormattingOptions, TextEdit as VTextEdit, WorkspaceEdit as VWorkspaceEdit, Hover as VHover, CodeAction as VCodeAction, DocumentSymbol as VDocumentSymbol, DocumentLink as VDocumentLink, TextDocumentWillSaveEvent, WorkspaceFolder as VWorkspaceFolder, CompletionContext as VCompletionContext, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentSymbolProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentLinkProvider, DocumentColorProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, SelectionRangeProvider, TypeDefinitionProvider, WorkspaceSymbolProvider, CallHierarchyProvider, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, FileCreateEvent, FileDeleteEvent, FileRenameEvent, LinkedEditingRangeProvider, Event as VEvent, CancellationError, TypeHierarchyProvider as VTypeHierarchyProvider } from 'vscode';
import { Message, MessageSignature, ResponseError, RequestType0, RequestType, NotificationType0, NotificationType, ProtocolRequestType, ProtocolRequestType0, RequestHandler, RequestHandler0, GenericRequestHandler, ProtocolNotificationType, ProtocolNotificationType0, NotificationHandler, NotificationHandler0, GenericNotificationHandler, MessageReader, MessageWriter, Trace, Event, ClientCapabilities, TextDocumentRegistrationOptions, InitializeParams, InitializeResult, InitializeError, ServerCapabilities, DocumentSelector, DidOpenTextDocumentNotification, DidOpenTextDocumentParams, DidChangeTextDocumentNotification, DidChangeTextDocumentParams, DidCloseTextDocumentNotification, DidCloseTextDocumentParams, DidSaveTextDocumentNotification, DidSaveTextDocumentParams, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, FileEvent, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, DocumentSymbolRequest, WorkspaceSymbolRequest, CodeActionRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentLinkRequest, ProgressType, ProgressToken, StaticRegistrationOptions, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, CancellationStrategy, RegistrationType, SemanticTokensRegistrationType, ShowDocumentRequest, FileOperationRegistrationOptions, WillCreateFilesRequest, WillRenameFilesRequest, WillDeleteFilesRequest, DidCreateFilesNotification, DidDeleteFilesNotification, DidRenameFilesNotification, ShowDocumentParams, ShowDocumentResult, LinkedEditingRangeRequest, WorkDoneProgressBegin, WorkDoneProgressEnd, WorkDoneProgressReport, Proposed } from 'vscode-languageserver-protocol';

@@ -16,2 +16,3 @@ import type { ConfigurationWorkspaceMiddleware } from './configuration';

import type { DiagnosticFeatureProvider } from './proposed.diagnostic';
import type { TypeHierarchyMiddleware } from './proposed.typeHierarchy';
import * as c2p from './codeConverter';

@@ -198,4 +199,4 @@ import * as p2c from './protocolConverter';

export interface _WorkspaceMiddleware {
didChangeConfiguration?: (this: void, sections: string[] | undefined, next: DidChangeConfigurationSignature) => void;
didChangeWatchedFile?: (this: void, event: FileEvent, next: DidChangeWatchedFileSignature) => void;
didChangeConfiguration?: (this: void, sections: string[] | undefined, next: DidChangeConfigurationSignature) => Promise<void>;
didChangeWatchedFile?: (this: void, event: FileEvent, next: DidChangeWatchedFileSignature) => Promise<void>;
}

@@ -212,8 +213,8 @@ export declare type WorkspaceMiddleware = _WorkspaceMiddleware & ConfigurationWorkspaceMiddleware & WorkspaceFolderWorkspaceMiddleware & FileOperationsMiddleware;

export interface _Middleware {
didOpen?: NextSignature<TextDocument, void>;
didChange?: NextSignature<TextDocumentChangeEvent, void>;
willSave?: NextSignature<TextDocumentWillSaveEvent, void>;
didOpen?: NextSignature<TextDocument, Promise<void>>;
didChange?: NextSignature<TextDocumentChangeEvent, Promise<void>>;
willSave?: NextSignature<TextDocumentWillSaveEvent, Promise<void>>;
willSaveWaitUntil?: NextSignature<TextDocumentWillSaveEvent, Thenable<VTextEdit[]>>;
didSave?: NextSignature<TextDocument, void>;
didClose?: NextSignature<TextDocument, void>;
didSave?: NextSignature<TextDocument, Promise<void>>;
didClose?: NextSignature<TextDocument, Promise<void>>;
handleDiagnostics?: (this: void, uri: Uri, diagnostics: VDiagnostic[], next: HandleDiagnosticsSignature) => void;

@@ -250,3 +251,3 @@ handleWorkDoneProgress?: (this: void, token: ProgressToken, params: WorkDoneProgressBegin | WorkDoneProgressReport | WorkDoneProgressEnd, next: HandleWorkDoneProgressSignature) => void;

}
export declare type Middleware = _Middleware & TypeDefinitionMiddleware & ImplementationMiddleware & ColorProviderMiddleware & FoldingRangeProviderMiddleware & DeclarationMiddleware & SelectionRangeProviderMiddleware & CallHierarchyMiddleware & SemanticTokensMiddleware & LinkedEditingRangeMiddleware;
export declare type Middleware = _Middleware & TypeDefinitionMiddleware & ImplementationMiddleware & ColorProviderMiddleware & FoldingRangeProviderMiddleware & DeclarationMiddleware & SelectionRangeProviderMiddleware & CallHierarchyMiddleware & SemanticTokensMiddleware & LinkedEditingRangeMiddleware & TypeHierarchyMiddleware;
export interface LanguageClientOptions {

@@ -390,10 +391,10 @@ documentSelector?: DocumentSelector | string[];

}
export interface DidOpenTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => void>, NotifyingFeature<TextDocument, DidOpenTextDocumentParams> {
export interface DidOpenTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => Promise<void>>, NotifyingFeature<TextDocument, DidOpenTextDocumentParams> {
openDocuments: Iterable<TextDocument>;
}
export interface DidCloseTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => void>, NotifyingFeature<TextDocument, DidCloseTextDocumentParams> {
export interface DidCloseTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => Promise<void>>, NotifyingFeature<TextDocument, DidCloseTextDocumentParams> {
}
export interface DidChangeTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(event: TextDocumentChangeEvent) => void>, NotifyingFeature<TextDocumentChangeEvent, DidChangeTextDocumentParams> {
export interface DidChangeTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(event: TextDocumentChangeEvent) => Promise<void>>, NotifyingFeature<TextDocumentChangeEvent, DidChangeTextDocumentParams> {
}
export interface DidSaveTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => void>, NotifyingFeature<TextDocument, DidSaveTextDocumentParams> {
export interface DidSaveTextDocumentFeatureShape extends DynamicFeature<TextDocumentRegistrationOptions>, NotificationFeature<(textDocument: TextDocument) => Promise<void>>, NotifyingFeature<TextDocument, DidSaveTextDocumentParams> {
}

@@ -502,3 +503,3 @@ export interface TextDocumentProviderFeature<T> {

onProgress<P>(type: ProgressType<P>, token: string | number, handler: NotificationHandler<P>): Disposable;
sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): void;
sendProgress<P>(type: ProgressType<P>, token: string | number, value: P): Promise<void>;
get clientOptions(): LanguageClientOptions;

@@ -552,3 +553,3 @@ get protocol2CodeConverter(): p2c.Converter;

getFeature(request: typeof DidChangeTextDocumentNotification.method): DidChangeTextDocumentFeatureShape;
getFeature(request: typeof WillSaveTextDocumentNotification.method): DynamicFeature<TextDocumentRegistrationOptions> & NotificationFeature<(textDocument: TextDocument) => void>;
getFeature(request: typeof WillSaveTextDocumentNotification.method): DynamicFeature<TextDocumentRegistrationOptions> & NotificationFeature<(textDocument: TextDocument) => Promise<void>>;
getFeature(request: typeof WillSaveTextDocumentWaitUntilRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & NotificationFeature<(textDocument: TextDocument) => ProviderResult<VTextEdit[]>>;

@@ -597,2 +598,3 @@ getFeature(request: typeof DidSaveTextDocumentNotification.method): DidSaveTextDocumentFeatureShape;

getFeature(request: typeof LinkedEditingRangeRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<LinkedEditingRangeProvider>;
getFeature(request: typeof Proposed.TypeHierarchyPrepareRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<VTypeHierarchyProvider>;
getFeature(request: typeof Proposed.DocumentDiagnosticRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<DiagnosticFeatureProvider>;

@@ -608,4 +610,4 @@ getFeature(request: typeof WorkspaceSymbolRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<WorkspaceSymbolProvider>;

private static RequestsToCancelOnContentModified;
handleFailedRequest<T>(type: MessageSignature, token: CancellationToken | undefined, error: any, defaultValue: T): T;
handleFailedRequest<T>(type: MessageSignature, token: CancellationToken | undefined, error: any, defaultValue: T, showNotification?: boolean): T;
}
export {};

@@ -64,2 +64,3 @@ import * as code from 'vscode';

asCallHierarchyItem(value: code.CallHierarchyItem): proto.CallHierarchyItem;
asTypeHierarchyItem(value: code.TypeHierarchyItem): proto.TypeHierarchyItem;
}

@@ -66,0 +67,0 @@ export interface URIConverter {

@@ -18,2 +18,3 @@ "use strict";

const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
const protocolTypeHierarchyItem_1 = require("./protocolTypeHierarchyItem");
var InsertReplaceRange;

@@ -672,2 +673,21 @@ (function (InsertReplaceRange) {

}
function asTypeHierarchyItem(value) {
const result = {
name: value.name,
kind: asSymbolKind(value.kind),
uri: asUri(value.uri),
range: asRange(value.range),
selectionRange: asRange(value.selectionRange),
};
if (value.detail !== undefined && value.detail.length > 0) {
result.detail = value.detail;
}
if (value.tags !== undefined) {
result.tags = asSymbolTags(value.tags);
}
if (value instanceof protocolTypeHierarchyItem_1.default && value.data !== undefined) {
result.data = value.data;
}
return result;
}
return {

@@ -715,3 +735,4 @@ asUri,

asDocumentLinkParams,
asCallHierarchyItem
asCallHierarchyItem,
asTypeHierarchyItem
};

@@ -718,0 +739,0 @@ }

@@ -54,2 +54,3 @@ "use strict";

const pd = require("./proposed.diagnostic");
const pt = require("./proposed.typeHierarchy");
var ProposedFeatures;

@@ -59,3 +60,4 @@ (function (ProposedFeatures) {

let result = [
new pd.DiagnosticFeature(_client)
new pd.DiagnosticFeature(_client),
new pt.TypeHierarchyFeature(_client)
];

@@ -62,0 +64,0 @@ return result;

@@ -10,7 +10,7 @@ import * as code from 'vscode';

export interface FileOperationsMiddleware {
didCreateFiles?: NextSignature<code.FileCreateEvent, void>;
didCreateFiles?: NextSignature<code.FileCreateEvent, Promise<void>>;
willCreateFiles?: NextSignature<code.FileCreateEvent, Thenable<code.WorkspaceEdit | null | undefined>>;
didRenameFiles?: NextSignature<code.FileRenameEvent, void>;
didRenameFiles?: NextSignature<code.FileRenameEvent, Promise<void>>;
willRenameFiles?: NextSignature<code.FileRenameEvent, Thenable<code.WorkspaceEdit | null | undefined>>;
didDeleteFiles?: NextSignature<code.FileDeleteEvent, void>;
didDeleteFiles?: NextSignature<code.FileDeleteEvent, Promise<void>>;
willDeleteFiles?: NextSignature<code.FileDeleteEvent, Thenable<code.WorkspaceEdit | null | undefined>>;

@@ -49,7 +49,7 @@ }

send(originalEvent: E): Promise<void>;
protected abstract doSend(event: E, next: (event: E) => void): void;
protected abstract doSend(event: E, next: (event: E) => Promise<void>): Promise<void>;
}
export declare class DidCreateFilesFeature extends NotificationFileOperationFeature<code.Uri, code.FileCreateEvent, proto.CreateFilesParams> {
constructor(client: BaseLanguageClient);
protected doSend(event: code.FileCreateEvent, next: (event: code.FileCreateEvent) => void): void;
protected doSend(event: code.FileCreateEvent, next: (event: code.FileCreateEvent) => Promise<void>): Promise<void>;
}

@@ -61,7 +61,7 @@ export declare class DidRenameFilesFeature extends NotificationFileOperationFeature<{

constructor(client: BaseLanguageClient);
protected doSend(event: code.FileRenameEvent, next: (event: code.FileRenameEvent) => void): void;
protected doSend(event: code.FileRenameEvent, next: (event: code.FileRenameEvent) => Promise<void>): Promise<void>;
}
export declare class DidDeleteFilesFeature extends NotificationFileOperationFeature<code.Uri, code.FileDeleteEvent, proto.DeleteFilesParams> {
constructor(client: BaseLanguageClient);
protected doSend(event: code.FileCreateEvent, next: (event: code.FileCreateEvent) => void): void;
protected doSend(event: code.FileCreateEvent, next: (event: code.FileCreateEvent) => Promise<void>): Promise<void>;
}

@@ -68,0 +68,0 @@ interface RequestEvent<I> {

@@ -161,3 +161,3 @@ "use strict";

};
this.doSend(filteredEvent, next);
return this.doSend(filteredEvent, next);
}

@@ -164,0 +164,0 @@ }

@@ -35,10 +35,31 @@ "use strict";

this.open = new Set();
const openEditorsHandler = () => {
const openTabsHandler = () => {
this.open.clear();
for (const info of vscode_1.window.openEditors) {
this.open.add(info.resource.toString());
// New API
if (vscode_1.window.tabs !== undefined) {
for (const tab of vscode_1.window.tabs) {
if (tab.resource !== undefined) {
this.open.add(tab.resource.toString());
}
}
// Old pre 1.61 API
}
else if (vscode_1.window.openEditors !== undefined) {
for (const info of vscode_1.window.openEditors) {
if (info.resource !== undefined) {
this.open.add(info.resource.toString());
}
}
}
};
openEditorsHandler();
this.disposable = vscode_1.window.onDidChangeOpenEditors(openEditorsHandler);
openTabsHandler();
if (vscode_1.window.onDidChangeTabs !== undefined) {
this.disposable = vscode_1.window.onDidChangeTabs(openTabsHandler);
}
else if (vscode_1.window.onDidChangeOpenEditors !== undefined) {
this.disposable = vscode_1.window.onDidChangeOpenEditors(openTabsHandler);
}
else {
this.disposable = { dispose: () => { } };
}
}

@@ -66,4 +87,16 @@ dispose() {

}
track(kind, document, arg1, arg2) {
track(kind, document, arg1) {
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
const [key, uri, version] = typeof document === 'string'
? [document, vscode_1.Uri.parse(document), arg1]
: [document.uri.toString(), document.uri, document.version];
let state = states.get(key);
if (state === undefined) {
state = { document: uri, pulledVersion: version, resultId: undefined };
states.set(key, state);
}
return state;
}
update(kind, document, arg1, arg2) {
const states = kind === PullState.document ? this.documentPullStates : this.workspacePullStates;
const [key, uri, version, resultId] = typeof document === 'string'

@@ -81,3 +114,2 @@ ? [document, vscode_1.Uri.parse(document), arg1, arg2]

}
return state;
}

@@ -139,2 +171,3 @@ unTrack(kind, textDocument) {

const key = textDocument.uri.toString();
const version = textDocument.version;
const currentRequestState = this.openRequests.get(key);

@@ -144,7 +177,7 @@ const documentState = this.documentStates.track(PullState.document, textDocument);

const tokenSource = new vscode_1.CancellationTokenSource();
this.openRequests.set(key, { state: RequestStateKind.active, version: textDocument.version, textDocument, tokenSource });
this.openRequests.set(key, { state: RequestStateKind.active, version: version, textDocument, tokenSource });
let report;
let afterState;
try {
report = (_a = await this.provider.provideDiagnostics(textDocument, this.documentStates.getResultId(PullState.document, textDocument), tokenSource.token)) !== null && _a !== void 0 ? _a : { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };
report = (_a = await this.provider.provideDiagnostics(textDocument, documentState.resultId, tokenSource.token)) !== null && _a !== void 0 ? _a : { kind: vsdiag.DocumentDiagnosticReportKind.full, items: [] };
}

@@ -182,2 +215,3 @@ catch (error) {

}
documentState.pulledVersion = version;
documentState.resultId = report.resultId;

@@ -223,3 +257,3 @@ }

this.pullWorkspaceAsync().then(() => {
this.workspaceTimeout = vscode_languageserver_protocol_1.RAL().timer.setTimeout(() => {
this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
this.pullWorkspace();

@@ -233,3 +267,3 @@ }, 2000);

if (this.workspaceErrorCounter <= 5) {
this.workspaceTimeout = vscode_languageserver_protocol_1.RAL().timer.setTimeout(() => {
this.workspaceTimeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
this.pullWorkspace();

@@ -268,3 +302,3 @@ }, 2000);

}
this.documentStates.track(PullState.workspace, item.uri.toString(), (_a = item.version) !== null && _a !== void 0 ? _a : undefined, item.resultId);
this.documentStates.update(PullState.workspace, item.uri.toString(), (_a = item.version) !== null && _a !== void 0 ? _a : undefined, item.resultId);
}

@@ -332,3 +366,3 @@ });

const provideDiagnostics = (resultIds, token) => {
const partialResultToken = uuid_1.generateUuid();
const partialResultToken = (0, uuid_1.generateUuid)();
const disposable = this.client.onProgress(vscode_languageserver_protocol_1.Proposed.WorkspaceDiagnosticRequest.partialResult, partialResultToken, (partialResult) => {

@@ -427,3 +461,3 @@ if (partialResult === undefined || partialResult === null) {

this.endDocument = this.documents.last;
this.intervalHandle = vscode_languageserver_protocol_1.RAL().timer.setInterval(() => {
this.intervalHandle = (0, vscode_languageserver_protocol_1.RAL)().timer.setInterval(() => {
const document = this.documents.first;

@@ -430,0 +464,0 @@ if (document !== undefined) {

@@ -148,2 +148,8 @@ /// <reference path="../../typings/vscode-proposed.d.ts" />

asLinkedEditingRanges(value: ls.LinkedEditingRanges | null | undefined): code.LinkedEditingRanges | undefined;
asTypeHierarchyItem(item: null): undefined;
asTypeHierarchyItem(item: ls.TypeHierarchyItem): code.TypeHierarchyItem;
asTypeHierarchyItem(item: ls.TypeHierarchyItem | null): code.TypeHierarchyItem | undefined;
asTypeHierarchyItems(items: null): undefined;
asTypeHierarchyItems(items: ls.TypeHierarchyItem[]): code.TypeHierarchyItem[];
asTypeHierarchyItems(items: ls.TypeHierarchyItem[] | null): code.TypeHierarchyItem[] | undefined;
}

@@ -150,0 +156,0 @@ export interface URIConverter {

@@ -19,2 +19,3 @@ "use strict";

const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
const protocolTypeHierarchyItem_1 = require("./protocolTypeHierarchyItem");
var CodeBlock;

@@ -851,2 +852,18 @@ (function (CodeBlock) {

}
function asTypeHierarchyItem(item) {
if (item === null) {
return undefined;
}
let result = new protocolTypeHierarchyItem_1.default(asSymbolKind(item.kind), item.name, item.detail || '', asUri(item.uri), asRange(item.range), asRange(item.selectionRange), item.data);
if (item.tags !== undefined) {
result.tags = asSymbolTags(item.tags);
}
return result;
}
function asTypeHierarchyItems(items) {
if (items === null) {
return undefined;
}
return items.map(item => asTypeHierarchyItem(item));
}
return {

@@ -915,3 +932,5 @@ asUri,

asCallHierarchyOutgoingCalls,
asLinkedEditingRanges: asLinkedEditingRanges
asLinkedEditingRanges: asLinkedEditingRanges,
asTypeHierarchyItem,
asTypeHierarchyItems
};

@@ -918,0 +937,0 @@ }

@@ -34,3 +34,3 @@ "use strict";

if (delay >= 0 || this.timeout === void 0) {
this.timeout = vscode_languageserver_protocol_1.RAL().timer.setTimeout(() => {
this.timeout = (0, vscode_languageserver_protocol_1.RAL)().timer.setTimeout(() => {
this.timeout = undefined;

@@ -37,0 +37,0 @@ this.onSuccess(undefined);

@@ -7,3 +7,3 @@ import { WorkspaceFolder as VWorkspaceFolder, WorkspaceFoldersChangeEvent as VWorkspaceFoldersChangeEvent } from 'vscode';

workspaceFolders?: WorkspaceFoldersRequest.MiddlewareSignature;
didChangeWorkspaceFolders?: NextSignature<VWorkspaceFoldersChangeEvent, void>;
didChangeWorkspaceFolders?: NextSignature<VWorkspaceFoldersChangeEvent, Promise<void>>;
}

@@ -10,0 +10,0 @@ export declare class WorkspaceFoldersFeature implements DynamicFeature<void> {

@@ -77,2 +77,3 @@ "use strict";

sendInitialEvent(currentWorkspaceFolders) {
let promise;
if (this._initialFolders && currentWorkspaceFolders) {

@@ -82,11 +83,16 @@ const removed = arrayDiff(this._initialFolders, currentWorkspaceFolders);

if (added.length > 0 || removed.length > 0) {
this.doSendEvent(added, removed);
promise = this.doSendEvent(added, removed);
}
}
else if (this._initialFolders) {
this.doSendEvent([], this._initialFolders);
promise = this.doSendEvent([], this._initialFolders);
}
else if (currentWorkspaceFolders) {
this.doSendEvent(currentWorkspaceFolders, []);
promise = this.doSendEvent(currentWorkspaceFolders, []);
}
if (promise !== undefined) {
promise.catch((error) => {
this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);
});
}
}

@@ -100,5 +106,3 @@ doSendEvent(addedFolders, removedFolders) {

};
this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, params).catch((error) => {
this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);
});
return this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, params);
}

@@ -110,8 +114,11 @@ register(data) {

let didChangeWorkspaceFolders = (event) => {
this.doSendEvent(event.added, event.removed);
return this.doSendEvent(event.added, event.removed);
};
let middleware = client.clientOptions.middleware.workspace;
middleware && middleware.didChangeWorkspaceFolders
const promise = middleware && middleware.didChangeWorkspaceFolders
? middleware.didChangeWorkspaceFolders(event, didChangeWorkspaceFolders)
: didChangeWorkspaceFolders(event);
promise.catch((error) => {
this._client.error(`Sending notification ${vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type.method} failed`, error);
});
});

@@ -118,0 +125,0 @@ this._listeners.set(id, disposable);

@@ -30,3 +30,3 @@ "use strict";

__exportStar(require("../common/api"), exports);
const REQUIRED_VSCODE_VERSION = '^1.58.0'; // do not change format, updated by `updateVSCode` script
const REQUIRED_VSCODE_VERSION = '^1.61.0'; // do not change format, updated by `updateVSCode` script
var TransportKind;

@@ -151,3 +151,3 @@ (function (TransportKind) {

process.kill(childProcess.pid, 0);
processes_1.terminate(childProcess);
(0, processes_1.terminate)(childProcess);
}

@@ -273,3 +273,3 @@ catch (error) {

else if (transport === TransportKind.pipe) {
pipeName = node_1.generateRandomPipeName();
pipeName = (0, node_1.generateRandomPipeName)();
args.push(`--pipe=${pipeName}`);

@@ -297,3 +297,3 @@ }

else if (transport === TransportKind.pipe) {
return node_1.createClientPipeTransport(pipeName).then((transport) => {
return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {
const process = cp.spawn(runtime, args, execOptions);

@@ -312,3 +312,3 @@ if (!process || !process.pid) {

else if (Transport.isSocket(transport)) {
return node_1.createClientSocketTransport(transport.port).then((transport) => {
return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {
const process = cp.spawn(runtime, args, execOptions);

@@ -339,3 +339,3 @@ if (!process || !process.pid) {

else if (transport === TransportKind.pipe) {
pipeName = node_1.generateRandomPipeName();
pipeName = (0, node_1.generateRandomPipeName)();
args.push(`--pipe=${pipeName}`);

@@ -366,3 +366,3 @@ }

else if (transport === TransportKind.pipe) {
node_1.createClientPipeTransport(pipeName).then((transport) => {
(0, node_1.createClientPipeTransport)(pipeName).then((transport) => {
const sp = cp.fork(node.module, args || [], options);

@@ -379,3 +379,3 @@ assertStdio(sp);

else if (Transport.isSocket(transport)) {
node_1.createClientSocketTransport(transport.port).then((transport) => {
(0, node_1.createClientSocketTransport)(transport.port).then((transport) => {
const sp = cp.fork(node.module, args || [], options);

@@ -403,3 +403,3 @@ assertStdio(sp);

else if (transport === TransportKind.pipe) {
pipeName = node_1.generateRandomPipeName();
pipeName = (0, node_1.generateRandomPipeName)();
args.push(`--pipe=${pipeName}`);

@@ -426,3 +426,3 @@ }

else if (transport === TransportKind.pipe) {
return node_1.createClientPipeTransport(pipeName).then((transport) => {
return (0, node_1.createClientPipeTransport)(pipeName).then((transport) => {
const serverProcess = cp.spawn(command.command, args, options);

@@ -442,3 +442,3 @@ if (!serverProcess || !serverProcess.pid) {

else if (Transport.isSocket(transport)) {
return node_1.createClientSocketTransport(transport.port).then((transport) => {
return (0, node_1.createClientSocketTransport)(transport.port).then((transport) => {
const serverProcess = cp.spawn(command.command, args, options);

@@ -445,0 +445,0 @@ if (!serverProcess || !serverProcess.pid) {

@@ -34,3 +34,3 @@ "use strict";

try {
var cmd = path_1.join(__dirname, 'terminateProcess.sh');
var cmd = (0, path_1.join)(__dirname, 'terminateProcess.sh');
var result = cp.spawnSync(cmd, [process.pid.toString()]);

@@ -37,0 +37,0 @@ return result.error ? false : true;

{
"name": "vscode-languageclient",
"description": "VSCode Language client implementation",
"version": "8.0.0-next.2",
"version": "8.0.0-next.3",
"author": "Microsoft Corporation",
"license": "MIT",
"engines": {
"vscode": "^1.58.0"
"vscode": "^1.61.0"
},

@@ -24,11 +24,11 @@ "repository": {

"devDependencies": {
"@types/minimatch": "^3.0.3",
"@types/semver": "^7.3.4",
"@types/vscode": "1.58.0",
"shx": "^0.3.2"
"@types/minimatch": "^3.0.5",
"@types/semver": "^7.3.8",
"@types/vscode": "1.61.0",
"shx": "^0.3.3"
},
"dependencies": {
"minimatch": "^3.0.4",
"semver": "^7.3.4",
"vscode-languageserver-protocol": "3.17.0-next.8"
"semver": "^7.3.5",
"vscode-languageserver-protocol": "3.17.0-next.9"
},

@@ -35,0 +35,0 @@ "scripts": {

@@ -8,2 +8,93 @@ /* --------------------------------------------------------------------------------------------

// New API since 1.61.0
/**
* Represents a tab within the window
*/
export interface Tab {
/**
* The text displayed on the tab
*/
readonly label: string;
/**
* The index of the tab within the column
*/
readonly index: number;
/**
* The column which the tab belongs to
*/
readonly viewColumn: ViewColumn;
/**
* The resource represented by the tab if availble.
* Note: Not all tabs have a resource associated with them.
*/
readonly resource?: Uri;
/**
* The identifier of the view contained in the tab
* This is equivalent to `viewType` for custom editors and `notebookType` for notebooks.
* The built-in text editor has an id of 'default' for all configurations.
*/
readonly viewId?: string;
/**
* All the resources and viewIds represented by a tab
* {@link Tab.resource resource} and {@link Tab.viewId viewId} will
* always be at index 0.
*/
additionalResourcesAndViewIds: { resource?: Uri, viewId?: string }[];
/**
* Whether or not the tab is currently active
* Dictated by being the selected tab in the active group
*/
readonly isActive: boolean;
/**
* Moves a tab to the given index within the column.
* If the index is out of range, the tab will be moved to the end of the column.
* If the column is out of range, a new one will be created after the last existing column.
* @param index The index to move the tab to
* @param viewColumn The column to move the tab into
*/
move(index: number, viewColumn: ViewColumn): Thenable<void>;
/**
* Closes the tab. This makes the tab object invalid and the tab
* should no longer be used for further actions.
*/
close(): Thenable<void>;
}
export namespace window {
/**
* A list of all opened tabs
* Ordered from left to right
*/
export const tabs: readonly Tab[];
/**
* The currently active tab
* Undefined if no tabs are currently opened
*/
export const activeTab: Tab | undefined;
/**
* An {@link Event} which fires when the array of {@link window.tabs tabs}
* has changed.
*/
export const onDidChangeTabs: Event<readonly Tab[]>;
/**
* An {@link Event} which fires when the {@link window.activeTab activeTab}
* has changed.
*/
export const onDidChangeActiveTab: Event<Tab | undefined>;
}
// Old API
export interface OpenEditorInfo {

@@ -10,0 +101,0 @@ name: string;

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc