mirror of
https://github.com/Microsoft/vscode
synced 2024-10-05 19:02:54 +00:00
Merge pull request #75273 from microsoft/isidorn/workspaceRemoteLimit
Do not allow workspace folders with scheme different than the current…
This commit is contained in:
commit
46a9c6d481
|
@ -593,11 +593,11 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
|
|||
|
||||
// Desktop DND (Import file)
|
||||
if (data instanceof DesktopDragAndDropData) {
|
||||
this.handleExternalDrop(data, target, originalEvent);
|
||||
this.handleExternalDrop(data, target, originalEvent).then(undefined, e => this.notificationService.warn(e));
|
||||
}
|
||||
// In-Explorer DND (Move/Copy file)
|
||||
else {
|
||||
this.handleExplorerDrop(data, target, originalEvent);
|
||||
this.handleExplorerDrop(data, target, originalEvent).then(undefined, e => this.notificationService.warn(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -216,6 +216,13 @@ export class WorkspaceEditingService implements IWorkspaceEditingService {
|
|||
|
||||
private async doAddFolders(foldersToAdd: IWorkspaceFolderCreationData[], index?: number, donotNotifyError: boolean = false): Promise<void> {
|
||||
const state = this.contextService.getWorkbenchState();
|
||||
if (this.environmentService.configuration.remoteAuthority) {
|
||||
// Do not allow workspace folders with scheme different than the current remote scheme
|
||||
const schemas = this.contextService.getWorkspace().folders.map(f => f.uri.scheme);
|
||||
if (schemas.length && foldersToAdd.some(f => schemas.indexOf(f.uri.scheme) === -1)) {
|
||||
return Promise.reject(new Error(nls.localize('differentSchemeRoots', "Workspace folders from different providers are not allowed in the same workspace.")));
|
||||
}
|
||||
}
|
||||
|
||||
// If we are in no-workspace or single-folder workspace, adding folders has to
|
||||
// enter a workspace.
|
||||
|
|
Loading…
Reference in a new issue