Community
Participate
Working Groups
Steps to reproduce: Clear search history. On a class indentifier right click -> search -> occurrences in file On another class identifer do the same The search history now contains only the last search. This problem does not arise, if another search (e.g. search -> references) is done in between.
Good catch. Happens because the searches with same runnable are considered equal (to support Search Again). This specific search cannot be repeated and hence has null as its runnable and therefore they are all considered equal. Fixed and released in HEAD. Not critical enough to go into 2.1 maintenance stream.
Fine. The one thing I can't understand is why this search can't be repeated. I can see no obvious reason for this. If someone finds the time to explain, I'd be glad. Thanks!
Sure. The search is an AST based search. To repeat the search we would either have to keep the AST node or start to manage text positions (the text in the editor at the cursor position where the search started could have been changed - e.g. the local variable v might have been refactored to a field). Keeping the AST node is bad because all other referenced nodes would stay in memory. Given the needed overhead and our assumption that this kind of search is mostly used while the file itself is open and therefore redoing a search can be done by selecting the same "thing" again and hit Ctrl+U, we did not provide the search again action. If you think this is needed then please file a new feature request for this.