Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting multiple files through explorer invokes the event listeners per file #86210

Closed
deepak1556 opened this issue Dec 4, 2019 · 2 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Milestone

Comments

@deepak1556
Copy link
Collaborator

When testing #85929

Steps to reproduce:

  1. Register delete event listeners
vscode.workspace.onWillDeleteFiles((e : vscode.FileWillDeleteEvent) => {
	const p = new Promise((resolve) => {
		setTimeout(() => resolve(), 10000);
	});
	e.waitUntil(p);
	console.log(e.files.length);
});

vscode.workspace.onDidDeleteFiles((e : vscode.FileDeleteEvent) => {
	console.log('DELETING...');
	e.files.forEach(file => console.log(file));
});
  1. Select multiple files from the explorer with Cmd+Click and delete using context menu.

  2. Expect to receive single event fire for all the files but instead the listener is fired individually for each file being deleted.

Output:

1
1
DELETING...
<Object>
DELETING...
<Object>
@isidorn
Copy link
Contributor

isidorn commented Dec 4, 2019

The issue is that the file-explorer calls the textFileService per resource. To tackle this we should introduce a bulk call in the textFileService.

@isidorn isidorn added feature-request Request for new features or functionality file-explorer Explorer widget issues labels Dec 4, 2019
@isidorn isidorn added this to the December 2019 milestone Dec 4, 2019
@isidorn
Copy link
Contributor

isidorn commented Jun 29, 2020

This should actually be fixed now with the PR that introduces bulk operations

@isidorn isidorn closed this as completed Jun 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Projects
None yet
Development

No branches or pull requests

3 participants