Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
import { findValidPasteFileTarget } from 'vs/workbench/contrib/files/browser/fileActions';
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';

export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {

Expand Down Expand Up @@ -442,8 +441,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
@IInstantiationService private instantiationService: IInstantiationService,
@ITextFileService private textFileService: ITextFileService,
@IWindowService private windowService: IWindowService,
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
@IWorkbenchEnvironmentService private environmentService: IWorkbenchEnvironmentService
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService
) {
this.toDispose = [];

Expand Down Expand Up @@ -595,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));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down