Bug description:
When a VS Code extension is executed in Theia (via @theia/plugin-ext), calling [vscode.window.showOpenDialog({ defaultUri })] does not open the dialog in the provided [defaultUri].
Instead, the Theia file dialog opens on a “Recent” view or falls back to another directory, even though the extension passes a valid URI.
Expected behavior:
The open dialog should start in the folder specified by [options.defaultUri]
(or its parent when [defaultUri] points to a file / non-existing file).
Actual behavior: The dialog does not navigate to [defaultUri] and starts in a “Recent” tab / different folder.
Run Theia with plugin-ext enabled.
Steps to Reproduce
Execute an extension command that calls:
[vscode.window.showOpenDialog({ defaultUri: vscode.Uri.file('/home/dir1/dir2/'), canSelectFiles: true, canSelectFolders: false })]
Observe the open dialog starting in “Recent” / unexpected directory rather than [dir2]
This bug is also found in showSaveDialog