You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's sometimes useful to force the user to review a preview of refactor changes before applying. This can be done with needsConfirmation:
constedit=newvscode.WorkspaceEdit();constdoc=awaitvscode.workspace.openTextDocument({language: "text",content: ""});edit.insert(doc.uri,newvscode.Position(0,0),"This is inserted text",{label: "Insert imports",needsConfirmation: true,// Show preview, but also requires ticking});edit.insert(doc.uri,newvscode.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.
The text was updated successfully, but these errors were encountered:
It is a good suggestion, and we have the same thoughts of feedback. Or, is it possible vscode can add a button by default, saying select all/unselect all
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
@jrieken would you accept a PR to add something here?
For example an additional flag needsPreview that triggers the preview without being unticked?
Refactor previews that don't use commands are all ticked by default, so not being able to do it here leads to inconsistent refactors depending on whether they are CodeActions or triggered from commands.
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
It's sometimes useful to force the user to review a preview of refactor changes before applying. This can be done with
needsConfirmation
: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.
The text was updated successfully, but these errors were encountered: