diff --git a/src/sql/sqlops.proposed.d.ts b/src/sql/sqlops.proposed.d.ts index 2bf1d16cf9..bbd5b48965 100644 --- a/src/sql/sqlops.proposed.d.ts +++ b/src/sql/sqlops.proposed.d.ts @@ -104,11 +104,11 @@ declare module 'sqlops' { /** * Sends any updated properties of the component to the UI * - * @returns {Thenable} Thenable that completes once the update + * @returns {Thenable} Thenable that completes once the update * has been applied in the UI * @memberof Component */ - updateProperties(properties: { [key: string]: any }): Thenable; + updateProperties(properties: { [key: string]: any }): Thenable; enabled: boolean; /** diff --git a/src/sql/workbench/api/node/extHostModelView.ts b/src/sql/workbench/api/node/extHostModelView.ts index db805e8130..621c45fdbf 100644 --- a/src/sql/workbench/api/node/extHostModelView.ts +++ b/src/sql/workbench/api/node/extHostModelView.ts @@ -406,12 +406,13 @@ class ComponentWrapper implements sqlops.Component { return this._proxy.$setLayout(this._handle, this.id, layout); } - public updateProperties(): Thenable { + public updateProperties(properties: { [key: string]: any }): Thenable { + this.properties = Object.assign(this.properties, properties); return this.notifyPropertyChanged(); } - protected notifyPropertyChanged(): Thenable { - return this._proxy.$setProperties(this._handle, this._id, this.properties).then(() => true); + protected notifyPropertyChanged(): Thenable { + return this._proxy.$setProperties(this._handle, this._id, this.properties); } public registerEvent(): Thenable { @@ -432,13 +433,13 @@ class ComponentWrapper implements sqlops.Component { } } - protected async setProperty(key: string, value: any): Promise { + protected async setProperty(key: string, value: any): Promise { if (!this.properties[key] || this.properties[key] !== value) { // Only notify the front end if a value has been updated this.properties[key] = value; return this.notifyPropertyChanged(); } - return Promise.resolve(true); + return Promise.resolve(); } private handleError(err: Error): void {