vscode-languageclient
Advanced tools
Comparing version 0.10.0-pre.11 to 0.10.0-pre.12
@@ -33,3 +33,3 @@ import * as cp from 'child_process'; | ||
} | ||
export interface ClientCustomization { | ||
export interface ClientOptions { | ||
server: Executable | { | ||
@@ -48,3 +48,3 @@ run: Executable; | ||
private _name; | ||
private _customization; | ||
private _options; | ||
private _forceDebug; | ||
@@ -61,3 +61,3 @@ private _state; | ||
private _delayer; | ||
constructor(name: string, customization: ClientCustomization, forceDebug?: boolean); | ||
constructor(name: string, options: ClientOptions, forceDebug?: boolean); | ||
sendRequest<P, R, E>(type: RequestType<P, R, E>, params?: P): Thenable<R>; | ||
@@ -87,8 +87,9 @@ sendNotification<P>(type: NotificationType<P>, params?: P): void; | ||
} | ||
export declare class ClientController { | ||
export declare class ClientStarter { | ||
private _client; | ||
private _setting; | ||
private _disposables; | ||
constructor(_client: LanguageClient, _setting: string); | ||
constructor(_client: LanguageClient); | ||
watchSetting(setting: string): void; | ||
private onDidChangeConfiguration(); | ||
} |
@@ -61,7 +61,7 @@ /*--------------------------------------------------------- | ||
var LanguageClient = (function () { | ||
function LanguageClient(name, customization, forceDebug) { | ||
function LanguageClient(name, options, forceDebug) { | ||
var _this = this; | ||
if (forceDebug === void 0) { forceDebug = false; } | ||
this._name = name; | ||
this._customization = customization; | ||
this._options = options; | ||
this._forceDebug = forceDebug; | ||
@@ -216,3 +216,3 @@ this._state = ClientState.Stopped; | ||
LanguageClient.prototype.onDidOpenTextDoument = function (connection, textDocument) { | ||
if (!this._customization.syncTextDocument(textDocument)) { | ||
if (!this._options.syncTextDocument(textDocument)) { | ||
return; | ||
@@ -223,3 +223,3 @@ } | ||
LanguageClient.prototype.onDidChangeTextDocument = function (connection, event) { | ||
if (!this._customization.syncTextDocument(event.document)) { | ||
if (!this._options.syncTextDocument(event.document)) { | ||
return; | ||
@@ -236,3 +236,3 @@ } | ||
LanguageClient.prototype.onDidCloseTextDoument = function (connection, textDocument) { | ||
if (!this._customization.syncTextDocument(textDocument)) { | ||
if (!this._options.syncTextDocument(textDocument)) { | ||
return; | ||
@@ -252,3 +252,3 @@ } | ||
var _this = this; | ||
var server = this._customization.server; | ||
var server = this._options.server; | ||
// We got a function. | ||
@@ -321,3 +321,3 @@ if (is.func(server)) { | ||
var _this = this; | ||
if (!this._customization.configuration) { | ||
if (!this._options.configuration) { | ||
return; | ||
@@ -331,7 +331,7 @@ } | ||
var keys = null; | ||
if (is.string(this._customization.configuration)) { | ||
keys = [this._customization.configuration]; | ||
if (is.string(this._options.configuration)) { | ||
keys = [this._options.configuration]; | ||
} | ||
else if (is.stringArray(this._customization.configuration)) { | ||
keys = this._customization.configuration; | ||
else if (is.stringArray(this._options.configuration)) { | ||
keys = this._options.configuration; | ||
} | ||
@@ -384,11 +384,11 @@ if (keys) { | ||
var _this = this; | ||
if (!this._customization.fileWatchers) { | ||
if (!this._options.fileWatchers) { | ||
return; | ||
} | ||
var watchers = null; | ||
if (is.array(this._customization.fileWatchers)) { | ||
watchers = this._customization.fileWatchers; | ||
if (is.array(this._options.fileWatchers)) { | ||
watchers = this._options.fileWatchers; | ||
} | ||
else { | ||
watchers = [this._customization.fileWatchers]; | ||
watchers = [this._options.fileWatchers]; | ||
} | ||
@@ -416,14 +416,20 @@ if (!watchers) { | ||
exports.LanguageClient = LanguageClient; | ||
var ClientController = (function () { | ||
function ClientController(_client, _setting) { | ||
var ClientStarter = (function () { | ||
function ClientStarter(_client) { | ||
this._client = _client; | ||
this._setting = _setting; | ||
this._disposables = []; | ||
} | ||
ClientStarter.prototype.watchSetting = function (setting) { | ||
this._setting = setting; | ||
vscode_1.extensions.onDidChangeConfiguration(this.onDidChangeConfiguration, this, this._disposables); | ||
this.onDidChangeConfiguration(); | ||
} | ||
ClientController.prototype.onDidChangeConfiguration = function () { | ||
}; | ||
ClientStarter.prototype.onDidChangeConfiguration = function () { | ||
var _this = this; | ||
var memento = vscode_1.extensions.getConfigurationMemento(this._setting); | ||
memento.getValue('enable', false).then(function (enabled) { | ||
var index = this._setting.indexOf('.'); | ||
var primary = index >= 0 ? this._setting.substr(0, index) : this._setting; | ||
var rest = index >= 0 ? this._setting.substr(index + 1) : undefined; | ||
var memento = vscode_1.extensions.getConfigurationMemento(primary); | ||
var valuePromise = rest ? memento.getValue(rest, false) : memento.getValues(); | ||
valuePromise.then(function (enabled) { | ||
if (enabled && _this._client.needsStart()) { | ||
@@ -437,4 +443,4 @@ _this._client.start(); | ||
}; | ||
return ClientController; | ||
return ClientStarter; | ||
})(); | ||
exports.ClientController = ClientController; | ||
exports.ClientStarter = ClientStarter; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "0.10.0-pre.11", | ||
"version": "0.10.0-pre.12", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
53291
1335