vscode-languageclient
Advanced tools
Comparing version 0.10.0-pre.9 to 0.10.0-pre.10
import * as cp from 'child_process'; | ||
import ChildProcess = cp.ChildProcess; | ||
import { TextDocument, FileSystemWatcher } from 'vscode'; | ||
import { INotificationHandler } from 'vscode-jsonrpc'; | ||
import { InitializeParams, InitializeResult, ShutdownParams, ExitParams, LogMessageParams, ShowMessageParams, DidChangeConfigurationParams, DidOpenTextDocumentParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, DidChangeFilesParams, FileEvent, PublishDiagnosticsParams } from './protocol'; | ||
export interface IConnection { | ||
initialize(params: InitializeParams): Thenable<InitializeResult>; | ||
shutdown(params: ShutdownParams): Thenable<void>; | ||
exit(params: ExitParams): void; | ||
onLogMessage(handle: INotificationHandler<LogMessageParams>): void; | ||
onShowMessage(handler: INotificationHandler<ShowMessageParams>): void; | ||
didChangeConfiguration(params: DidChangeConfigurationParams): void; | ||
didChangeFiles(params: DidChangeFilesParams): void; | ||
didOpenTextDocument(params: DidOpenTextDocumentParams): void; | ||
didChangeTextDocument(params: DidChangeTextDocumentParams): void; | ||
didCloseTextDocument(params: DidCloseTextDocumentParams): void; | ||
onDiagnostics(handler: INotificationHandler<PublishDiagnosticsParams>): void; | ||
dispose(): void; | ||
} | ||
export declare function createConnection(inputStream: NodeJS.ReadableStream, outputStream: NodeJS.WritableStream): IConnection; | ||
import { INotificationHandler, RequestType, NotificationType } from 'vscode-jsonrpc'; | ||
import { FileEvent } from './protocol'; | ||
export interface StreamInfo { | ||
@@ -74,2 +59,5 @@ writer: NodeJS.WritableStream; | ||
constructor(name: string, customization: ClientCustomization, forceDebug?: boolean); | ||
sendRequest<P, R, E>(type: RequestType<P, R, E>, params?: P): Thenable<R>; | ||
sendNotification<P>(type: NotificationType<P>, params?: P): void; | ||
onNotification<P>(type: NotificationType<P>, handler: INotificationHandler<P>): void; | ||
needsStart(): boolean; | ||
@@ -76,0 +64,0 @@ needsStop(): boolean; |
@@ -35,2 +35,5 @@ /*--------------------------------------------------------- | ||
var result = { | ||
sendRequest: function (type, params) { return connection.sendRequest(type, params); }, | ||
sendNotification: function (type, params) { return connection.sendNotification(type, params); }, | ||
onNotification: function (type, handler) { return connection.onNotification(type, handler); }, | ||
initialize: function (params) { return connection.sendRequest(protocol_1.InitializeRequest.type, params); }, | ||
@@ -51,3 +54,2 @@ shutdown: function (params) { return connection.sendRequest(protocol_1.ShutdownRequest.type, params); }, | ||
} | ||
exports.createConnection = createConnection; | ||
var ClientState; | ||
@@ -78,2 +80,33 @@ (function (ClientState) { | ||
} | ||
LanguageClient.prototype.sendRequest = function (type, params) { | ||
var _this = this; | ||
return this.onReady().then(function () { | ||
return _this.resolveConnection().then(function (connection) { | ||
if (_this.isConnectionActive()) { | ||
return connection.sendRequest(type, params); | ||
} | ||
else { | ||
return Promise.reject(new vscode_jsonrpc_1.ResponseError(vscode_jsonrpc_1.ErrorCodes.InternalError, 'Connection is already closed')); | ||
} | ||
}); | ||
}); | ||
}; | ||
LanguageClient.prototype.sendNotification = function (type, params) { | ||
var _this = this; | ||
this.onReady().then(function () { | ||
_this.resolveConnection().then(function (connection) { | ||
if (_this.isConnectionActive()) { | ||
connection.sendNotification(type, params); | ||
} | ||
}); | ||
}); | ||
}; | ||
LanguageClient.prototype.onNotification = function (type, handler) { | ||
var _this = this; | ||
this.onReady().then(function () { | ||
_this.resolveConnection().then(function (connection) { | ||
connection.onNotification(type, handler); | ||
}); | ||
}); | ||
}; | ||
LanguageClient.prototype.needsStart = function () { | ||
@@ -80,0 +113,0 @@ return this._state === ClientState.Stopping || this._state === ClientState.Stopped; |
{ | ||
"name": "vscode-languageclient", | ||
"description": "VSCode Language client implementation", | ||
"version": "0.10.0-pre.9", | ||
"version": "0.10.0-pre.10", | ||
"author": "Microsoft Corporation", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
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
53009
1327