简体   繁体   中英

How to make code completion for Java 8 lambda parameters in Eclipse work?

Suppose I have an interface like this:

@FunctionalInterface
public interface ModifierFunction {

    Game applyModifier(Game game, Card card, Modifier modifier);
}

and some class where I use it:

SHOWDOWN_BUFF((game, card, modifier) -> {
    game. // <- I get no proposals from Eclipse here
    return game;
})

My problem is that if I press Ctrl + Space I can't see Game 's methods...in fact I get no proposals at all. It does not work if I use this syntax either:

SHOWDOWN_BUFF((Game game, Card card, Modifier modifier) -> {
    game. // <- I get no proposals from Eclipse here either
    return game;
})

How can I get code completion to work in Eclipse Luna for Java 8?

edit : I'm using Version: Luna Service Release 1 (4.4.1)

Parameter completion within Java 8 Lambda expression works with Eclipse Mars (4.5.0). https://www.eclipse.org/eclipse/news/4.5/jdt.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM