Add collapse project tree setting (#20064)

* Add sql projects setting to start with all project trees collapsed

* cleanup

* update string

* update string again
This commit is contained in:
Kim Santiago
2022-07-18 17:04:39 -07:00
committed by GitHub
parent 77e7a90c20
commit d418d7c01b
4 changed files with 11 additions and 2 deletions

View File

@@ -11,10 +11,11 @@ import * as fileTree from './fileFolderTreeItem';
import { Project } from '../project';
import * as utils from '../../common/utils';
import { DatabaseReferencesTreeItem } from './databaseReferencesTreeItem';
import { DatabaseProjectItemType, RelativeOuterPath, ExternalStreamingJob, sqlprojExtension } from '../../common/constants';
import { DatabaseProjectItemType, RelativeOuterPath, ExternalStreamingJob, sqlprojExtension, CollapseProjectNodesKey } from '../../common/constants';
import { IconPathHelper } from '../../common/iconHelper';
import { FileProjectEntry } from '../projectEntry';
import { EntryType } from 'sqldbproj';
import { DBProjectConfigurationKey } from '../../tools/netcoreTool';
/**
* TreeNode root that represents an entire project
@@ -47,7 +48,8 @@ export class ProjectRootTreeItem extends BaseProjectTreeItem {
}
public get treeItem(): vscode.TreeItem {
const projectItem = new vscode.TreeItem(this.fileSystemUri, vscode.TreeItemCollapsibleState.Expanded);
const collapsibleState = vscode.workspace.getConfiguration(DBProjectConfigurationKey)[CollapseProjectNodesKey] ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.Expanded;
const projectItem = new vscode.TreeItem(this.fileSystemUri, collapsibleState);
projectItem.contextValue = this.project.isSdkStyleProject ? DatabaseProjectItemType.project : DatabaseProjectItemType.legacyProject;
projectItem.iconPath = IconPathHelper.databaseProject;
projectItem.label = path.basename(this.projectUri.fsPath, sqlprojExtension);