Sometimes, the Exlopre didn’t opened automatically, so I need to click the View->Explore to show the Explore. I try to run this.commandRegistry.executeCommand(“View:Explore”); in my code, but it didn’t work, it seems it’s not the right command, so what’s the right command to open the explore?
@LamYunfu for views, you can search the code for what their id
is for the toggleCommandId
:
export const MODIFICATION = [...NAVIGATOR_CONTEXT_MENU, '7_modification'];
/** @deprecated use MODIFICATION */
export const MOVE = MODIFICATION;
/** @deprecated use MODIFICATION */
export const ACTIONS = MODIFICATION;
export const OPEN_WITH = [...NAVIGATION, 'open_with'];
}
export const FILE_NAVIGATOR_TOGGLE_COMMAND_ID = 'fileNavigator:toggle';
@injectable()
export class FileNavigatorContribution extends AbstractViewContribution<FileNavigatorWidget> implements FrontendApplicationContribution, TabBarToolbarContribution {
@inject(ClipboardService)
protected readonly clipboardService: ClipboardService;
@inject(CommandRegistry)
protected readonly commandRegistry: CommandRegistry;
@inject(WorkspacePreferences) protected readonly workspacePreferences: WorkspacePreferences
) {
super({
viewContainerId: EXPLORER_VIEW_CONTAINER_ID,
widgetId: FILE_NAVIGATOR_ID,
widgetName: 'Explorer',
defaultWidgetOptions: {
area: 'left',
rank: 100
},
toggleCommandId: FILE_NAVIGATOR_TOGGLE_COMMAND_ID,
toggleKeybinding: 'ctrlcmd+shift+e'
});
}
@postConstruct()
protected async init(): Promise<void> {
await this.fileNavigatorPreferences.ready;
this.shell.currentChanged.connect(() => this.onCurrentWidgetChangedHandler());
const updateFocusContextKeys = () => {