Skip to content

Commit

Permalink
Only show "New File/Folder" on folders (#11453)
Browse files Browse the repository at this point in the history
  • Loading branch information
msujew authored Jul 25, 2022
1 parent 58b2240 commit f980ff1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/navigator/src/browser/navigator-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,12 @@ export class FileNavigatorContribution extends AbstractViewContribution<FileNavi
});

registry.registerMenuAction(NavigatorContextMenu.NAVIGATION, {
commandId: WorkspaceCommands.NEW_FILE.id
commandId: WorkspaceCommands.NEW_FILE.id,
when: 'explorerResourceIsFolder'
});
registry.registerMenuAction(NavigatorContextMenu.NAVIGATION, {
commandId: WorkspaceCommands.NEW_FOLDER.id
commandId: WorkspaceCommands.NEW_FOLDER.id,
when: 'explorerResourceIsFolder'
});
registry.registerMenuAction(NavigatorContextMenu.COMPARE, {
commandId: WorkspaceCommands.FILE_COMPARE.id
Expand Down

0 comments on commit f980ff1

Please sign in to comment.