Improve Apex Autocomplete
See original GitHub issueSummary
When Autocomplete is run on an SObject, it returns Global objects (EG System
, ApexPages
), which are not valid given the current instance context. It also only returns a very limited set of fields.
Steps To Reproduce:
- Create new class call testing
- Add the following code:
public class Testing {
public Testing() {
Account acc = new Account();
acc.
}
}
- Trigger a completion request on
acc.
Expected result
I would see the SObject Instance methods and all of it’s fields (including custom fields)
Actual result
I see the SObject instance methods, the global System namespaces & and very limited set of fields.
Additional information
VS Code Version: 1.26.0
SFDX CLI Version: salesforcedx@pre-release
OS and version: osx 10.12.6
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (5 by maintainers)
Top Results From Across the Web
IDE: Autocomplete for Apex and Visualforce code
Hoping we get intellisense / auto-completion done for Eclipse IDE at minimum for Apex anywhere soon. Lightning support would be good to, but...
Read more >Implementing autocomplete suggestion for record ids
The first approach that comes to my mind is to prefetch record IDs of all records in the org and then match on...
Read more >Performance of text field with autocomplete — oracle-tech
I am using APEX 22.1.1. I'm using a text field with autocomplete. It's based on a varchar2 column that has +14k record. Performance...
Read more >How to Enable Intellisense Support for Salesforce Apex Code ...
In this blog, we will look into how to enable Intellisense support for Salesforce metadata. Enabling this feature will increase code writing ...
Read more >A glimpse of the APEX 22.2 new features - Autocomplete - Insum
The Autocomplete item has been reimagined as a native APEX web-component and provides a more streamlined user experience, support for icons, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Adding to the List…
I can’t seem to get
static
variables and functions to auto-complete either.IMO the lack of decent auto-complete really is the biggest productivity killer.
Is there a team working on this? I understand the challenging of building AST, but other multiple other individuals have been able to do a pretty decent job of it…
Seems like a company as big as salesforce should be able to figure out how to write autocomplete for their own language pretty easily
PS: I’m not trying to be snarky, I’m just sincerely wondering this issue is a priority.
@ChuckJonas -
[Context] " it returns Global objects (EG System, ApexPages)" – yes this is a known issue right now. We show a lot of the global namespaces as a fallback. We should probably disable this.
[SObjects] Did you do a “SFDX: Refresh SObject Defintions” after you have connected to an org? See https://github.com/forcedotcom/salesforcedx-vscode/tree/develop/packages/salesforcedx-vscode-apex#enable-code-smartness-for-sobjects for more information.
We need to do an
sobjectdescribe
on the org to get the information – yes, this deviates a bit from our SFDX model but the org currently still has the most information about the standard objects, custom fields, and custom objects.