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

[search-in-workspace] Show diff editor only when replacement term is provided #9516

Merged

Conversation

gbodeen
Copy link
Contributor

@gbodeen gbodeen commented May 25, 2021

Signed-off-by: Gabriel Bodeen gabriel.bodeen@ericsson.com

What it does

Aligns Theia's search-in-workspace replacement behavior more closely with VS Code's. The latter switches from search mode to search-and-replace mode only when the replacement field is visible and nonempty; currently Theia goes into search-and-replace mode whether the replacement field is filled or not. This behavior was reported by some of our users as confusing.

I'll note that there is one potential advantage to Theia's current behavior, which is making it obvious that the search-and-replace mode has the ability to easily search a term and replace it with nothing (i.e. just remove it). It can still do that in this branch via the replace-all button, but this option is no longer obvious. I think it's an acceptable cost.

How to test

This branch:

  1. Open the search-in-workspace widget. Enter search text. Observe the styling.
  2. Toggle to show the replace field & buttons. Observe the styling has not changed. If you click one of the lines, it will open a normal editor.
  3. Enter a replacement term. Observe the styling changes and now displays the search and replace terms. If you click one of the lines, it will open a diff editor.

image
image

Current master:

  1. Open the search-in-workspace widget. Enter search text. Observe the styling. If you click one of the lines, it will open a normal editor.
  2. Toggle to show the replace field & buttons. Observe the styling changes and now displays the search and replace terms. If you click one of the lines, it will open a diff editor.

Review checklist

Reminder for reviewers

Signed-off-by: Gabriel Bodeen <gabriel.bodeen@ericsson.com>
@vince-fugnitto vince-fugnitto added the search in workspace issues related to the search-in-workspace label May 25, 2021
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

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

The changes look good to me and work well 👍
I'm fine with the behavior present on master but this way has the advantage of aligning the behavior with vscode.

@colin-grant-work colin-grant-work merged commit bb87e69 into eclipse-theia:master May 26, 2021
@vince-fugnitto vince-fugnitto added this to the 1.14.0 milestone May 27, 2021
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.

3 participants