Skip to content

Commit

Permalink
Cannot create a new file if the preferences widget is opened.
Browse files Browse the repository at this point in the history
Fixes: eclipse-theia#7067 , eclipse-theia#7253

Initially we were unable to create a new file or folder while the user preferences was open.

The user-preferences has the file scheme set as `user-storage` and we did not fall back to the workspace root URI and instead were getting the URI from 'user_storage:settings.json'.
With this approach, we create files at certain directories and if a directory doesn't have the scheme set to 'file' it will fallback to the workspace root uri.

Signed-off-by: Muhammad Anas Shahid <[email protected]>
  • Loading branch information
Muhammad Anas Shahid committed Mar 9, 2020
1 parent d5a60bb commit 6b8ded1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/workspace/src/browser/workspace-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export class WorkspaceRootUriAwareCommandHandler extends UriAwareCommandHandler<
protected getUri(...args: any[]): URI | undefined {
const uri = super.getUri(...args);
// If the URI is available, return it immediately.
if (uri) {
if (uri && uri.scheme === 'file') {
return uri;
}
// Return the first root if available.
Expand Down

0 comments on commit 6b8ded1

Please sign in to comment.