Enable switching preview for search results, refactoring and bookmarks#8326
Conversation
|
haven't had time yet to look through everything yet, but I found a problem with the refactoring preview, see fix in: first commit might be squashable with the cleanup commit, second commit has the fixes, see msg. (feel free to squash) |
|
@dschniedertuens-tc thanks for testing, indeed the implementation for the refactoring panel was off. An updated version is available here: https://github.com/apache/netbeans/suites/35751671606/artifacts/2760443851 @mbien thanks for testing. I plan to squash the cleanup commit into the first cleanup (there is a conflict, but that is trivial to resolve). The second commit more or less matched my initial thoughts after looking into the initial testing report, however I added some more fixes so went with my already started work. |
|
I can confirm that the preview switch for the usages panel now also works as I would expect. |
|
this avoids out of bounds issues: diff --git a/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffViewManager.java b/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffViewManager.java
index 40ecfd9..42df713 100644
--- a/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffViewManager.java
+++ b/ide/diff/src/org/netbeans/modules/diff/builtin/visualizer/editable/DiffViewManager.java
@@ -505,7 +505,7 @@
if (checkFileEdge && rightOffet >= rightPane.getScrollPane().getVerticalScrollBar().getMaximum()) {
rightOffet = map.length - 1;
}
- if (rightOffet >= map.length) return;
+ if (rightOffet >= map.length || rightOffet < 0) return;
leftPane.getScrollPane().getVerticalScrollBar().setValue(map[rightOffet]
- halfScreen);
}This happens when preview is off and the refactoring view changes selection. The diff panel tries to scroll even though it is not visible. This sounds like unnecessary work given that it is not visible but i think it is probably ok, because if you toggle it on again it will show at the right position - which is what you would expect from it I think. Details |
|
added another commit for the bookmarks preview mbien@27e652e, feel free to squash or take bits of it. |
|
Could you take a look at #8350 Might be relevant to changes here. |
Co-authored-by: Michael Bien <mbien42@gmail.com>
c9c13f8 to
3235c61
Compare
|
@mbien thank you for the updates, which I integrated Assuming check become green and or anybody raises a veto, I plan to merge this by end of next week. |
mbien
left a comment
There was a problem hiding this comment.
tested: find usages, search, bookmarks and refactoring windows and everything worked - changes looked good to me too
left one comment for you to consider
Co-authored-by: Michael Bien <mbien42@gmail.com>
3235c61 to
82bd89c
Compare
|
I've been working with the linked nightly for the last few days now, constantly using search and usages and the switch still works very well for me. Now that it can be disabled, I have even found cases for which I want to enable the preview 😉 |
|
Lets get this in. @mbien thanks for review and suggestions, @dschniedertuens-tc thanks for testing. |

Search results (multi file search), refactoring (search usages, renaming) and bookmarks all have preview panes, that allow users to see the context for the selected entry:
When this was added to search usages via #7694 there was already the idea to make the preview toggleable. This PR adds toggles for preview to all the locations:
Refactoring in general (useful in "Find usages", less so in "Renaming", but setting is stored per use-case, so user is free to disable preview for "Find usages" and enable it for "Renaming"):
Search results
Bookmarks
Closes: #8112