mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 17:22:29 -05:00
Add OE node refresh API method (#2578)
* Initial working commit for refreshing OE node via API * Add test and fix up code * Run tsfmt * Fix test
This commit is contained in:
committed by
Karl Burtram
parent
36f7c283b8
commit
05040425df
@@ -9,7 +9,7 @@ import { ExtHostObjectExplorerShape, SqlMainContext, MainThreadObjectExplorerSha
|
||||
import * as sqlops from 'sqlops';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostObjectExplorer implements ExtHostObjectExplorerShape {
|
||||
export class ExtHostObjectExplorer implements ExtHostObjectExplorerShape {
|
||||
|
||||
private _proxy: MainThreadObjectExplorerShape;
|
||||
|
||||
@@ -44,7 +44,7 @@ class ExtHostObjectExplorerNode implements sqlops.objectexplorer.ObjectExplorerN
|
||||
public errorMessage: string;
|
||||
|
||||
constructor(nodeInfo: sqlops.NodeInfo, connectionId: string, private _proxy: MainThreadObjectExplorerShape) {
|
||||
Object.entries(nodeInfo).forEach(([key, value]) => this[key] = value);
|
||||
this.getDetailsFromInfo(nodeInfo);
|
||||
this.connectionId = connectionId;
|
||||
}
|
||||
|
||||
@@ -71,4 +71,12 @@ class ExtHostObjectExplorerNode implements sqlops.objectexplorer.ObjectExplorerN
|
||||
}
|
||||
return this._proxy.$getNode(this.connectionId, this.nodePath.slice(0, parentPathEndIndex)).then(nodeInfo => nodeInfo ? new ExtHostObjectExplorerNode(nodeInfo, this.connectionId, this._proxy) : undefined);
|
||||
}
|
||||
|
||||
refresh(): Thenable<void> {
|
||||
return this._proxy.$refresh(this.connectionId, this.nodePath).then(nodeInfo => this.getDetailsFromInfo(nodeInfo));
|
||||
}
|
||||
|
||||
private getDetailsFromInfo(nodeInfo: sqlops.NodeInfo): void {
|
||||
Object.entries(nodeInfo).forEach(([key, value]) => this[key] = value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user