mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Creating a new database project, project items
* can create, open, and close sqlproj files * can add sql objects to projects
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
import * as vscode from 'vscode';
|
||||
import * as constants from '../common/constants';
|
||||
|
||||
import { BaseProjectTreeItem, MessageTreeItem } from '../models/tree/baseTreeItem';
|
||||
import { BaseProjectTreeItem, MessageTreeItem, SpacerTreeItem } from '../models/tree/baseTreeItem';
|
||||
import { ProjectRootTreeItem } from '../models/tree/projectTreeItem';
|
||||
import { Project } from '../models/project';
|
||||
|
||||
@@ -39,16 +39,20 @@ export class SqlDatabaseProjectTreeViewProvider implements vscode.TreeDataProvid
|
||||
return element.children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new set of root nodes from a list of Projects
|
||||
* @param projects List of Projects
|
||||
*/
|
||||
public load(projects: Project[]) {
|
||||
if (projects.length === 0) {
|
||||
vscode.window.showErrorMessage(constants.noSqlProjFiles);
|
||||
return;
|
||||
}
|
||||
|
||||
let newRoots: BaseProjectTreeItem[] = [];
|
||||
|
||||
for (const proj of projects) {
|
||||
newRoots.push(new ProjectRootTreeItem(proj));
|
||||
newRoots.push(SpacerTreeItem);
|
||||
}
|
||||
|
||||
if (newRoots[newRoots.length - 1] === SpacerTreeItem) {
|
||||
newRoots.pop(); // get rid of the trailing SpacerTreeItem
|
||||
}
|
||||
|
||||
this.roots = newRoots;
|
||||
|
||||
Reference in New Issue
Block a user