Autocomplete Missing for External Services Classes when here is namespace in the org

Issue #2579 open
Bozhidar Tyanev created an issue

Dynamic classes generated by the External Services are missing autocomplete and are not recognized by the plugin.

Step to Reproduce:

  1. Create a scratch org with a namespace. In my example, the namespace is called stepdry
  2. Follow the documentation example of creating and consuming an External Service
  3. Re-Generate the Offline Sybmol Table

    1. Optionally, you can restart the IDE, however, it does not help
  4. Create a class to try to consume the Dynamic Classes generated by the external service

  5. Observe that the code can be deployed, however, classes are not recognized (extServNoAutoComplete.png)

Additional Info

Not sure if helpful, but I noticed that you can actually instantiate the main service class without the namespace and it can be deployed successfully (validDeploy. png). However, you cannot instantiate its inner class without providing the namespace on the main class (invalidDeploy. png).

Comments (3)

  1. Scott Wells repo owner
    • changed status to open

    Thanks for logging. This week's build is in final testing, but after I get it out, it should be pretty straightforward to set up a scratch org with a namespace and populate it with external service definitions, then see what's needed to ensure the resulting stub Apex types are rendered into the OST properly.

  2. Scott Wells repo owner

    Okay, I populated an org with a namespace today with several external service registrations and looked at the resulting stub Apex classes in the org. Basically those classes end up in a nested namespace, ExternalService.<orgNamespace>. That’s a non-trivial fix in IC2 as it currently has a pretty broad assumption that namespaces have a single level of depth in Salesforce. However, based on a recent discussion with some folks in Salesforce engineering, it sounds like nested namespaces are starting to materialize in more and more places, so it’s something I will be addressing soon. Once I do, this will also be addressed, but until then, external service stub classes in namespaced orgs aren’t going to be quite correct.

  3. Log in to comment