Bug 537617 - Minimap should appear in editor's 'Show In' context menu
Summary: Minimap should appear in editor's 'Show In' context menu
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.9   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 552125
Blocks:
  Show dependency tree
 
Reported: 2018-08-02 10:12 EDT by Dani Megert CLA
Modified: 2020-05-22 10:07 EDT (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2018-08-02 10:12:29 EDT
4.9 M2.

Minimap should appear in editor's 'Show In' context menu.
Comment 1 Mickael Istria CLA 2018-11-19 16:09:30 EST
Resetting target version and assignee as I don't see it guaranteed for 4.10 due to other priorities, and this can also be an opportunity of improvement for a fresh contributor.
@Angelo: if you think you'll be able to work on it soon, please retarget for 4.10.RC1 or other.
Comment 2 Eclipse Genie CLA 2019-09-26 15:06:10 EDT
New Gerrit change created: https://git.eclipse.org/r/150213
Comment 3 Pierre-Yves Bigourdan CLA 2019-09-26 15:07:05 EDT
This sounds like a nice feature. The minimap is a brilliant feature, but not many users know about it yet.

The submitted patch does not quite work, but is what I've come up with so far. I've followed a similar pattern to what I've found in other parts of the Platform, old blogposts (https://czetsuya-tech.blogspot.com/2010/02/how-to-open-view-using-eclipse-rcps.html) and the forums (https://www.eclipse.org/forums/index.php/t/109369).

The minimap appears in the menu and does successfully invoke the ShowViewHandler, however, the viewId parameter is not passed in and the handler defaults to showing the "Show View" dialog.

Can someone more familiar with the platform please help out?

As a side note, the new minimap entry will appear in any showInMenu, not just in the context of text editors, but we can refine that once basic functionality works. :)
Comment 4 Dani Megert CLA 2019-09-27 05:52:33 EDT
(In reply to Pierre-Yves B. from comment #3)
> Can someone more familiar with the platform please help out?
Kalyan, if you find some time, please help.
Comment 5 Karsten Thoms CLA 2019-10-15 09:25:58 EDT
The command parameter is not passed in as parameter of the event in ShowViewHandler.

I looked deeper and it looks as if command parameters are not passed in at all. In org.eclipse.ui.internal.ShowInMenu.fillMenu(IMenuManager) CommandContributionItemParameter instances are created. They contain a 'parameters' map, but this is not populated here. Thus ParameterizedCommand's are created without parameters.

I'm not sure yet if this is intended or a bug.
Comment 6 Karsten Thoms CLA 2019-10-15 15:21:20 EDT
This was a bit hard to find. Other contributions to the Show In menu use a perspective extension. The proposed patch did use a different pattern which IMO should be valid, too.

I've opened bug#552125 and provided a patch that makes this here work.
Comment 7 Pierre-Yves Bigourdan CLA 2019-10-15 16:58:48 EDT
Thanks for helping Karsten!

(In reply to Pierre-Yves B. from comment #3)
> ... and the forums (https://www.eclipse.org/forums/index.php/t/109369).

I meant https://www.eclipse.org/forums/index.php/t/109369/ with the "/" at the end! Surprisingly, omitting the trailing "/" leads to a completely different thread...
Comment 8 Pierre-Yves Bigourdan CLA 2019-10-16 14:42:35 EDT
I tried refining my patch by only showing the menu item when right clicking in an active editor. It makes no sense to have Show In -> Minimap as an option when selecting a folder in Project Explorer for example. However, I seem to have hit another bug making this impossible, Bug 512790.
Comment 9 Eclipse Genie CLA 2019-10-16 17:23:14 EDT
New Gerrit change created: https://git.eclipse.org/r/151198
Comment 10 Nitin Dahyabhai CLA 2019-10-16 17:27:07 EDT
(In reply to Eclipse Genie from comment #9)
A different approach that's extensible for owners of other editors, like me.
Comment 11 Eclipse Genie CLA 2019-10-17 09:16:38 EDT
New Gerrit change created: https://git.eclipse.org/r/151242
Comment 14 Andrey Loskutov CLA 2019-10-21 03:01:53 EDT
(In reply to Eclipse Genie from comment #13)
> Gerrit change https://git.eclipse.org/r/151198 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.text.git/commit/
> ?id=fd1487044dc6a945dc3b5225767f36c040bab041

Nitin, do you plan to support additional patches for Java / StructuredText editors?
Comment 15 Nitin Dahyabhai CLA 2019-10-21 12:55:47 EDT
(In reply to Andrey Loskutov from comment #14)
They shouldn't need anything, as they'll inherit the target ID list via the class hierarchy.
Comment 16 Andrey Loskutov CLA 2019-10-21 13:19:34 EDT
(In reply to Nitin Dahyabhai from comment #15)
> (In reply to Andrey Loskutov from comment #14)
> They shouldn't need anything, as they'll inherit the target ID list via the
> class hierarchy.

Have you tried it? It doesn't work.
Comment 17 Nitin Dahyabhai CLA 2019-10-21 13:26:51 EDT
(In reply to Andrey Loskutov from comment #16)
> Have you tried it? It doesn't work.

I had not, and you're right. Both already return curated lists of their own. The plain Text Editor, though, will have it, so those should likely be their own bugs, especially since they might be implemented in different ways.
Comment 18 Andrey Loskutov CLA 2019-10-21 13:28:21 EDT
(In reply to Nitin Dahyabhai from comment #17)
> (In reply to Andrey Loskutov from comment #16)
> > Have you tried it? It doesn't work.
> 
> I had not, and you're right. Both already return curated lists of their own.
> The plain Text Editor, though, will have it, so those should likely be their
> own bugs, especially since they might be implemented in different ways.

Will you create the bugs/patches? Most prominent are Java and Structured Text editors.
Comment 19 Eclipse Genie CLA 2019-10-21 14:21:21 EDT
New Gerrit change created: https://git.eclipse.org/r/151404
Comment 21 Pierre-Yves Bigourdan CLA 2019-11-23 14:54:22 EST
What is the status of this piece of work?

* there's my unmerged patch which provides working functionality; it could be improved even further once Bug 512790 is solved.
* other patches have been merged in the meantime, but do not provide working functionality.
* no other bugs or patches have been raised to make things work for the IDE's main editors.

If it was decided that my patch was less good than some alternative approach, simply telling me so with a short explanation would be appreciated. It would also avoid me and others (for instance Lars: https://git.eclipse.org/r/c/150213#message-24dc8a55_38b65755) wasting their time on a patch that is actually rejected. ;)
Comment 22 Karsten Thoms CLA 2019-11-25 10:46:21 EST
For 4.14 it is already too late. Let's schedule it for early 4.15.
Comment 23 Lars Vogel CLA 2020-04-16 07:37:41 EDT
(In reply to Pierre-Yves B. from comment #21)
> What is the status of this piece of work?
> 
> * there's my unmerged patch which provides working functionality; it could
> be improved even further once Bug 512790 is solved.

The above bug is solved, does this allow you to update your Gerrit?
Comment 24 Pierre-Yves Bigourdan CLA 2020-04-16 13:49:50 EDT
(In reply to Lars Vogel from comment #23)
> (In reply to Pierre-Yves B. from comment #21)
> > What is the status of this piece of work?
> > 
> > * there's my unmerged patch which provides working functionality; it could
> > be improved even further once Bug 512790 is solved.
> 
> The above bug is solved, does this allow you to update your Gerrit?

It's not actually solved, but rather marked as duplicate... :)
Comment 25 Alexander Kurtakov CLA 2020-05-22 10:07:19 EDT
Remove target platform.