Skip to content

# Provide correct response to applyEdit()#162430

Merged
jrieken merged 6 commits into
microsoft:mainfrom
marrej:correct-response-for-apply-edit
Oct 4, 2022
Merged

# Provide correct response to applyEdit()#162430
jrieken merged 6 commits into
microsoft:mainfrom
marrej:correct-response-for-apply-edit

Conversation

@marrej

@marrej marrej commented Sep 30, 2022

Copy link
Copy Markdown
Contributor

At the moment vscode.workspace.applyEdit() returns always true, regardless whether the WorkspaceEdit was applied/discarded.

To provide a better feedback to the extensions relying on this signal, add a boolean property isApplied which would be true if at least one ResourceEdit has been applied. If none has been applied, no edit has been provided or discard has been pressed then false would be returned back.

This change should not impact existing functionality as only src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.ts return back the result from bulkEditService.applyEdit() directly to callers of notebook.diff.cell.revertInput so the calling extensions (as its not called in VScode) should be able to continue functioning without any problems (as they would either rely on the result being undefined, or extracting the ariaSummary).

fixes #161133

@marrej

marrej commented Sep 30, 2022

Copy link
Copy Markdown
Contributor Author

Hi @jrieken, based on the discussion in #161133 i propose this simple fix for the Refactor Preview signal (apply/discard not being differentiated).

@jrieken jrieken assigned jrieken and unassigned rebornix Sep 30, 2022
@jrieken jrieken added this to the October 2022 milestone Sep 30, 2022
Comment thread src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.ts Outdated
@jrieken
jrieken enabled auto-merge October 4, 2022 12:39
@jrieken
jrieken merged commit 188c657 into microsoft:main Oct 4, 2022
@marrej
marrej deleted the correct-response-for-apply-edit branch October 4, 2022 12:55
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Preview better feedback on user actions

4 participants