mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 09:35:36 -05:00
Add "Open Containing Folder" to project context menu (#11187)
* add command to open the folder the project is in * move commands to constants
This commit is contained in:
@@ -96,7 +96,7 @@ export class ProjectsController {
|
||||
|
||||
public async focusProject(project?: Project): Promise<void> {
|
||||
if (project && this.projects.includes(project)) {
|
||||
await this.apiWrapper.executeCommand('sqlDatabaseProjectsView.focus');
|
||||
await this.apiWrapper.executeCommand(constants.sqlDatabaseProjectsViewFocusCommand);
|
||||
await this.projectTreeViewProvider.focus(project);
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,7 @@ export class ProjectsController {
|
||||
|
||||
// check that dacpac exists
|
||||
if (await utils.exists(dacpacPath)) {
|
||||
this.apiWrapper.executeCommand('schemaCompare.start', dacpacPath);
|
||||
this.apiWrapper.executeCommand(constants.schemaCompareStartCommand, dacpacPath);
|
||||
} else {
|
||||
this.apiWrapper.showErrorMessage(constants.buildDacpacNotFound);
|
||||
}
|
||||
@@ -346,7 +346,7 @@ export class ProjectsController {
|
||||
|
||||
const newEntry = await project.addScriptItem(relativeFilePath, newFileText);
|
||||
|
||||
this.apiWrapper.executeCommand('vscode.open', newEntry.fsUri);
|
||||
this.apiWrapper.executeCommand(constants.vscodeOpenCommand, newEntry.fsUri);
|
||||
|
||||
this.refreshProjectsTree();
|
||||
} catch (err) {
|
||||
@@ -400,6 +400,15 @@ export class ProjectsController {
|
||||
return project.files.find(x => utils.getPlatformSafeFileEntryPath(x.relativePath) === utils.getPlatformSafeFileEntryPath(utils.trimUri(context.root.uri, context.uri)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens the folder containing the project
|
||||
* @param context a treeItem in a project's hierarchy, to be used to obtain a Project
|
||||
*/
|
||||
public async openContainingFolder(context: BaseProjectTreeItem): Promise<void> {
|
||||
const project = this.getProjectFromContext(context);
|
||||
await this.apiWrapper.executeCommand(constants.revealFileInOsCommand, Uri.file(project.projectFilePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a database reference to the project
|
||||
* @param context a treeItem in a project's hierarchy, to be used to obtain a Project
|
||||
|
||||
Reference in New Issue
Block a user