explorer - update context keys for workspace related actions
//cc @JacksonKearl @isidorn
This commit is contained in:
parent
1b72b188f9
commit
ac32d7d0a0
|
@ -21,7 +21,7 @@ import { AutoSaveAfterShortDelayContext } from 'vs/workbench/services/filesConfi
|
|||
import { ResourceContextKey } from 'vs/workbench/common/resources';
|
||||
import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, HasWebFileSystemAccess, WorkspaceFolderCountContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, WorkbenchStateContext, WorkspaceFolderCountContext } from 'vs/workbench/browser/contextkeys';
|
||||
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ActiveEditorCanRevertContext, ActiveEditorContext } from 'vs/workbench/common/editor';
|
||||
|
@ -526,7 +526,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|||
id: ADD_ROOT_FOLDER_COMMAND_ID,
|
||||
title: ADD_ROOT_FOLDER_LABEL
|
||||
},
|
||||
when: ExplorerRootContext
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, ContextKeyExpr.or(EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext.isEqualTo('workspace')))
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
|
@ -536,7 +536,7 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
|||
id: REMOVE_ROOT_FOLDER_COMMAND_ID,
|
||||
title: REMOVE_ROOT_FOLDER_LABEL
|
||||
},
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext)
|
||||
when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext, ContextKeyExpr.and(WorkspaceFolderCountContext.notEqualsTo('0'), ContextKeyExpr.or(EnterMultiRootWorkspaceSupportContext, WorkbenchStateContext.isEqualTo('workspace'))))
|
||||
});
|
||||
|
||||
MenuRegistry.appendMenuItem(MenuId.ExplorerContext, {
|
||||
|
|
Loading…
Reference in a new issue