You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by "Alexander Graf (JIRA)" <ji...@apache.org> on 2018/09/03 21:34:02 UTC

[jira] [Updated] (NETBEANS-326) Autocomplete does not work inside a lambda expression

     [ https://issues.apache.org/jira/browse/NETBEANS-326?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Graf updated NETBEANS-326:
------------------------------------
    Component/s:     (was: cnd - Code Completion)
                 java - Editor

> Autocomplete does not work inside a lambda expression
> -----------------------------------------------------
>
>                 Key: NETBEANS-326
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-326
>             Project: NetBeans
>          Issue Type: Bug
>          Components: java - Editor
>    Affects Versions: 8.2
>         Environment: Windows 10 Enterprise
>            Reporter: Morgan M
>            Priority: Minor
>              Labels: patch, usability
>         Attachments: RLtLF.png, t51Jz.png
>
>
> When declaring an object with a lambda expression, autocomplete for variables inside the lambda does not seem to work, and instead I see global variables, suggestions for keywords amongst other things as shown below.
> {code:java}
> public class SOInner {
>     private ActionListener listenerExampleLambda = e -> {
>         //autocomplete DOES NOT work for these vars
>         int testVarInner = 2;
>         int testVarInner2 = 4;
>     };
>     private ActionListener listenerExampleClass = new ActionListener() {
>         @Override
>         public void actionPerformed(ActionEvent e) {
>             //autocomplete works for these vars
>             int testVarInner = 2;
>             int testVarInner2 = 4;
>         }
>     };
>     private Comparable<SOInner> comparableExampleLambda = o -> {
>         //autocomplete DOES NOT work for these vars        
>         String testString = "Hello";
>         String testString2 = "Hi";        
>         return 0;
>     };
>     private Comparable<SOInner> comparableExampleClass = new Comparable<SOInner>() {
>         @Override
>         public int compareTo(SOInner o) {
>             //autocomplete works for these vars
>             String testString = "Hello";
>             String testString2 = "Hi";
>             return 0;
>         }
>     };
> }
> {code}
>  You can reproduce the bug by placing your cursor inside the lambda expression under the String variables and pressing Ctrl+Space. You will notice that testString and testString2 do not appear. They do appear if these steps are reproduced from within an anonymous inner class.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists