Skip to content

Commit 917f070

Browse files
committed
1 parent d0f7b30 commit 917f070

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/vs/workbench/contrib/files/browser/fileImportExport.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
77
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
88
import { getFileNamesMessage, IConfirmation, IDialogService, IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
99
import { ByteSize, FileSystemProviderCapabilities, IFileService, IFileStatWithMetadata } from 'vs/platform/files/common/files';
10-
import { Severity } from 'vs/platform/notification/common/notification';
10+
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
1111
import { IProgress, IProgressService, IProgressStep, ProgressLocation } from 'vs/platform/progress/common/progress';
1212
import { IExplorerService } from 'vs/workbench/contrib/files/browser/files';
1313
import { VIEW_ID } from 'vs/workbench/contrib/files/common/files';
@@ -390,7 +390,8 @@ export class ExternalFileImport {
390390
@IWorkspaceEditingService private readonly workspaceEditingService: IWorkspaceEditingService,
391391
@IExplorerService private readonly explorerService: IExplorerService,
392392
@IEditorService private readonly editorService: IEditorService,
393-
@IProgressService private readonly progressService: IProgressService
393+
@IProgressService private readonly progressService: IProgressService,
394+
@INotificationService private readonly notificationService: INotificationService,
394395
) {
395396
}
396397

@@ -495,7 +496,15 @@ export class ExternalFileImport {
495496
});
496497
}
497498

499+
500+
let inaccessibleFileCount = 0;
498501
const resourcesFiltered = coalesce((await Promises.settled(resources.map(async resource => {
502+
const fileDoesNotExist = !(await this.fileService.exists(resource));
503+
if (fileDoesNotExist) {
504+
inaccessibleFileCount++;
505+
return undefined;
506+
}
507+
499508
if (targetNames.has(caseSensitive ? basename(resource) : basename(resource).toLowerCase())) {
500509
const confirmationResult = await this.dialogService.confirm(getFileOverwriteConfirm(basename(resource)));
501510
if (!confirmationResult.confirmed) {
@@ -506,6 +515,10 @@ export class ExternalFileImport {
506515
return resource;
507516
}))));
508517

518+
if (inaccessibleFileCount > 0) {
519+
this.notificationService.error(inaccessibleFileCount > 1 ? localize('filesInaccessible', "Some or all of the dropped files could not be accessed for import.") : localize('fileInaccessible', "The dropped file could not be accessed for import."));
520+
}
521+
509522
// Copy resources through bulk edit API
510523
const resourceFileEdits = resourcesFiltered.map(resource => {
511524
const sourceFileName = basename(resource);

src/vs/workbench/contrib/files/browser/views/explorerViewer.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,6 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
839839
if (!containsDragType(originalEvent, DataTransfers.FILES, CodeDataTransfers.FILES, DataTransfers.RESOURCES)) {
840840
return false;
841841
}
842-
if (isWeb && !containsDragType(originalEvent, 'Files')) {
843-
// DnD from vscode to web is not supported #115535. Only if we are dragging from native finder / explorer then the "Files" data transfer will be set
844-
return false;
845-
}
846842
}
847843

848844
// Other-Tree DND

0 commit comments

Comments
 (0)