widget to save as target
.
The new URI for the widget.
This is the generic Open
method. Opens files and directories too. Resolves to the opened URI.
Except when you are on either Windows or Linux AND
running in electron. If so, it opens a file.
Opens a file after prompting the Open File
dialog. Resolves to undefined
, if
Otherwise, resolves to the URI of the file.
Opens a folder after prompting the Open Folder
dialog. Resolves to undefined
, if
Otherwise, resolves to the URI of the folder.
Opens a workspace after raising the Open Workspace
dialog. Resolves to the URI of the recently opened workspace,
if it was successful. Otherwise, resolves to undefined
.
Caveat: this behaves differently on different platforms, the workspace.supportMultiRootWorkspace
preference value does matter,
and electron
/browser
version has impact too. See here for more details.
Legend:
workspace.supportMultiRootWorkspace
is false
: => N
workspace.supportMultiRootWorkspace
is true
: => Y
F
W
FW
|---------|-----------|-----------|------------|------------| | | browser Y | browser N | electron Y | electron N | |---------|-----------|-----------|------------|------------| | Linux | FW | F | W | F | | Windows | FW | F | W | F | | OS X | FW | F | FW | FW | |---------|-----------|-----------|------------|------------|
Get the current workspace URI.
the current workspace URI.
Save sourceWidget
to a new file picked by the user.
This method ensures a few things about
widget
:widget.getResourceUri()
actually returns a URI.widget.saveable.createSnapshot
is defined.widget.saveable.revert
is defined.