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

Use same replacement text for entire replacement cycle #11374

Conversation

colin-grant-work
Copy link
Contributor

What it does

In our current code for Replace All actions in the SiW widget, the code is async but refers to this._replaceTerm, which can be updated by user actions while the replacement is running, resulting in different values being inserted in different editors. This PR caches the value present at the start of the operation and uses it in everywhere where reference to it is required.

How to test

  1. Search for something with many results.
  2. Input a replacement term.
  3. Select 'Replace All' and immediately modify the value of the replace input.
  4. The original value should be used in all the editors where a replacement has been performed (on master, later editors might get the new value, depending on number of results and speed of file actions)

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work added the search in workspace issues related to the search-in-workspace label Jun 29, 2022
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm that the issue exists on master and is addressed by this change nicely 👍

@colin-grant-work colin-grant-work added this to the 1.27.0 milestone Jun 30, 2022
@colin-grant-work colin-grant-work merged commit 14fe691 into eclipse-theia:master Jun 30, 2022
@colin-grant-work colin-grant-work deleted the bugfix/siw-changing-replacement branch June 30, 2022 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
search in workspace issues related to the search-in-workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants