-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Open
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityuxUser experience issuesUser experience issuesworkspace-edit
Milestone
Description
It's sometimes useful to force the user to review a preview of refactor changes before applying. This can be done with needsConfirmation:
const edit = new vscode.WorkspaceEdit();
const doc = await vscode.workspace.openTextDocument({ language: "text", content: "" });
edit.insert(doc.uri, new vscode.Position(0, 0), "This is inserted text", {
label: "Insert imports",
needsConfirmation: true, // Show preview, but also requires ticking
});
edit.insert(doc.uri, new vscode.Position(0, 0), "This is inserted text", {
label: "Update code",
needsConfirmation: true, // Show preview, but also requires ticking
});
vscode.workspace.applyEdit(edit);However, the user needs to tick each change (at least the unique labels, which have a "Toggle Change" option on the context menu) which can be a pain if the edit is making a lot of changes that are grouped (for example fixing lint failures across a workspace, with each lint being a group).
It would be a much nicer experience if we could trigger the preview, but with everything ticked by default. In many cases we know the user is likely to apply all of the changes, but we still want to trigger a preview to be shown.
DanTup, CoderDake, abitofevrything, rrousselGit, osaxma and 61 more
Metadata
Metadata
Assignees
Labels
feature-requestRequest for new features or functionalityRequest for new features or functionalityuxUser experience issuesUser experience issuesworkspace-edit
