Scoping of project context menu items based on node type (#10902)

* Remove context menu items from files

* More changes for context menu and adding test

* change to initiate build
This commit is contained in:
Udeesha Gautam
2020-06-12 17:00:51 -07:00
committed by GitHub
parent 960aa14027
commit 70f65f45b5
8 changed files with 53 additions and 21 deletions

View File

@@ -8,6 +8,7 @@ import * as path from 'path';
import { BaseProjectTreeItem } from './baseTreeItem';
import { ProjectRootTreeItem } from './projectTreeItem';
import { Project } from '../project';
import { DatabaseProjectItemType } from '../../common/constants';
/**
* Node representing a folder in a project
@@ -26,7 +27,9 @@ export class FolderNode extends BaseProjectTreeItem {
}
public get treeItem(): vscode.TreeItem {
return new vscode.TreeItem(this.uri, vscode.TreeItemCollapsibleState.Expanded);
const folderItem = new vscode.TreeItem(this.uri, vscode.TreeItemCollapsibleState.Expanded);
folderItem.contextValue = DatabaseProjectItemType.folder;
return folderItem;
}
public get project(): Project {
@@ -58,7 +61,7 @@ export class FileNode extends BaseProjectTreeItem {
arguments: [this.fileSystemUri]
};
treeItem.contextValue = 'File';
treeItem.contextValue = DatabaseProjectItemType.file;
return treeItem;
}