Expose refresh projects tree (#18890)

* refresh project tree after apply schema compare to project

* clarify comment
This commit is contained in:
Kim Santiago
2022-03-31 11:08:08 -07:00
committed by GitHub
parent 4166c622f3
commit fe0cff07d6
4 changed files with 17 additions and 0 deletions

View File

@@ -25,6 +25,10 @@ export class DataWorkspaceExtension implements IExtension {
void vscode.commands.executeCommand('dataworkspace.views.main.focus');
}
refreshProjectsTree(): void {
this.workspaceService.refreshProjectsTree();
}
get defaultProjectSaveLocation(): vscode.Uri | undefined {
return defaultProjectSaveLocation();
}

View File

@@ -33,6 +33,11 @@ declare module 'dataworkspace' {
*/
showProjectsView(): void;
/**
* Fires event to refresh the project tree. The tree is not guaranteed to be refreshed after this call returns
*/
refreshProjectsTree(): void;
/**
* Returns the default location to save projects
*/

View File

@@ -168,6 +168,13 @@ export class WorkspaceService implements IWorkspaceService {
}
}
/**
* Fire event to refresh projects tree
*/
public refreshProjectsTree(): void {
this._onDidWorkspaceProjectsChange.fire();
}
/**
* Returns an array of all the supported projects in the folder
* @param folder folder to look look for projects

View File

@@ -914,6 +914,7 @@ export class SchemaCompareMainWindow {
} else if (this.targetEndpointInfo.endpointType === mssql.SchemaCompareEndpointType.Project) {
const workspaceApi = getDataWorkspaceExtensionApi();
workspaceApi.showProjectsView();
workspaceApi.refreshProjectsTree();
void vscode.window.showInformationMessage(loc.applySuccess);
}