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

# Provide correct response to applyEdit() #162430

Merged
merged 6 commits into from
Oct 4, 2022

Conversation

marrej
Copy link
Contributor

@marrej marrej commented Sep 30, 2022

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
Copy link
Contributor Author

marrej commented Sep 30, 2022

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
@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