SOQL completions include invalid options

Issue #2386 resolved
Aidan Harding created an issue

When I use Control+Space to get a list of possible fields to insert in the SOQL query window, the list includes options that are not valid for that position. For example, if I query TopicAssignment I get a suggestion like this:

If I want to filter by the object type that the TopicAssignment is for, I should choose EntityType. But, since SObjectType is offered, it's very tempting. ContextRecord is also not a valid choice here.

If possible, it would be good to filter this list to just things that are allowed in this context of a query field.

Comments (5)

  1. Scott Wells repo owner
    • changed status to open

    Yeah, SObjectType is inherited from SObject for use in Apex. I could certainly see that being filtered out when listing fields for selection. As for ContextRecord, that's coming from the Salesforce API and not something IC2 has fabricated. I hesitate to filter out anything reported by the API as being part of the SObject "schema".

  2. Scott Wells repo owner

    Fix committed for the next build. Now the list is filtered to be those that pass IC2’s isSObjectField filter (which should have already been happening). That eliminates things like SObjectType and fields, but it doesn’t eliminate things like ContextRecord which are reported by the Salesforce APIs as part of the schema for that SObject type.

  3. Log in to comment