vscode-languageclient
Advanced tools
Comparing version 10.0.0-next.3 to 10.0.0-next.4
import { BaseLanguageClient, LanguageClientOptions, MessageTransports } from '../common/api'; | ||
export * from 'vscode-languageserver-protocol/browser'; | ||
export * from '../common/api'; | ||
export type ServerOptions = Worker | (() => Promise<Worker | MessageTransports>); | ||
export declare class LanguageClient extends BaseLanguageClient { | ||
private readonly worker; | ||
constructor(id: string, name: string, clientOptions: LanguageClientOptions, worker: Worker); | ||
private readonly options; | ||
constructor(id: string, name: string, clientOptions: LanguageClientOptions, options: ServerOptions); | ||
protected createMessageTransports(_encoding: string): Promise<MessageTransports>; | ||
private createMessageTransportsFromWorker; | ||
} |
@@ -27,9 +27,23 @@ "use strict"; | ||
class LanguageClient extends api_1.BaseLanguageClient { | ||
constructor(id, name, clientOptions, worker) { | ||
constructor(id, name, clientOptions, options) { | ||
super(id, name, clientOptions); | ||
this.worker = worker; | ||
this.options = options; | ||
} | ||
createMessageTransports(_encoding) { | ||
const reader = new browser_1.BrowserMessageReader(this.worker); | ||
const writer = new browser_1.BrowserMessageWriter(this.worker); | ||
async createMessageTransports(_encoding) { | ||
if (typeof this.options === 'function') { | ||
const result = await this.options(); | ||
if (result instanceof Worker) { | ||
return this.createMessageTransportsFromWorker(result); | ||
} | ||
else { | ||
return result; | ||
} | ||
} | ||
else { | ||
return this.createMessageTransportsFromWorker(this.options); | ||
} | ||
} | ||
createMessageTransportsFromWorker(worker) { | ||
const reader = new browser_1.BrowserMessageReader(worker); | ||
const writer = new browser_1.BrowserMessageWriter(worker); | ||
return Promise.resolve({ reader, writer }); | ||
@@ -36,0 +50,0 @@ } |
@@ -153,2 +153,6 @@ 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, ImplementationProvider, DocumentColorProvider, SelectionRangeProvider, TypeDefinitionProvider, CallHierarchyProvider, LinkedEditingRangeProvider, TypeHierarchyProvider, WorkspaceSymbolProvider, ProviderResult, TextEdit as VTextEdit, InlineCompletionItemProvider } from 'vscode'; | ||
/** | ||
* The start has failed. | ||
*/ | ||
StartFailed = 4, | ||
/** | ||
* The client is running and ready. | ||
@@ -480,2 +484,8 @@ */ | ||
} | ||
export type ServerOptions = () => Promise<MessageTransports>; | ||
export declare class LanguageClient extends BaseLanguageClient { | ||
private readonly options; | ||
constructor(id: string, name: string, clientOptions: LanguageClientOptions, options: ServerOptions); | ||
protected createMessageTransports(_encoding: string): Promise<MessageTransports>; | ||
} | ||
export declare namespace ProposedFeatures { | ||
@@ -482,0 +492,0 @@ function createAll(_client: FeatureClient<Middleware, LanguageClientOptions>): (StaticFeature | DynamicFeature<any>)[]; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "10.0.0-next.3", | ||
"version": "10.0.0-next.4", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
662485
13219