Skip to content

Commit ebc7b49

Browse files
committed
Update Show In MRU when triggered from Open Resource dialog
Using Show In from the Open Resource dialog, either via the dropdown or the implicit action on a non-file selection, opened the target view but never updated the most-recently-used order. Both paths call showView and IShowInTarget.show directly instead of the Navigate > Show In command, so WorkbenchPage.performedShowIn was never invoked and the MRU list stayed unchanged. Promote the used target via performedShowIn after a successful show, so the Open Resource dialog feeds the same MRU as the regular Show In. Fixes #4058
1 parent afada46 commit ebc7b49

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/dialogs/OpenResourceDialog.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ public void run() {
126126
try {
127127
view = page.showView(targetId);
128128
IShowInTarget target = getShowInTarget(view);
129-
if (!(target != null && target.show(getContext(null)))) {
129+
if (target != null && target.show(getContext(null))) {
130+
if (page instanceof WorkbenchPage workbenchPage) {
131+
workbenchPage.performedShowIn(targetId);
132+
}
133+
} else {
130134
page.getWorkbenchWindow().getShell().getDisplay().beep();
131135
}
132136
} catch (PartInitException e) {
@@ -353,6 +357,8 @@ private boolean showSelectionInFirstShowInTarget(IStructuredSelection selection)
353357
IShowInTarget target = Adapters.adapt(view, IShowInTarget.class);
354358
if (target == null || !target.show(new ShowInContext(null, selection))) {
355359
activePage.getWorkbenchWindow().getShell().getDisplay().beep();
360+
} else {
361+
workbenchPage.performedShowIn(descriptor.getId());
356362
}
357363
} catch (PartInitException e) {
358364
StatusManager.getManager().handle(new Status(IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH,

0 commit comments

Comments
 (0)