vscode-languageclient
Advanced tools
Comparing version 7.0.0-next.12 to 7.0.0-next.13
@@ -8,2 +8,3 @@ import { CommonLanguageClient, LanguageClientOptions, MessageTransports } from '../common/api'; | ||
protected createMessageTransports(_encoding: string): Promise<MessageTransports>; | ||
protected getLocale(): string; | ||
} |
@@ -32,4 +32,9 @@ "use strict"; | ||
} | ||
getLocale() { | ||
// ToDo: need to find a way to let the locale | ||
// travel to the worker extension host. | ||
return 'en'; | ||
} | ||
} | ||
exports.LanguageClient = LanguageClient; | ||
//# sourceMappingURL=main.js.map |
import { Disposable, TextDocument, ProviderResult, Position as VPosition, CallHierarchyItem as VCallHierarchyItem, CallHierarchyIncomingCall as VCallHierarchyIncomingCall, CallHierarchyOutgoingCall as VCallHierarchyOutgoingCall, CancellationToken, CallHierarchyProvider as VCallHierarchyProvider } from 'vscode'; | ||
import { ClientCapabilities, ServerCapabilities, DocumentSelector, CallHierarchyOptions, CallHierarchyRegistrationOptions } from 'vscode-languageserver-protocol'; | ||
import { TextDocumentFeature, BaseLanguageClient } from './client'; | ||
export interface PrepareCallHierachySignature { | ||
export interface PrepareCallHierarchySignature { | ||
(this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VCallHierarchyItem | VCallHierarchyItem[]>; | ||
@@ -14,5 +14,5 @@ } | ||
export interface CallHierarchyMiddleware { | ||
prepareCallHierarchy?: (this: void, document: TextDocument, positions: VPosition, token: CancellationToken, next: PrepareCallHierachySignature) => ProviderResult<VCallHierarchyItem | VCallHierarchyItem[]>; | ||
prepareCallHierarchy?: (this: void, document: TextDocument, positions: VPosition, token: CancellationToken, next: PrepareCallHierarchySignature) => ProviderResult<VCallHierarchyItem | VCallHierarchyItem[]>; | ||
provideCallHierarchyIncomingCalls?: (this: void, item: VCallHierarchyItem, token: CancellationToken, next: CallHierarchyIncomingCallsSignature) => ProviderResult<VCallHierarchyIncomingCall[]>; | ||
provideCallHierarchyOutgingCalls?: (this: void, item: VCallHierarchyItem, token: CancellationToken, next: CallHierarchyOutgoingCallsSignature) => ProviderResult<VCallHierarchyOutgoingCall[]>; | ||
provideCallHierarchyOutgoingCalls?: (this: void, item: VCallHierarchyItem, token: CancellationToken, next: CallHierarchyOutgoingCallsSignature) => ProviderResult<VCallHierarchyOutgoingCall[]>; | ||
} | ||
@@ -19,0 +19,0 @@ declare class CallHierarchyProvider implements VCallHierarchyProvider { |
@@ -67,4 +67,4 @@ "use strict"; | ||
}; | ||
return middleware.provideCallHierarchyOutgingCalls | ||
? middleware.provideCallHierarchyOutgingCalls(item, token, provideCallHierarchyOutgoingCalls) | ||
return middleware.provideCallHierarchyOutgoingCalls | ||
? middleware.provideCallHierarchyOutgoingCalls(item, token, provideCallHierarchyOutgoingCalls) | ||
: provideCallHierarchyOutgoingCalls(item, token); | ||
@@ -78,4 +78,4 @@ } | ||
fillClientCapabilities(cap) { | ||
const capabilites = cap; | ||
const capability = ensure(ensure(capabilites, 'textDocument'), 'callHierarchy'); | ||
const capabilities = cap; | ||
const capability = ensure(ensure(capabilities, 'textDocument'), 'callHierarchy'); | ||
capability.dynamicRegistration = true; | ||
@@ -82,0 +82,0 @@ } |
@@ -1,3 +0,3 @@ | ||
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 } 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, DidChangeTextDocumentNotification, DidCloseTextDocumentNotification, DidSaveTextDocumentNotification, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, FileEvent, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, DocumentSymbolRequest, WorkspaceSymbolRequest, CodeActionRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentLinkRequest, ProgressType, StaticRegistrationOptions, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, CancellationStrategy, RegistrationType, SemanticTokensRegistrationType } from 'vscode-languageserver-protocol'; | ||
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, OnTypeRenameProvider } 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, DidChangeTextDocumentNotification, DidCloseTextDocumentNotification, DidSaveTextDocumentNotification, WillSaveTextDocumentNotification, WillSaveTextDocumentWaitUntilRequest, FileEvent, CompletionRequest, HoverRequest, SignatureHelpRequest, DefinitionRequest, ReferencesRequest, DocumentHighlightRequest, DocumentSymbolRequest, WorkspaceSymbolRequest, CodeActionRequest, DocumentFormattingRequest, DocumentRangeFormattingRequest, DocumentOnTypeFormattingRequest, RenameRequest, DocumentLinkRequest, ProgressType, StaticRegistrationOptions, DocumentColorRequest, DeclarationRequest, FoldingRangeRequest, ImplementationRequest, SelectionRangeRequest, TypeDefinitionRequest, CallHierarchyPrepareRequest, CancellationStrategy, RegistrationType, SemanticTokensRegistrationType, ShowDocumentRequest, ShowDocumentParams, ShowDocumentResult, OnTypeRenameRequest } from 'vscode-languageserver-protocol'; | ||
import type { ColorProviderMiddleware } from './colorProvider'; | ||
@@ -13,2 +13,3 @@ import type { ImplementationMiddleware } from './implementation'; | ||
import type { SemanticTokensMiddleware, SemanticTokensProviders } from './semanticTokens'; | ||
import { OnTypeRenameMiddleware } from './onTypeRename'; | ||
import * as c2p from './codeConverter'; | ||
@@ -47,3 +48,3 @@ import * as p2c from './protocolConverter'; | ||
/** | ||
* A pluggable error handler that is invoked when the connection is either | ||
* A plugable error handler that is invoked when the connection is either | ||
* producing errors or got closed. | ||
@@ -188,4 +189,8 @@ */ | ||
export declare type WorkspaceMiddleware = _WorkspaceMiddleware & ConfigurationWorkspaceMiddleware & WorkspaceFolderWorkspaceMiddleware; | ||
export interface _WindowMiddleware { | ||
showDocument?: (this: void, params: ShowDocumentParams, next: ShowDocumentRequest.HandlerSignature) => Promise<ShowDocumentResult>; | ||
} | ||
export declare type WindowMiddleware = _WindowMiddleware; | ||
/** | ||
* The Middleware lets extensions intercept the request and notications send and received | ||
* The Middleware lets extensions intercept the request and notifications send and received | ||
* from the server | ||
@@ -228,4 +233,5 @@ */ | ||
workspace?: WorkspaceMiddleware; | ||
window?: WindowMiddleware; | ||
} | ||
export declare type Middleware = _Middleware & TypeDefinitionMiddleware & ImplementationMiddleware & ColorProviderMiddleware & FoldingRangeProviderMiddleware & DeclarationMiddleware & SelectionRangeProviderMiddleware & CallHierarchyMiddleware & SemanticTokensMiddleware; | ||
export declare type Middleware = _Middleware & TypeDefinitionMiddleware & ImplementationMiddleware & ColorProviderMiddleware & FoldingRangeProviderMiddleware & DeclarationMiddleware & SelectionRangeProviderMiddleware & CallHierarchyMiddleware & SemanticTokensMiddleware & OnTypeRenameMiddleware; | ||
export interface LanguageClientOptions { | ||
@@ -241,3 +247,3 @@ documentSelector?: DocumentSelector | string[]; | ||
* The encoding use to read stdout and stderr. Defaults | ||
* to 'utf8' if ommitted. | ||
* to 'utf8' if omitted. | ||
*/ | ||
@@ -301,2 +307,7 @@ stdioEncoding?: string; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector | undefined): void; | ||
/** | ||
* Called when the client is stopped to dispose this feature. Usually a feature | ||
* un-registers listeners registered hooked up with the VS Code extension host. | ||
*/ | ||
dispose(): void; | ||
} | ||
@@ -318,3 +329,3 @@ export interface DynamicFeature<RO> { | ||
* Initialize the feature. This method is called on a feature instance | ||
* when the client has successfully received the initalize request from | ||
* when the client has successfully received the initialize request from | ||
* the server and before the client sends the initialized notification | ||
@@ -324,3 +335,3 @@ * to the server. | ||
* @param capabilities the server capabilities. | ||
* @param documentSelector the document selector pass to the client's constuctor. | ||
* @param documentSelector the document selector pass to the client's constructor. | ||
* May be `undefined` if the client was created without a selector. | ||
@@ -347,3 +358,3 @@ */ | ||
* Called when the client is stopped to dispose this feature. Usually a feature | ||
* unregisters listeners registerd hooked up with the VS Code extension host. | ||
* un-registers listeners registered hooked up with the VS Code extension host. | ||
*/ | ||
@@ -494,5 +505,7 @@ dispose(): void; | ||
private notifyFileEvent; | ||
private _didChangeTextDocumentFeature; | ||
private forceDocumentSync; | ||
private handleDiagnostics; | ||
private setDiagnostics; | ||
protected abstract getLocale(): string; | ||
protected abstract createMessageTransports(encoding: string): Promise<MessageTransports>; | ||
@@ -536,2 +549,3 @@ private createConnection; | ||
getFeature(request: typeof SemanticTokensRegistrationType.method): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<SemanticTokensProviders>; | ||
getFeature(request: typeof OnTypeRenameRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & TextDocumentProviderFeature<OnTypeRenameProvider>; | ||
getFeature(request: typeof WorkspaceSymbolRequest.method): DynamicFeature<TextDocumentRegistrationOptions> & WorkspaceProviderFeature<WorkspaceSymbolProvider>; | ||
@@ -538,0 +552,0 @@ protected registerBuiltinFeatures(): void; |
@@ -46,3 +46,3 @@ import * as code from 'vscode'; | ||
asCodeLens(item: code.CodeLens): proto.CodeLens; | ||
asFormattingOptions(item: code.FormattingOptions): proto.FormattingOptions; | ||
asFormattingOptions(item: code.FormattingOptions, config: code.WorkspaceConfiguration): proto.FormattingOptions; | ||
asDocumentSymbolParams(textDocument: code.TextDocument): proto.DocumentSymbolParams; | ||
@@ -49,0 +49,0 @@ asCodeLensParams(textDocument: code.TextDocument): proto.CodeLensParams; |
@@ -17,2 +17,3 @@ "use strict"; | ||
const protocolCallHierarchyItem_1 = require("./protocolCallHierarchyItem"); | ||
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol"); | ||
var InsertReplaceRange; | ||
@@ -417,2 +418,5 @@ (function (InsertReplaceRange) { | ||
} | ||
if (protocolItem.insertTextMode !== undefined) { | ||
result.insertTextMode = protocolItem.insertTextMode; | ||
} | ||
} | ||
@@ -422,2 +426,5 @@ if (tags !== undefined && tags.length > 0) { | ||
} | ||
if (result.insertTextMode === undefined && item.keepWhitespace === true) { | ||
result.insertTextMode = vscode_languageserver_protocol_1.InsertTextMode.adjustIndentation; | ||
} | ||
return result; | ||
@@ -548,4 +555,14 @@ } | ||
} | ||
function asFormattingOptions(item) { | ||
return { tabSize: item.tabSize, insertSpaces: item.insertSpaces }; | ||
function asFormattingOptions(item, config) { | ||
const result = { tabSize: item.tabSize, insertSpaces: item.insertSpaces }; | ||
if (config.get('trimTrailingWhitespace') === true) { | ||
result.trimTrailingWhitespace = true; | ||
} | ||
if (config.get('trimFinalNewlines') === true) { | ||
result.trimFinalNewlines = true; | ||
} | ||
if (config.get('insertFinalNewline') === true) { | ||
result.insertFinalNewline = true; | ||
} | ||
return result; | ||
} | ||
@@ -552,0 +569,0 @@ function asDocumentSymbolParams(textDocument) { |
@@ -22,3 +22,3 @@ import { Disposable, TextDocument, ProviderResult, Range as VRange, Color as VColor, ColorPresentation as VColorPresentation, ColorInformation as VColorInformation, DocumentColorProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
@@ -25,0 +25,0 @@ protected registerLanguageProvider(options: DocumentColorRegistrationOptions): [Disposable, DocumentColorProvider]; |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
ensure(ensure(capabilites, 'textDocument'), 'colorProvider').dynamicRegistration = true; | ||
fillClientCapabilities(capabilities) { | ||
ensure(ensure(capabilities, 'textDocument'), 'colorProvider').dynamicRegistration = true; | ||
} | ||
@@ -25,0 +25,0 @@ initialize(capabilities, documentSelector) { |
@@ -20,2 +20,3 @@ "use strict"; | ||
const semanticTokens_1 = require("./semanticTokens"); | ||
const onTypeRename_1 = require("./onTypeRename"); | ||
class CommonLanguageClient extends client_1.BaseLanguageClient { | ||
@@ -41,2 +42,3 @@ constructor(id, name, clientOptions) { | ||
this.registerFeature(new semanticTokens_1.SemanticTokensFeature(this)); | ||
this.registerFeature(new onTypeRename_1.OnTypeRenameFeature(this)); | ||
} | ||
@@ -43,0 +45,0 @@ } |
@@ -12,3 +12,4 @@ import { StaticFeature, BaseLanguageClient } from './client'; | ||
private getConfiguration; | ||
dispose(): void; | ||
} | ||
export declare function toJSONObject(obj: any): any; |
@@ -63,2 +63,4 @@ "use strict"; | ||
} | ||
dispose() { | ||
} | ||
} | ||
@@ -65,0 +67,0 @@ exports.ConfigurationFeature = ConfigurationFeature; |
@@ -12,5 +12,5 @@ import { Disposable, TextDocument, ProviderResult, Position as VPosition, Declaration as VDeclaration, DeclarationProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
protected registerLanguageProvider(options: DeclarationRegistrationOptions): [Disposable, DeclarationProvider]; | ||
} |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
const declarationSupport = ensure(ensure(capabilites, 'textDocument'), 'declaration'); | ||
fillClientCapabilities(capabilities) { | ||
const declarationSupport = ensure(ensure(capabilities, 'textDocument'), 'declaration'); | ||
declarationSupport.dynamicRegistration = true; | ||
@@ -25,0 +25,0 @@ declarationSupport.linkSupport = true; |
@@ -12,3 +12,3 @@ import { Disposable, TextDocument, ProviderResult, FoldingRange as VFoldingRange, FoldingContext, FoldingRangeProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
@@ -15,0 +15,0 @@ protected registerLanguageProvider(options: FoldingRangeRegistrationOptions): [Disposable, FoldingRangeProvider]; |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
let capability = ensure(ensure(capabilites, 'textDocument'), 'foldingRange'); | ||
fillClientCapabilities(capabilities) { | ||
let capability = ensure(ensure(capabilities, 'textDocument'), 'foldingRange'); | ||
capability.dynamicRegistration = true; | ||
@@ -25,0 +25,0 @@ capability.rangeLimit = 5000; |
@@ -12,5 +12,5 @@ import { Disposable, TextDocument, ProviderResult, Position as VPosition, Definition as VDefinition, DefinitionLink as VDefinitionLink, ImplementationProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
protected registerLanguageProvider(options: ImplementationRegistrationOptions): [Disposable, ImplementationProvider]; | ||
} |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
let implementationSupport = ensure(ensure(capabilites, 'textDocument'), 'implementation'); | ||
fillClientCapabilities(capabilities) { | ||
let implementationSupport = ensure(ensure(capabilities, 'textDocument'), 'implementation'); | ||
implementationSupport.dynamicRegistration = true; | ||
@@ -25,0 +25,0 @@ implementationSupport.linkSupport = true; |
@@ -5,5 +5,7 @@ import { ClientCapabilities } from 'vscode-languageserver-protocol'; | ||
private _client; | ||
private activeParts; | ||
constructor(_client: BaseLanguageClient); | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(): void; | ||
dispose(): void; | ||
} |
@@ -19,2 +19,3 @@ "use strict"; | ||
this._client = _client; | ||
this.activeParts = new Set(); | ||
} | ||
@@ -25,10 +26,19 @@ fillClientCapabilities(capabilities) { | ||
initialize() { | ||
let client = this._client; | ||
let createHandler = (params) => { | ||
new progressPart_1.ProgressPart(this._client, params.token); | ||
const client = this._client; | ||
const deleteHandler = (part) => { | ||
this.activeParts.delete(part); | ||
}; | ||
const createHandler = (params) => { | ||
this.activeParts.add(new progressPart_1.ProgressPart(this._client, params.token, deleteHandler)); | ||
}; | ||
client.onRequest(vscode_languageserver_protocol_1.WorkDoneProgressCreateRequest.type, createHandler); | ||
} | ||
dispose() { | ||
for (const part of this.activeParts) { | ||
part.done(); | ||
} | ||
this.activeParts.clear(); | ||
} | ||
} | ||
exports.ProgressFeature = ProgressFeature; | ||
//# sourceMappingURL=progress.js.map |
@@ -17,3 +17,3 @@ import { Disposable } from 'vscode'; | ||
private _reject; | ||
constructor(_client: ProgressContext, _token: ProgressToken); | ||
constructor(_client: ProgressContext, _token: ProgressToken, done?: (part: ProgressPart) => void); | ||
private begin; | ||
@@ -20,0 +20,0 @@ private report; |
@@ -12,3 +12,3 @@ "use strict"; | ||
class ProgressPart { | ||
constructor(_client, _token) { | ||
constructor(_client, _token, done) { | ||
this._client = _client; | ||
@@ -27,2 +27,3 @@ this._token = _token; | ||
this.done(); | ||
done && done(this); | ||
break; | ||
@@ -29,0 +30,0 @@ } |
@@ -9,3 +9,4 @@ import * as code from 'vscode'; | ||
deprecated: boolean | undefined; | ||
insertTextMode: proto.InsertTextMode | undefined; | ||
constructor(label: string); | ||
} |
@@ -0,1 +1,2 @@ | ||
/// <reference path="../../src/common/vscode-proposed.d.ts" /> | ||
import * as code from 'vscode'; | ||
@@ -149,2 +150,5 @@ import * as ls from 'vscode-languageserver-protocol'; | ||
asCallHierarchyOutgoingCalls(items: ReadonlyArray<ls.CallHierarchyOutgoingCall> | null): code.CallHierarchyOutgoingCall[] | undefined; | ||
asOnTypeRenameRanges(value: null | undefined): undefined; | ||
asOnTypeRenameRanges(value: ls.OnTypeRenameRanges): code.OnTypeRenameRanges; | ||
asOnTypeRenameRanges(value: ls.OnTypeRenameRanges | null | undefined): code.OnTypeRenameRanges | undefined; | ||
} | ||
@@ -151,0 +155,0 @@ export interface URIConverter { |
@@ -6,2 +6,3 @@ "use strict"; | ||
* ------------------------------------------------------------------------------------------ */ | ||
/// <reference path="./vscode-proposed.d.ts" /> | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -18,2 +19,3 @@ exports.createConverter = void 0; | ||
const protocolCallHierarchyItem_1 = require("./protocolCallHierarchyItem"); | ||
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol"); | ||
var CodeBlock; | ||
@@ -28,3 +30,2 @@ (function (CodeBlock) { | ||
function createConverter(uriConverter, trustMarkdown) { | ||
trustMarkdown = !trustMarkdown; | ||
const nullConverter = (value) => code.Uri.parse(value); | ||
@@ -286,2 +287,8 @@ const _uriConverter = uriConverter || nullConverter; | ||
} | ||
if (item.insertTextMode !== undefined) { | ||
result.insertTextMode = item.insertTextMode; | ||
if (item.insertTextMode === vscode_languageserver_protocol_1.InsertTextMode.asIs) { | ||
result.keepWhitespace = true; | ||
} | ||
} | ||
return result; | ||
@@ -636,14 +643,22 @@ } | ||
if (item.documentChanges) { | ||
item.documentChanges.forEach(change => { | ||
for (const change of item.documentChanges) { | ||
if (ls.CreateFile.is(change)) { | ||
result.createFile(_uriConverter(change.uri), change.options); | ||
result.createFile(_uriConverter(change.uri), change.options, asWorkspaceEditEntryMetadata(change.annotation)); | ||
} | ||
else if (ls.RenameFile.is(change)) { | ||
result.renameFile(_uriConverter(change.oldUri), _uriConverter(change.newUri), change.options); | ||
result.renameFile(_uriConverter(change.oldUri), _uriConverter(change.newUri), change.options, asWorkspaceEditEntryMetadata(change.annotation)); | ||
} | ||
else if (ls.DeleteFile.is(change)) { | ||
result.deleteFile(_uriConverter(change.uri), change.options); | ||
result.deleteFile(_uriConverter(change.uri), change.options, asWorkspaceEditEntryMetadata(change.annotation)); | ||
} | ||
else if (ls.TextDocumentEdit.is(change)) { | ||
result.set(_uriConverter(change.textDocument.uri), asTextEdits(change.edits)); | ||
const uri = _uriConverter(change.textDocument.uri); | ||
for (const edit of change.edits) { | ||
if (vscode_languageserver_protocol_1.AnnotatedTextEdit.is(edit)) { | ||
result.replace(uri, asRange(edit.range), edit.newText, asWorkspaceEditEntryMetadata(edit.annotation)); | ||
} | ||
else { | ||
result.replace(uri, asRange(edit.range), edit.newText); | ||
} | ||
} | ||
} | ||
@@ -653,3 +668,3 @@ else { | ||
} | ||
}); | ||
} | ||
} | ||
@@ -663,2 +678,8 @@ else if (item.changes) { | ||
} | ||
function asWorkspaceEditEntryMetadata(annotation) { | ||
if (annotation === undefined) { | ||
return undefined; | ||
} | ||
return { label: annotation.label, needsConfirmation: !!annotation.needsConfirmation, description: annotation.description }; | ||
} | ||
function asDocumentLink(item) { | ||
@@ -796,2 +817,14 @@ let range = asRange(item.range); | ||
} | ||
function asOnTypeRenameRanges(value) { | ||
if (value === null || value === undefined) { | ||
return undefined; | ||
} | ||
return new code.OnTypeRenameRanges(asRanges(value.ranges), asRegularExpression(value.wordPattern)); | ||
} | ||
function asRegularExpression(value) { | ||
if (value === null || value === undefined) { | ||
return undefined; | ||
} | ||
return new RegExp(value); | ||
} | ||
return { | ||
@@ -859,3 +892,4 @@ asUri, | ||
asCallHierarchyOutgoingCall, | ||
asCallHierarchyOutgoingCalls | ||
asCallHierarchyOutgoingCalls, | ||
asOnTypeRenameRanges | ||
}; | ||
@@ -862,0 +896,0 @@ } |
@@ -12,5 +12,5 @@ import { Disposable, TextDocument, ProviderResult, Position as VPosition, SelectionRange as VSelectionRange, SelectionRangeProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
protected registerLanguageProvider(options: SelectionRangeRegistrationOptions): [Disposable, SelectionRangeProvider]; | ||
} |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
let capability = ensure(ensure(capabilites, 'textDocument'), 'selectionRange'); | ||
fillClientCapabilities(capabilities) { | ||
let capability = ensure(ensure(capabilities, 'textDocument'), 'selectionRange'); | ||
capability.dynamicRegistration = true; | ||
@@ -25,0 +25,0 @@ } |
@@ -25,5 +25,5 @@ import * as vscode from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
protected registerLanguageProvider(options: SemanticTokensRegistrationOptions): [vscode.Disposable, SemanticTokensProviders]; | ||
} |
@@ -21,4 +21,4 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
const capability = ensure(ensure(capabilites, 'textDocument'), 'semanticTokens'); | ||
fillClientCapabilities(capabilities) { | ||
const capability = ensure(ensure(capabilities, 'textDocument'), 'semanticTokens'); | ||
capability.dynamicRegistration = true; | ||
@@ -68,6 +68,8 @@ capability.tokenTypes = [ | ||
}; | ||
ensure(ensure(capabilites, 'workspace'), 'semanticTokens').refreshSupport = true; | ||
capability.multilineTokenSupport = false; | ||
capability.overlappingTokenSupport = false; | ||
ensure(ensure(capabilities, 'workspace'), 'semanticTokens').refreshSupport = true; | ||
} | ||
initialize(capabilities, documentSelector) { | ||
let client = this._client; | ||
const client = this._client; | ||
client.onRequest(vscode_languageserver_protocol_1.SemanticTokensRefreshRequest.type, async () => { | ||
@@ -74,0 +76,0 @@ for (const provider of this.getAllProviders()) { |
@@ -12,5 +12,5 @@ import { Disposable, TextDocument, ProviderResult, Position as VPosition, Definition as VDefinition, DefinitionLink as VDefinitionLink, TypeDefinitionProvider } from 'vscode'; | ||
constructor(client: BaseLanguageClient); | ||
fillClientCapabilities(capabilites: ClientCapabilities): void; | ||
fillClientCapabilities(capabilities: ClientCapabilities): void; | ||
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void; | ||
protected registerLanguageProvider(options: TypeDefinitionRegistrationOptions): [Disposable, TypeDefinitionProvider]; | ||
} |
@@ -21,5 +21,5 @@ "use strict"; | ||
} | ||
fillClientCapabilities(capabilites) { | ||
ensure(ensure(capabilites, 'textDocument'), 'typeDefinition').dynamicRegistration = true; | ||
let typeDefinitionSupport = ensure(ensure(capabilites, 'textDocument'), 'typeDefinition'); | ||
fillClientCapabilities(capabilities) { | ||
ensure(ensure(capabilities, 'textDocument'), 'typeDefinition').dynamicRegistration = true; | ||
let typeDefinitionSupport = ensure(ensure(capabilities, 'textDocument'), 'typeDefinition'); | ||
typeDefinitionSupport.dynamicRegistration = true; | ||
@@ -26,0 +26,0 @@ typeDefinitionSupport.linkSupport = true; |
@@ -30,3 +30,3 @@ "use strict"; | ||
fillInitializeParams(params) { | ||
let folders = vscode_1.workspace.workspaceFolders; | ||
const folders = vscode_1.workspace.workspaceFolders; | ||
this.initializeWithFolders(folders); | ||
@@ -48,10 +48,10 @@ if (folders === void 0) { | ||
initialize(capabilities) { | ||
let client = this._client; | ||
const client = this._client; | ||
client.onRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type, (token) => { | ||
let workspaceFolders = () => { | ||
let folders = vscode_1.workspace.workspaceFolders; | ||
if (folders === void 0) { | ||
const workspaceFolders = () => { | ||
const folders = vscode_1.workspace.workspaceFolders; | ||
if (folders === undefined) { | ||
return null; | ||
} | ||
let result = folders.map((folder) => { | ||
const result = folders.map((folder) => { | ||
return this.asProtocol(folder); | ||
@@ -61,3 +61,3 @@ }); | ||
}; | ||
let middleware = client.clientOptions.middleware.workspace; | ||
const middleware = client.clientOptions.middleware.workspace; | ||
return middleware && middleware.workspaceFolders | ||
@@ -67,3 +67,3 @@ ? middleware.workspaceFolders(token, workspaceFolders) | ||
}); | ||
let value = access(access(access(capabilities, 'workspace'), 'workspaceFolders'), 'changeNotifications'); | ||
const value = access(access(access(capabilities, 'workspace'), 'workspaceFolders'), 'changeNotifications'); | ||
let id; | ||
@@ -70,0 +70,0 @@ if (typeof value === 'string') { |
@@ -45,3 +45,3 @@ /// <reference types="node" /> | ||
* be send back and forth. If the language server is implemented in a different | ||
* programm language the server simply needs to create a connection to the | ||
* program language the server simply needs to create a connection to the | ||
* passed pipe name or port number. | ||
@@ -89,2 +89,3 @@ */ | ||
private _getServerWorkingDir; | ||
getLocale(): string; | ||
} | ||
@@ -91,0 +92,0 @@ export declare class SettingMonitor { |
@@ -30,3 +30,3 @@ "use strict"; | ||
__exportStar(require("../common/api"), exports); | ||
const REQUIRED_VSCODE_VERSION = '^1.46.0'; // do not change format, updated by `updateVSCode` script | ||
const REQUIRED_VSCODE_VERSION = '^1.51.0'; // do not change format, updated by `updateVSCode` script | ||
var Executable; | ||
@@ -443,2 +443,18 @@ (function (Executable) { | ||
} | ||
getLocale() { | ||
const envValue = process.env['VSCODE_NLS_CONFIG']; | ||
if (envValue === undefined) { | ||
return 'en'; | ||
} | ||
let config = undefined; | ||
try { | ||
config = JSON.parse(envValue); | ||
} | ||
catch (err) { | ||
} | ||
if (config === undefined || typeof config.locale !== 'string') { | ||
return 'en'; | ||
} | ||
return config.locale; | ||
} | ||
} | ||
@@ -445,0 +461,0 @@ exports.LanguageClient = LanguageClient; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "7.0.0-next.12", | ||
"version": "7.0.0-next.13", | ||
"author": "Microsoft Corporation", | ||
"license": "MIT", | ||
"engines": { | ||
"vscode": "^1.46.0" | ||
"vscode": "^1.51.0" | ||
}, | ||
@@ -25,3 +25,3 @@ "repository": { | ||
"@types/semver": "^6.0.1", | ||
"@types/vscode": "1.46.0", | ||
"@types/vscode": "1.51.0", | ||
"shx": "^0.3.2" | ||
@@ -31,3 +31,3 @@ }, | ||
"semver": "^6.3.0", | ||
"vscode-languageserver-protocol": "3.16.0-next.10" | ||
"vscode-languageserver-protocol": "3.16.0-next.11" | ||
}, | ||
@@ -34,0 +34,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
357077
70
7453
4
+ Addedvscode-languageserver-protocol@3.16.0-next.11(transitive)
+ Addedvscode-languageserver-types@3.16.0-next.5(transitive)
- Removedvscode-languageserver-protocol@3.16.0-next.10(transitive)
- Removedvscode-languageserver-types@3.16.0-next.4(transitive)