+ Start a Discussion
sslatersslater 

IDE code assist null pointer

Is the code assist in Spring 09 IDE supposed to work for Lists?

 

In this code:

 

public class test {
    String s;
    List<String> ll = new List<String>();
   
    public test() {
        ll.       
    }
}

 

if I hit ctrl-space after the ll., I get a null pointer exception in eclipse. Should it work on lists?

 

It also looks like it handles content-assist on std objects, but not custom objects? (objects, not classes)

 

Thanks!

 

 

Faustus404Faustus404

It's supposed to work, but you've encountered a bug.  The code assist is only working correctly for collection types defined in method scope, not is class scope.  The example below should work correctly.  I have fixed this in the code base and it will be available as part of our upcoming patch release. 

 

Content assist appears to be working correctly for CustomObjects, are you getting an exception in either the Force.com log or the PDE log?

 

public class test {
    String s;
        
    public test() {

        List<String> ll = new List<String>();
        ll.       
    }
}

sslatersslater

No errors but I tested again and it does work. It think it just needs to be saved or started on a new line to kick the plugin. It acts like the code completion routines in your plugin somehow detect a change and calculates the possibilities based on certain conditions like new line, a save, etc... So if I modify an existing line, it doesn't "kick" the code completion to re-calculate the options. But if I type cleanly, it works fine.

 

Thanks!

sslatersslater
Not to be pushy or anything. :-) but any hope of getting the F3 button to "follow" code and jump to methods and classes like the java eclipse editor does? That would be a lifesaver for trying to understand someone else's code.
Faustus404Faustus404

Our goal is to make the Apex editor every bit as fantastic as the Java editor.  The particular feature you're requesting is on our todo list :)