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

FindReplaceLogic.updateTarget should call endSession on current target #1846

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

merks
Copy link
Contributor

@merks merks commented Apr 24, 2024

No description provided.

@merks merks requested a review from HeikoKlare April 24, 2024 08:49
@@ -588,12 +588,11 @@ public void updateTarget(IFindReplaceTarget newTarget, boolean canEditTarget) {
this.isTargetEditable = canEditTarget;

if (this.target != newTarget) {
if (newTarget != null && newTarget instanceof IFindReplaceTargetExtension)
((IFindReplaceTargetExtension) newTarget).endSession();
if (this.target instanceof IFindReplaceTargetExtension)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should end the session for the current target not for the new target.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you for finding this, @merks! This is a regression from #1132. Your proposal properly restored the previous behavior.


this.target = newTarget;
if (newTarget != null)
isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3;
isTargetSupportingRegEx = newTarget instanceof IFindReplaceTargetExtension3;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The null guard seems pointless.

@merks
Copy link
Contributor Author

merks commented Apr 24, 2024

@Wittmaxi

FYI, I noticed that find in Oomph's setup editors was broken, often requiring me to close the editor to get it working again. I tested against EMF's editors (e.g., the Ecore editor) and it had the same problem. I finally tracked it down to this lifecycle problem.

EMF add this control:

image

And when the editor no longer has focus, the session should end and the control should be removed:

image

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Thank you for the fix! It properly corrects a recently introduced regression. Thus, I propose to merge this once CI has finished. Then it should also make its way into the M2 build.

Copy link
Contributor

Test Results

   920 files     920 suites   38m 39s ⏱️
 7 524 tests  7 367 ✅ 150 💤 7 ❌
22 150 runs  21 758 ✅ 385 💤 7 ❌

For more details on these failures, see this check.

Results for commit 15169b5.

@merks
Copy link
Contributor Author

merks commented Apr 24, 2024

Windows/Mac failures unrelated.

@merks merks merged commit 669d80a into eclipse-platform:master Apr 24, 2024
13 of 16 checks passed
@merks merks deleted the pr-findandreplace-end-session branch April 24, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants