Focus database projects view after open/import (#10760)

This commit is contained in:
Benjin Dubishar
2020-06-09 09:42:52 -07:00
committed by GitHub
parent 59575aa305
commit 02598621c3
4 changed files with 38 additions and 8 deletions

View File

@@ -93,6 +93,13 @@ export class ProjectsController {
return newProject;
}
public async focusProject(project?: Project) {
if (project && this.projects.includes(project)) {
await this.apiWrapper.executeCommand('sqlDatabaseProjectsView.focus');
this.projectTreeViewProvider.focus(project);
}
}
public async createNewProject(newProjName: string, folderUri: Uri, projectGuid?: string): Promise<string> {
if (projectGuid && !UUID.isUUID(projectGuid)) {
throw new Error(`Specified GUID is invalid: '${projectGuid}'`);
@@ -230,11 +237,6 @@ export class ProjectsController {
}
}
public async import(treeNode: BaseProjectTreeItem) {
const project = ProjectsController.getProjectFromContext(treeNode);
await this.apiWrapper.showErrorMessage(`Import not yet implemented: ${project.projectFilePath}`); // TODO
}
public async addFolderPrompt(treeNode: BaseProjectTreeItem) {
const project = ProjectsController.getProjectFromContext(treeNode);
const newFolderName = await this.promptForNewObjectName(new templates.ProjectScriptType(templates.folder, constants.folderFriendlyName, ''), project);
@@ -542,6 +544,8 @@ export class ProjectsController {
//Refresh project to show the added files
this.refreshProjectsTree();
this.focusProject(project);
}
catch (err) {
this.apiWrapper.showErrorMessage(utils.getErrorMessage(err));