Change:
} <del> export function findValidPasteFileTarget(explorerService: IExplorerService, targetFolder: ExplorerItem, fileToPaste: { resource: URI; isDirectory?: boolean; allowOverwrite: boolean }, incrementalNaming: 'simple' | 'smart' | 'disabled'): URI { let name = resources.basenameOrAuthority(fileToPaste.resource); </del> <ins> export async function findValidPasteFileTarget( explorerService: IExplorerService, fileService: IFileService, dialogService: IDialogService, targetFolder: ExplorerItem, fileToPaste: { resource: URI; isDirectory?: boolean; allowOverwrite: boolean }, incrementalNaming: 'simple' | 'smart' | 'disabled' ): Promise<URI | undefined> { let name = resources.basenameOrAuthority(fileToPaste.resource); </ins> let candidate = resources.joinPath(targetFolder.resource, name); <ins> // In the disabled case we must ask if it's ok to overwrite the file if it exists if (incrementalNaming === 'disabled') { const canOverwrite = await askForOverwrite(fileService, dialogService, candidate); if (!canOverwrite) { return; } } </ins> while (true && !fileToPaste.allowOverwrite) { if (!explorerService.findClosest(candidate)) { break;

Discussion:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.73.0-insider OS Version: KDE Neon 5.26.2 Steps to Reproduce: to settings (UI). for "duplicate". "Explorer: Incremental Naming" to . the file explorer, hold down the key (to copy a file instead of moving) and drag a file to the same directory. Actual result: VSCode hangs until I am presented the "This window is not responding" dialg. Clicking has the same effect as . Expected result: I am telling VSCode to duplicate a file, while I have taken away its algorithm to automatically create new file names. Therefore I might expect VSCode to show a dialog with a text input. The text input would contain the file's current name, which I can alter. Confirming the dialog would copy the file using the new name. Or something to this effect. But maybe that solution is trying to counter a symptom rather than solving the root of the problem. Because how would should VSCode respond when drag-copying multiple files? Maybe the root of the problem is the ability to set "Explorer: Incremental Naming" to in the first place. Maybe VSCode must always have a 'duplicate file naming algorithm' in order to function? Even if it is a one. Removing and using the algorithm as a bare minimum would surely fix the problem. Addendum: The description of states the user "will be prompted to override the existing file". So this might be the expected / intended result.