@@ -7,7 +7,7 @@ import { localize } from 'vs/nls';
7
7
import { CancellationToken , CancellationTokenSource } from 'vs/base/common/cancellation' ;
8
8
import { getFileNamesMessage , IConfirmation , IDialogService , IFileDialogService } from 'vs/platform/dialogs/common/dialogs' ;
9
9
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' ;
11
11
import { IProgress , IProgressService , IProgressStep , ProgressLocation } from 'vs/platform/progress/common/progress' ;
12
12
import { IExplorerService } from 'vs/workbench/contrib/files/browser/files' ;
13
13
import { VIEW_ID } from 'vs/workbench/contrib/files/common/files' ;
@@ -390,7 +390,8 @@ export class ExternalFileImport {
390
390
@IWorkspaceEditingService private readonly workspaceEditingService : IWorkspaceEditingService ,
391
391
@IExplorerService private readonly explorerService : IExplorerService ,
392
392
@IEditorService private readonly editorService : IEditorService ,
393
- @IProgressService private readonly progressService : IProgressService
393
+ @IProgressService private readonly progressService : IProgressService ,
394
+ @INotificationService private readonly notificationService : INotificationService ,
394
395
) {
395
396
}
396
397
@@ -495,7 +496,15 @@ export class ExternalFileImport {
495
496
} ) ;
496
497
}
497
498
499
+
500
+ let inaccessibleFileCount = 0 ;
498
501
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
+
499
508
if ( targetNames . has ( caseSensitive ? basename ( resource ) : basename ( resource ) . toLowerCase ( ) ) ) {
500
509
const confirmationResult = await this . dialogService . confirm ( getFileOverwriteConfirm ( basename ( resource ) ) ) ;
501
510
if ( ! confirmationResult . confirmed ) {
@@ -506,6 +515,10 @@ export class ExternalFileImport {
506
515
return resource ;
507
516
} ) ) ) ) ;
508
517
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
+
509
522
// Copy resources through bulk edit API
510
523
const resourceFileEdits = resourcesFiltered . map ( resource => {
511
524
const sourceFileName = basename ( resource ) ;
0 commit comments