Skip to content

Commit deb33e0

Browse files
committed
1 parent c6c6969 commit deb33e0

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { mnemonicButtonLabel } from 'vs/base/common/labels';
2323
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
2424
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
2525
import { IHostService } from 'vs/workbench/services/host/browser/host';
26+
import { Schemas } from 'vs/base/common/network';
2627

2728
export abstract class AbstractWorkspaceEditingService implements IWorkspaceEditingService {
2829

@@ -127,13 +128,10 @@ export abstract class AbstractWorkspaceEditingService implements IWorkspaceEditi
127128

128129
private async doAddFolders(foldersToAdd: IWorkspaceFolderCreationData[], index?: number, donotNotifyError: boolean = false): Promise<void> {
129130
const state = this.contextService.getWorkbenchState();
130-
if (this.environmentService.configuration.remoteAuthority) {
131-
132-
// Do not allow workspace folders with scheme different than the current remote scheme
133-
const schemas = this.contextService.getWorkspace().folders.map(f => f.uri.scheme);
134-
if (schemas.length && foldersToAdd.some(f => schemas.indexOf(f.uri.scheme) === -1)) {
135-
throw new Error(nls.localize('differentSchemeRoots', "Workspace folders from different providers are not allowed in the same workspace."));
136-
}
131+
const remoteAuthority = this.environmentService.configuration.remoteAuthority;
132+
if (remoteAuthority) {
133+
// https://github.com/microsoft/vscode/issues/94191
134+
foldersToAdd = foldersToAdd.filter(f => f.uri.scheme !== Schemas.file && (f.uri.scheme !== Schemas.vscodeRemote || f.uri.authority === remoteAuthority));
137135
}
138136

139137
// If we are in no-workspace or single-folder workspace, adding folders has to

0 commit comments

Comments
 (0)