viatra / EMF-IncQuery

This repository is only kept for historic reasons. All development happens on eclipse.org
http://eclipse.org/viatra
13 stars 4 forks source link

Code completion doesn't work in all cases for enums #369

Closed izsob closed 11 years ago

izsob commented 11 years ago

Code completion doesn't work for enumerations, for example while typing the second argument of the following pattern body condition:

Acquaintance.type(a1, AcquaintanceType::marriage);
szabta89 commented 11 years ago

@izsob Can you please share the metamodel/project that you are working on? I have tried it with a dummy ecore model and it worked fine for enums.

izsob commented 11 years ago

Now I see it's a special case. When I try to type Person.sex(P, Sex::female); and

istvanrath commented 11 years ago

I consider this a minor issue.

szabta89 commented 11 years ago

What I have found so far:

ujhelyiz commented 11 years ago

Look for the PrefixMatcher implementation. I think, that is what you are searching for. A simple one is added https://github.com/ujhelyiz/EMF-IncQuery/blob/master/plugins/org.eclipse.incquery.patternlanguage.emf.ui/src/org/eclipse/incquery/patternlanguage/emf/ui/contentassist/EMFPatternLanguageProposalProvider.java class - a new one can be added for enums.

szabta89 commented 11 years ago

@ujhelyiz Please take a look at the proposed fix.

ujhelyiz commented 11 years ago

After a minor cleanup I consider this issue fixed. Thanks, @szabta89.

@izsob please check it works for all your cases, and then close the ticket.

izsob commented 11 years ago

This works in most cases, so I close the ticket. Thank you for this useful enhancement! ((Although when I code-complete the enum class, then continue typing reaching the colon, the list is closed. Then code completion works only after typing all of the two colons: Person.sex(P, Se<Ctrl+Space>x:<Ctrl+Space>);))