IDE continue search

When I search in IDE, I can search the entire project, just the class, just the method, or sometimes just the selection within the method. All of these are great.
But many times, especially when I’m trying to remove some debugging code, I have multiple instances within a single method showing in my results. I can click the first one and land on my search code and can remove that line. I click the next one and it is off one line, but manageable. Five or more iterations and I might as well re-request the search. I’m good with this, cause I don’t think requesting to have the IDE search constantly adjusting search results live would be balanced by resources needed, there are often delays in IDE responsiveness the way things are.

I was going to make a feature request for “F3” continue search (or whatever the Mac equivalent for that is) within a single code method edit window (not the entire project).

[For clarification: I’m a Windows developer, and most Windows apps use CTRL + F to start a search, so the search dialog opens and you enter what you are searching for. F3 is a continuation of the last search and simply moves you to the next instance you are searching for, or at the end it “bings” or you get a dialog “nothing more matching results”]

But then I’m wondering if there is a way to code this myself, or maybe someone has already done it. It seems simple enough {IDE code editor}.IndexOf({IDE cursor position}, MySearchInstance) gives the next location. I have no idea how to access the IDE’s find dialog text to get MySearchInstance (the last thing I searched for), or the IDE’s code editor contents, or even how to move the IDE’s cursor position.

you could use #pragma warning “here …”
or add bookmarks
to easy find the locations

Yea, that’s a good idea!

I’m under the impression that bookmarks shift too though. Please test.

You can also work backwards (bottom up) to minimize the shifting effect.

Also, clicking on one of the icons (global, module, method) will re-run the search, if that helps.

1 Like

That’s my approach too, and works quite well.

1 Like

For searching constantly, I agree.
But perhaps the IDE could simply adjust the search result once you add or remove lines in the editor (that is, not search again, but just update every row of the results which are in the edited method)). Not sure what resources would be needed for this.

Yes, this often works. I’ve had times where this was not a solution, however.

1 Like

The bookmark is an extra step. (Gee I hope it never moves, cause one would expect it to stay with the marked code, no matter what)

But Backwards!! Wow, didn’t even think about that for some reason. That’s perfect.


I learned it on a huge replace project … of course … almost at the end of my work :slight_smile: