mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 01:25:36 -05:00
Move protocol client out (#643)
* close * connection is working * formatting * adds all * formatting * formatting and changing how features are initialized * formatting * changed named of typings file * update * updated to use dataprotocol npm * formatting * removed unneeded logging * readd npm shrinkwrap * still not working * removed unnecessary codfe * addressed comments * readded azure resource provider * fix capabilities cacheing * added backwards capat for older protocol * update shrinkwrap * update shrinkwrap * updated shrinkwrap * fixed tests * removed dead code * remove dead code * fix compile * remove backcompat stuff * change location of npm * vbump sqltools * merge master * fix imports * fix build breaks * update for sqlops * update yarn dependencies
This commit is contained in:
@@ -11,9 +11,9 @@ import { Emitter } from 'vs/base/common/event';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as data from 'data';
|
||||
import * as sqlops from 'sqlops';
|
||||
|
||||
class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
class ExtHostDashboardWebview implements sqlops.DashboardWebview {
|
||||
|
||||
private _html: string;
|
||||
public onMessageEmitter = new Emitter<any>();
|
||||
@@ -22,8 +22,8 @@ class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
constructor(
|
||||
private readonly _proxy: MainThreadDashboardWebviewShape,
|
||||
private readonly _handle: number,
|
||||
private readonly _connection: data.connection.Connection,
|
||||
private readonly _serverInfo: data.ServerInfo
|
||||
private readonly _connection: sqlops.connection.Connection,
|
||||
private readonly _serverInfo: sqlops.ServerInfo
|
||||
) { }
|
||||
|
||||
public postMessage(message: any): Thenable<any> {
|
||||
@@ -38,11 +38,11 @@ class ExtHostDashboardWebview implements data.DashboardWebview {
|
||||
return this.onClosedEmitter.event;
|
||||
}
|
||||
|
||||
public get connection(): data.connection.Connection {
|
||||
public get connection(): sqlops.connection.Connection {
|
||||
return deepClone(this._connection);
|
||||
}
|
||||
|
||||
public get serverInfo(): data.ServerInfo {
|
||||
public get serverInfo(): sqlops.ServerInfo {
|
||||
return deepClone(this._serverInfo);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ export class ExtHostDashboardWebviews implements ExtHostDashboardWebviewsShape {
|
||||
private readonly _proxy: MainThreadDashboardWebviewShape;
|
||||
|
||||
private readonly _webviews = new Map<number, ExtHostDashboardWebview>();
|
||||
private readonly _handlers = new Map<string, (webview: data.DashboardWebview) => void>();
|
||||
private readonly _handlers = new Map<string, (webview: sqlops.DashboardWebview) => void>();
|
||||
|
||||
constructor(
|
||||
mainContext: IMainContext
|
||||
@@ -81,12 +81,12 @@ export class ExtHostDashboardWebviews implements ExtHostDashboardWebviewsShape {
|
||||
this._webviews.delete(handle);
|
||||
}
|
||||
|
||||
$registerProvider(widgetId: string, handler: (webview: data.DashboardWebview) => void): void {
|
||||
$registerProvider(widgetId: string, handler: (webview: sqlops.DashboardWebview) => void): void {
|
||||
this._handlers.set(widgetId, handler);
|
||||
this._proxy.$registerProvider(widgetId);
|
||||
}
|
||||
|
||||
$registerWidget(handle: number, id: string, connection: data.connection.Connection, serverInfo: data.ServerInfo): void {
|
||||
$registerWidget(handle: number, id: string, connection: sqlops.connection.Connection, serverInfo: sqlops.ServerInfo): void {
|
||||
let webview = new ExtHostDashboardWebview(this._proxy, handle, connection, serverInfo);
|
||||
this._webviews.set(handle, webview);
|
||||
this._handlers.get(id)(webview);
|
||||
|
||||
Reference in New Issue
Block a user