Sorting menu items


is it possible to create my own algorithm to sort menu completion items?

I tried to use the menu actions and the editor menu parts for that. If I create a "parameterized item" or "group of custom actions" I can return a list of items to display. Since it is a list (as opposed to a set), I thought the order of that list mattered, but it doesn't. Independently from the returned order, it seems that MPS does another sorting for displaying.

Is there a way to make the list order matter?



1 comment
Comment actions Permalink


As far as I can see, it's not possible now. You can define side transform actions, so corresponding actions will be populated into a menu available by Ctrl+Space, but sorting is more-less fixed by logic inside jetbrains.mps.nodeEditor.cellMenu.NodeSubstituteChooser.rebuildMenuEntries()... You can file request asking for such improvement.


Please sign in to leave a comment.