+1
Under review

Code Completion question

Jason Hurder 11 years ago updated by Support 11 years ago 10
I'm not sure what the code completion methodology is, however it seems erratic to me. It looks like for standard datatypes like string, List, Map, ... all works well, but that is where it ends. Anytime you bring up code completion for anything else you see the same list of Objects that exist in the org, even for garbage code:


Image 15

Oddly, for declared objects, nothign comes up at all. As an example, if I declare :
Lead myLead;
myLead.     <-- Nothing shows up here. 
Same applies to SOQL queries, there is no code completion/Intellisense. Is there a compilation that needs to take place to create objects for this code completion to work?

Thank you,
Jason
Under review
Jason,

Sorry to hear that you are having issues. In the next update, we are making a several changes to the editor as well as to all the parsers, and especially to the way it handles autocompletion.

In the meantime can yo check to see you have a file completions.xml and apexModel.xml? Auto complete should be working for SOQL queries and the Lead example you provided. I've provided some examples of how it should look.

lead.png
soql.png
I do have those two files - apexModel is 227KB and dated 9/24/2012; completions.xml is 1,064KB and is dated 10/4/2013.

I do see that when I press '.' after a property, there is about a 3-4 second delay (assumedly a spin-up time to query what properties should appear).

Thanks,
Jason
We are looking into it. It's really strange that no values are popping up. The slight delay is the app calling into SFDC to obtain the values.
Thanks for the update.

Is there any setup required on the Salesforce side to allow this functionality to work properly?
We've been researching the issue and wanted to know are you behind a proxy? It sounds like for whatever reason, when the editor is calling to SFDC for the completion values, nothing is being returned. In the update coming out this weekend, we are adding in the ability test the editor against all the various definitions to avoid issues like this.
No proxy here. Just to validate that BrainEngine is able to connect appropriately to Salesforce I turned on Fiddler to see that traffic is flowing, sure enough the app is pulling down all the metadata from SF:


Not sure if this helps, but it looks like the data is coming into the application as expected.
Thanks for the info. We believe we have found where the issue is and running some tests. Is it possible, can you try the sample class to see if any fields are returned back from SFDC? One of the issues with apex is that SFDC doesn't provide the grammar behind it which requires us to build one from scratch. In addition to adding in some enhancements to the editor we are also updating the parsers as well

public class Hello {
//comment
public void hello(){
Account accnt = new Account();
//see if we can get the list of fields from SFDC
//account.
}}
Yes - this works! After testing this, I realize that I never tested a class for this functionality, only my triggers. After checking other classes for functionality, it indeed is working correctly.

The example I gave originally is not working for a trigger, and I failed to mention this in my original post....my apologies for that.
No worries. In the final release, we are enhacning the way we do triggers as well.
Jason,

We made some enhancements to the editor in the new update. You can download it from here:

http://files.brainengine.net/release/6/setup.exe

You will have to uninstall your current version before installing this one. Also, please make sure you make a backup of the env and options.xml files to preserve your settings and project definitions.