Skip to content

each on a collection is not enough promoted on content assist #674

Open
@mauromol

Description

@mauromol

Somewhat related to #411.

Consider the following code:

new List().eac|

Invoke content assist at "|": it's quite clear and obvious that I want to invoke one of the each methods supplied as DGMs, but Greclipse as a first option shows forEach method.
I understand that content assist priority is currently determined first by group, than by name matching (giving more priority to class methods rather than DGMs), but I personally think that prefix and exact matches should ALWAYS be given maximum priority. It's even more evident when you type new List().each| and invoke content assist, it's quite natural that Greclipse should suggest each before forEach.

Also, the implementation detail on how DGMs are provided by Groovy I think should be, as said, an implementation detail to the Groovy developer: from a developer (I mean, consumer of Greclipse) point of view, the fact that each is not defined on List but rather as a DGM should not matter in any way. It could be reasonable to give DGMs less relevance (like you do for methods deeply inherited in class hierarchy) than methods directly defined in the declared type, but IMHO prefix vs substring matching should be the first priority factor when deciding what to show first.

After all, if I want to type each (and I know I want to type each) it's annoying that Greclipse suggests me that I want to type forEach instead, especially when you have content assist auto activation and you then type a trigger character.
Also consider that, in this particular case, each, even though defined as a DGM for Object, fits perfectly and naturally on collection classes and in this way Greclipse makes it "hard" to use.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions