salesforcedx-vscode icon indicating copy to clipboard operation
salesforcedx-vscode copied to clipboard

Autocomplete not working for implicitly imported Schema namespace

Open Feldhacker opened this issue 4 years ago • 2 comments

Summary

The Schema namespace is implicitly imported by Salesforce but is not available for autocompletion.

Steps To Reproduce:

  1. Create a new Apex class and method.
  2. Declare a variable like "SObjectField myField = null;"
  3. As you start typing "SObjectF", autocomplete should be available but is not.

Expected result

Autocomplete should work as expected for classes in the Schema namespace without having to fully-qualify them.

Actual result

Autocomplete is not available.

Additional information

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_schema_namespace_using.htm

VS Code Version: 1.46.0 SFDX CLI Version: sfdx-cli/7.60.0-e2bb2907cb win32-x64 node-v10.15.3 OS and version: Windows 10 Enterprise 1809

Feldhacker avatar Jun 17 '20 14:06 Feldhacker

Hi @Feldhacker - Thanks for the feedback. You do currently have to qualify the namespaces as you experienced. We'll consider this enhancement in the future as we tackle namespace-related items.

smaddox-sf avatar Jul 01 '20 21:07 smaddox-sf

Hey @smaddox-sf , I was wondering if there's any plans of getting this enhancement in? Currently, we do not use vsCode but were looking to move to use the extension. However, if every time in our code we need to qualify the namespace of the current package before an object or class name in our code for autocomplete to be available.... adoption of this in my team is going to be a little less than enthusiastic. Just thought I'd check for an update.... In terms of this happening for Schema object, it makes sense to an extent and that is relatively fine.. However this is happening for our apex classes as well. Ex. in class 1, want to reference a static method in class 2; To do this, I must call it like namespace.class2.method() auto complete will only detect the classes with the 'namespace.' in front.

ghost avatar May 19 '22 13:05 ghost