eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
77 stars 160 forks source link

Find/Replace does not work #2066

Open TT1x1 opened 1 month ago

TT1x1 commented 1 month ago

Find/Replace does not replace the found string correctly. With the sample code such as:

public class Test {
 public void a(int x) throws MyException {}
 public void b(int y, int b) throws MyException {}  
}

Do as follows:

  1. Try to find "MyException" in code (Direction: forward, Scope: all, Options: wrap search)
  2. When the first matching "MyException" word is found/highlighted, click "Replace/Find" or "Replace" to replace with "SomeOtherException"
  3. IDE skips the highlighted word and replaces the second "MyException" word with "SomeOtherException", which is not correct

This problem appears at least in:

iloveeclipse commented 1 month ago

As I've wrote on original ticket in JDT UI, I can't reproduce on master. Please try latest SDK build from https://download.eclipse.org/eclipse/downloads/drops4/I20240708-1800/ and it is reproducible there, make sure all the steps needed are given in the ticket description.

Wittmaxi commented 1 month ago

Hey @TT1x1, thank you for the feedback! Is this possibly related to https://github.com/eclipse-platform/eclipse.platform.ui/issues/2011? Let's figure this bug out :)