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

Deduplicate InMemoryTextResource #9504

Merged

Conversation

gbodeen
Copy link
Contributor

@gbodeen gbodeen commented May 20, 2021

What it does

Fixes #9191 and an unreported issue with Search-In-Workspace: when clicking a search-and-replace suggestion, the preview editor should reveal the line on which the suggested change occurs. Currently on master, only the first suggested change in a file will be revealed.

(Please let me know if these should be separate PRs or instead should be flattened into a single commit. I found the latter issue while testing the fix for issue 9191, and it was unsatisfying to submit a fix that still looked broken.)

How to test

Test Bulk-Edit:

  1. Open ts/tsx file, click a function name and press F2 to rename it.
  2. Enter new name and press Shift+Enter.
  3. A Refactor Preview pane should open in bottom with suggested changes.
  4. Click on one of the changes suggested in that pane.
  5. A split preview editor should open displaying the diff. This preview uses a mem-txt scheme.

bulk-edit

Test Search-In-Workspace:

  1. Use the search-in-workspace widget. Click the Toggle Replace triangle and enter replacement text.
  2. Click one of the suggested search-and-replace operations.
  3. A split preview editor should open displaying the diff. This preview uses a 'mem-txt' scheme.
  4. Additionally, the preview editor should now reveal the line of the suggested change.

s-i-w

Review checklist

Reminder for reviewers

@vince-fugnitto vince-fugnitto added bulk-edit issues related to the bulk-edit extension quality issues related to code and application quality search in workspace issues related to the search-in-workspace labels May 20, 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 work well for me 👍

  • confirmed that rename preview works as on master.
  • confirmed that search-in-workspace rename works.
  • confirmed that search-in-workspace rename now properly selects the proposed changes.

@gbodeen
Copy link
Contributor Author

gbodeen commented May 25, 2021

Incidentally, I noticed that this fixes another cosmetic issue: In the search-and-replace tree, an element will now stay selected after clicking it. This happens because the mode: 'reveal' option is now passed to the editor in all cases.

@colin-grant-work colin-grant-work merged commit ad44545 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
bulk-edit issues related to the bulk-edit extension quality issues related to code and application quality search in workspace issues related to the search-in-workspace
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[quality] There are two identical InMemoryTextResource implementations
3 participants