vscode-languageclient
Advanced tools
Comparing version 8.1.0-next.3 to 8.1.0-next.4
@@ -8,3 +8,2 @@ import { BaseLanguageClient, LanguageClientOptions, MessageTransports } from '../common/api'; | ||
protected createMessageTransports(_encoding: string): Promise<MessageTransports>; | ||
protected getLocale(): string; | ||
} |
@@ -36,8 +36,3 @@ "use strict"; | ||
} | ||
getLocale() { | ||
// ToDo: need to find a way to let the locale | ||
// travel to the worker extension host. | ||
return 'en'; | ||
} | ||
} | ||
exports.LanguageClient = LanguageClient; |
@@ -81,2 +81,9 @@ import { TextDocument, Disposable, OutputChannel, DiagnosticCollection, Diagnostic as VDiagnostic, Uri, CancellationToken, WorkspaceFolder as VWorkspaceFolder, FileCreateEvent, FileRenameEvent, FileDeleteEvent, FileWillCreateEvent, FileWillRenameEvent, FileWillDeleteEvent, CompletionItemProvider, HoverProvider, SignatureHelpProvider, DefinitionProvider, ReferenceProvider, DocumentHighlightProvider, CodeActionProvider, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, OnTypeFormattingEditProvider, RenameProvider, DocumentSymbolProvider, DocumentLinkProvider, DeclarationProvider, FoldingRangeProvider, ImplementationProvider, DocumentColorProvider, SelectionRangeProvider, TypeDefinitionProvider, CallHierarchyProvider, LinkedEditingRangeProvider, TypeHierarchyProvider, WorkspaceSymbolProvider, ProviderResult, TextEdit as VTextEdit } from 'vscode'; | ||
message?: string; | ||
/** | ||
* If set to true the client assumes that the corresponding | ||
* error handler has presented an appropriate message to the | ||
* user and the message will only be log to the client's | ||
* output channel. | ||
*/ | ||
handled?: boolean; | ||
}; | ||
@@ -105,2 +112,9 @@ /** | ||
message?: string; | ||
/** | ||
* If set to true the client assumes that the corresponding | ||
* close handler has presented an appropriate message to the | ||
* user and the message will only be log to the client's | ||
* output channel. | ||
*/ | ||
handled?: boolean; | ||
}; | ||
@@ -120,7 +134,7 @@ /** | ||
*/ | ||
error(error: Error, message: Message | undefined, count: number | undefined): ErrorHandlerResult; | ||
error(error: Error, message: Message | undefined, count: number | undefined): ErrorHandlerResult | Promise<ErrorHandlerResult>; | ||
/** | ||
* The connection to the server got closed. | ||
*/ | ||
closed(): CloseHandlerResult; | ||
closed(): CloseHandlerResult | Promise<CloseHandlerResult>; | ||
} | ||
@@ -365,7 +379,7 @@ /** | ||
private setDiagnostics; | ||
protected abstract getLocale(): string; | ||
protected getLocale(): string; | ||
protected abstract createMessageTransports(encoding: string): Promise<MessageTransports>; | ||
private $start; | ||
private createConnection; | ||
protected handleConnectionClosed(): void; | ||
protected handleConnectionClosed(): Promise<void>; | ||
private handleConnectionError; | ||
@@ -372,0 +386,0 @@ private hookConfigurationChanged; |
@@ -15,3 +15,3 @@ import * as code from 'vscode'; | ||
asChangeTextDocumentParams(textDocument: code.TextDocument): proto.DidChangeTextDocumentParams; | ||
asChangeTextDocumentParams(event: code.TextDocumentChangeEvent): proto.DidChangeTextDocumentParams; | ||
asChangeTextDocumentParams(event: code.TextDocumentChangeEvent, uri: code.Uri, version: number): proto.DidChangeTextDocumentParams; | ||
asCloseTextDocumentParams(textDocument: code.TextDocument): proto.DidCloseTextDocumentParams; | ||
@@ -18,0 +18,0 @@ asSaveTextDocumentParams(textDocument: code.TextDocument, includeContent?: boolean): proto.DidSaveTextDocumentParams; |
@@ -60,29 +60,30 @@ "use strict"; | ||
function isTextDocumentChangeEvent(value) { | ||
let candidate = value; | ||
const candidate = value; | ||
return !!candidate.document && !!candidate.contentChanges; | ||
} | ||
function isTextDocument(value) { | ||
let candidate = value; | ||
const candidate = value; | ||
return !!candidate.uri && !!candidate.version; | ||
} | ||
function asChangeTextDocumentParams(arg) { | ||
if (isTextDocument(arg)) { | ||
let result = { | ||
function asChangeTextDocumentParams(arg0, arg1, arg2) { | ||
if (isTextDocument(arg0)) { | ||
const result = { | ||
textDocument: { | ||
uri: _uriConverter(arg.uri), | ||
version: arg.version | ||
uri: _uriConverter(arg0.uri), | ||
version: arg0.version | ||
}, | ||
contentChanges: [{ text: arg.getText() }] | ||
contentChanges: [{ text: arg0.getText() }] | ||
}; | ||
return result; | ||
} | ||
else if (isTextDocumentChangeEvent(arg)) { | ||
let document = arg.document; | ||
let result = { | ||
else if (isTextDocumentChangeEvent(arg0)) { | ||
const uri = arg1; | ||
const version = arg2; | ||
const result = { | ||
textDocument: { | ||
uri: _uriConverter(document.uri), | ||
version: document.version | ||
uri: _uriConverter(uri), | ||
version: version | ||
}, | ||
contentChanges: arg.contentChanges.map((change) => { | ||
let range = change.range; | ||
contentChanges: arg0.contentChanges.map((change) => { | ||
const range = change.range; | ||
return { | ||
@@ -89,0 +90,0 @@ range: { |
@@ -218,3 +218,3 @@ "use strict"; | ||
if (selector) { | ||
return [id, Object.assign({}, capability, { documentSelector: selector })]; | ||
return [id, Object.assign({}, { documentSelector: selector }, capability)]; | ||
} | ||
@@ -226,3 +226,3 @@ } | ||
} | ||
let options = (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, capability, { documentSelector })); | ||
const options = (Is.boolean(capability) && capability === true ? { documentSelector } : Object.assign({}, { documentSelector }, capability)); | ||
return [UUID.generateUuid(), options]; | ||
@@ -229,0 +229,0 @@ } |
@@ -107,3 +107,3 @@ "use strict"; | ||
function asTextContentChange(event, base) { | ||
const params = base.asChangeTextDocumentParams(event); | ||
const params = base.asChangeTextDocumentParams(event, event.document.uri, event.document.version); | ||
return { document: params.textDocument, changes: params.contentChanges }; | ||
@@ -110,0 +110,0 @@ } |
@@ -167,2 +167,6 @@ "use strict"; | ||
} | ||
// We need to capture the URI and version here since they might change on the text document | ||
// until we reach did `didChange` call since the middleware support async execution. | ||
const uri = event.document.uri; | ||
const version = event.document.version; | ||
const promises = []; | ||
@@ -174,3 +178,3 @@ for (const changeData of this._changeData.values()) { | ||
const didChange = async (event) => { | ||
const params = this._client.code2ProtocolConverter.asChangeTextDocumentParams(event); | ||
const params = this._client.code2ProtocolConverter.asChangeTextDocumentParams(event, uri, version); | ||
await this._client.sendNotification(vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params); | ||
@@ -177,0 +181,0 @@ this.notificationSent(event.document, vscode_languageserver_protocol_1.DidChangeTextDocumentNotification.type, params); |
@@ -86,3 +86,3 @@ /// <reference types="node" /> | ||
private checkProcessDied; | ||
protected handleConnectionClosed(): void; | ||
protected handleConnectionClosed(): Promise<void>; | ||
protected fillInitializeParams(params: InitializeParams): void; | ||
@@ -93,3 +93,2 @@ protected createMessageTransports(encoding: string): Promise<MessageTransports>; | ||
private _getServerWorkingDir; | ||
getLocale(): string; | ||
} | ||
@@ -96,0 +95,0 @@ export declare class SettingMonitor { |
@@ -180,3 +180,3 @@ "use strict"; | ||
this._serverProcess = undefined; | ||
super.handleConnectionClosed(); | ||
return super.handleConnectionClosed(); | ||
} | ||
@@ -517,18 +517,2 @@ fillInitializeParams(params) { | ||
} | ||
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; | ||
} | ||
} | ||
@@ -535,0 +519,0 @@ exports.LanguageClient = LanguageClient; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "8.1.0-next.3", | ||
"version": "8.1.0-next.4", | ||
"author": "Microsoft Corporation", | ||
@@ -33,3 +33,3 @@ "license": "MIT", | ||
"semver": "^7.3.7", | ||
"vscode-languageserver-protocol": "3.17.3-next.3" | ||
"vscode-languageserver-protocol": "3.17.3-next.4" | ||
}, | ||
@@ -36,0 +36,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
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
3
630848
12600
+ Addedvscode-jsonrpc@8.1.0-next.5(transitive)
+ Addedvscode-languageserver-protocol@3.17.3-next.4(transitive)
- Removedvscode-jsonrpc@8.1.0-next.4(transitive)
- Removedvscode-languageserver-protocol@3.17.3-next.3(transitive)