Searching in eclipse always fails first time, always succeeds seconds time with identical search string - eclipse

I've noticed that if I search for something in Eclipse (using it for Android development thus has the Android plugin) then the first time I search for a search string it always says there are no matches, but if I immediatly report the same search, then there are matches.
Using: Search/Search/File Search - then enter something in the "Containing text:" box (Case sensitvie is off, regular expression is off, file name patterns are .).
It will report "'search term' - 0 matches in workspace(.).
If I search again it will fail again unless I retype the search term or copy and paste it (no, I'm not mistyping it, if I enter it the first time when it fails, then copy and paste the term for the next successful search its obviously an identical search term).
This happens 100% of the time. Why is it doing this? Its really bugging me, when I search something I have to enter it twice it in order to get the results which is irritating.

Check the search scope at the bottom and make sure the correct one is selected:
Workspace
Selected resources
Enclosing projects
Working set
If you have a project highlighted in your workspace when you open the search dialog, it will default to the selected resource, otherwise it will default to the workspace, so that may be why you are seeing different results the second time around.
Hope this helps.

Related

VS Code find-and-replace: is there a way to keep my previous find term when I type ctrl+h?

Currently, when I use ctrl+h with something highlighted, my find term is set equal to the highlighted text. Is there a way to stop that (and keep my find term the same as it was previously)?
Often I want to find-and-replace in VS Code, do something, highlight something, and then find-and-replace the same thing again. Is there a way to make it so that I don't have to retype my find term a second time?
I know there are some plugins that have this functionality; if you know of any that allow me to see both my find and replace terms at the same time, I would like to know.
Set this setting to false:
// Controls if we seed the search string in Find Widget from editor selection
"editor.find.seedSearchStringFromSelection": false,
Editor > Find: Seed Search String From Selection
Doing this will also affect your Find/Search in Files functionality.

Select one word, then have all matching words automatically select?

I have been working in Notepad++ recently, and last night, spent at least an hour manually selecting many of the same phrase with Ctrl+Select. I needed to select all occurrences of 'yyty' (Just a phrase so I could easily find it), but could not see or find a quick way to do that. I ended up just using the Ctr+Select method, but when doing this 80 times, it gets quite annoying. I need something that will allow me to select a word, then have all matching words become selected (NOT highlighted or marked, as I need to be able to run the column editor tool on the selection to auto-number all of the selections) automatically (by automatically, I mean after clicking something to run the auto-selector). I am willing to install a plugin for NP++ if needed.

Stop eclipse renaming inside strings

I've been having this problem for some time and have never bothered to fix it since Eclipse has a horrible help system and I can't seem to find the right Google keywords to find what I need.
My problem is that when I refactor a class name, eclipse looks for all potential locations of that name and replaces them.
For instance, if I have a string inside a test case for the "list command" that says something like, "List - list all the users on a team", when I refactor the List.java class to something like UserListCommand.java, the expression inside the string also changes to "UserListCommand - list all the users on a team"
This is SOOO annoying! And like I said, Google is useless when you cannot even think of the right keywords to use.
Has anyone else had this problem and solved it?
Thanks in advance.
Eclipse calls this updating textual occurrences in comments and strings. I sometimes turn this on so javadoc gets updated correctly if I didn't properly link it. But it can be a pain because it sometimes replaces substrings that match.
I've only seen this when renaming classes or interfaces (methods don't seem to do this, at least not for me),
You need to open the Rename Dialog to stop eclipse from updating textual occurrences in comments and strings:
Highlight the type you want to rename, then either:
press Shift+Alt+R
Right click, then go to refactor->rename.. then instead of typing the new name, there should now be a yellow context popup menu under the class name to be changed which says "Enter new name, press Enter to refactor", notice that there is a down arrow to expand the menu. If you press that instead of enter a new name a new drop down menu appears, select Open Rename Dialog...
Once the Rename Dialog is open:
uncheck "update textual occurences in comments and strings (forces preview)" and "Update fully qualified names in non-Java text files (forces preview)"
Hope that helps

Eclipse Search Results are Missing When there are Exactly 404 Matches?

Specification
Eclipse: SpringSource Tool Suite
Version: 2.9.1.RELEASE
Build Id: 201203221000
What I do:
Search -> File
Containing text: "subheading"
File name patterns: "*, !*jquery.js, !*min.js"
Scope: Workspace
Click 'Search'
What I expect to happen:
The Search tab will show search results for "subheading".
What happens:
The Search tab starts to find results and puts them on the tab.
The number of matches stops at 404 since there are exactly that many instances of "subheading" in my workspace.
The file/directory names of each result turns blank.
My Suggestion For Duplicating:
Make a test workspace with exactly 404 instances of a word.
Search for it.
My Theory:
The developers of Eclipse are messing with me. I hope this isn't true, but I don't see why else it would do this. Can anyone else duplicate this and/or explain it?
Update:
After much more use of Eclipse, this same result seems to randomly occur (file/directory names turning blank). It happens consistently when there are 404 results, but it also happens randomly with other amounts.
For a workaround. I found that I could switch to a different perspective and it gave me my search results back.

Why would eclipse not show search results inside file in results list?

We have one installation of Eclipse which does not show the individual lines on which search results occur as do all other installations, as shown here:
How can we turn on this feature so that individual results in each line are shown?
I think it's a question of what tool you are using. If you do a text search, you get one line per hit. But if, say, you look for references to a Java method, you get one line per file.
Although it seems like a perfectly desirable thing, I can't find any way to get Java search to return one line per hit.
In the preferences of the Search window (usually button with triangle icon) choose "Show as List" item