Eclipse Luna (R): no content assist for Java 8 method references

前端 未结 2 822
借酒劲吻你
借酒劲吻你 2021-01-27 10:14

Eclipse Java EE IDE for Web Developers. Version: Luna Release (4.4.0) Build id: 20140612-0600


I\'m using the release version of Eclipse Luna for Java (Java EE), an

相关标签:
2条回答
  • 2021-01-27 10:53

    Looks like this might be Eclipse bug 430656.

    Method reference content assist does work in some places but not in 'invocation contexts'.

    0 讨论(0)
  • 2021-01-27 11:10

    A possible work-around: Eclipse Luna 4.4.0 and 4.4.1 does include support for method reference syntax, but not in the in-line context you're trying. It does work if you declare the method reference as a variable with a specific type, however. Like this:

    Function<String, Object> methodRef = String::valueOf;
    new LinkedList<String>().stream().map(methodRef);
    

    In this code, content-assist works correctly at the :: point.

    0 讨论(0)
提交回复
热议问题