Built-in Command

OpenSumi provides a set of built-in commands, which partially implement the built-in commands of VS Code. These commands may be used in some plug-ins. If you encounter built-in commands that are not implemented, you can go to [OpenSumi Issues](https://github .com/opensumi/core/issues) for adaptation requirements.

Built-in command set

commandfunctionparameter
revealInExplorerLocate file in explorer interfaceuri: URI
setContextSet Context variable valuekey: key, value: value
workbench.action.closeActiveEditorClose the currently active editor
workbench.action.revertAndCloseActiveEditorReverts the current file content and closes the active editor
workbench.action.splitEditorRightSplit the current editor to the right
workbench.action.splitEditorDownSplit the current editor down
workbench.action.files.newUntitledFileCreate a new temporary editor file
workbench.action.closeAllEditorsclose all editors
workbench.action.closeOtherEditorsclose other editors
workbench.action.files.saveSave current file
workbench.action.splitEditorOpen file and split rightresource: ResourceArgs
workbench.action.splitEditorOrthogonalOpen file and split downresource: ResourceArgs
workbench.action.navigateLeftSwitch to left editor
workbench.action.navigateUpswitch to top editor
workbench.action.navigateRightSwitch to right editor
workbench.action.navigateDownswitch to bottom editor
workbench.action.navigateEditorGroupsNavigate Editor Groups
workbench.action.nextEditorSwitch to next file
workbench.action.previousEditorSwitch to previous file
workbench.action.openEditorAtIndexOpen editor by subscript position
workbench.action.files.revertReverts the currently active file content
workbench.action.terminal.clearClear the contents of the currently active terminal window
workbench.action.terminal.toggleTerminalToggle Terminal Window
workbench.files.action.focusFilesExplorerOpen the active editor group
vscode.openOpen file (only available under Electron)uri: URI, newWindow: boolean
vscode.openFolderopen folder (only available under Electron)uri: URI, newWindow: boolean
workbench.action.reloadWindow (reload_window)reload window
copyFilePathCopy file absolute pathuri: URI
copyRelativeFilePathRelative file path to copyuri: URI
workbench.action.openSettingsOpen Settings panel
workbench.action.navigateBackGo to previous editor
workbench.action.navigateForwardNavigate to the next editor
workbench.action.files.saveAllsave all files
workbench.action.debug.stepIntoDebug StepInto
workbench.action.debug.stepOutDebug step out
workbench.action.debug.stepOverDebug stepping
workbench.action.debug.continuedebug continue
workbench.action.debug.run (workbench.action.debug.start)debug run
workbench.action.debug.pausedebug pause
workbench.action.debug.restartdebug restart
workbench.action.debug.stopdebug stop
workbench.action.showAllSymbolsShow all symbols

Usage

For example, use vscode.open to open a file with a protocol

import * as sumi from 'sumi';

// Parameter Description
type VSCodeOpen = (
  resource: vscode.Uri,
  columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions,
  label?: string
) => void;

sumi.commands.executeCommand(
  'vscode. open',
  {
    preserveFocus: true,
    preview: false
  } as vscode.TextDocumentShowOptions,
  'test-title'
);