mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-15 17:22:25 -05:00
Database Projects - Add existing file (#18066)
* Add existing file to sqlproj * Address PR comments * Fix failing test * Add convertSlashesForSqlProj to test failure
This commit is contained in:
@@ -651,6 +651,29 @@ export class ProjectsController {
|
||||
}
|
||||
}
|
||||
|
||||
public async addExistingItemPrompt(treeNode: dataworkspace.WorkspaceTreeItem): Promise<void> {
|
||||
const project = this.getProjectFromContext(treeNode);
|
||||
|
||||
const uris = await vscode.window.showOpenDialog({
|
||||
canSelectFiles: true,
|
||||
canSelectFolders: false,
|
||||
canSelectMany: false,
|
||||
openLabel: constants.selectString,
|
||||
title: constants.selectFileString
|
||||
});
|
||||
|
||||
if (!uris) {
|
||||
return; // user cancelled
|
||||
}
|
||||
|
||||
try {
|
||||
await project.addExistingItem(uris[0].fsPath);
|
||||
this.refreshProjectsTree(treeNode);
|
||||
} catch (err) {
|
||||
void vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
}
|
||||
}
|
||||
|
||||
public async exclude(context: dataworkspace.WorkspaceTreeItem): Promise<void> {
|
||||
const node = context.element as BaseProjectTreeItem;
|
||||
const project = this.getProjectFromContext(node);
|
||||
|
||||
Reference in New Issue
Block a user