mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user