Skip to content

Commit 7d39e80

Browse files
committed
explorer: stricter dnd
1 parent fae7253 commit 7d39e80

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
4646
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
4747
import { findValidPasteFileTarget } from 'vs/workbench/contrib/files/browser/fileActions';
4848
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
49+
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
4950

5051
export class ExplorerDelegate implements IListVirtualDelegate<ExplorerItem> {
5152

@@ -441,7 +442,8 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
441442
@IInstantiationService private instantiationService: IInstantiationService,
442443
@ITextFileService private textFileService: ITextFileService,
443444
@IWindowService private windowService: IWindowService,
444-
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService
445+
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
446+
@IWorkbenchEnvironmentService private environmentService: IWorkbenchEnvironmentService
445447
) {
446448
this.toDispose = [];
447449

@@ -472,6 +474,12 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
472474
if (typesArray.indexOf(DataTransfers.FILES.toLowerCase()) === -1 && typesArray.indexOf(CodeDataTransfers.FILES.toLowerCase()) === -1) {
473475
return false;
474476
}
477+
if (this.environmentService.configuration.remoteAuthority) {
478+
const resources = extractResources(originalEvent, true);
479+
if (resources.some(r => r.resource.authority !== this.environmentService.configuration.remoteAuthority)) {
480+
return false;
481+
}
482+
}
475483
}
476484

477485
// Other-Tree DND

0 commit comments

Comments
 (0)