salesforcedx-vscode: Autocomplete / IntelliSense not working

Summary

Autocomplete / IntelliSense not working for Apex code. On both SObjects and built in Apex functions.

Steps To Reproduce:

  1. Open Salesforce project, with existing classes.
  2. Run sfdx sobject definitions refresh -u ORG_NAME
  3. Type something and wait for the autocomplete

Expected result

Should show autocomplete/IntelliSense or snippet suggestion

Actual result

No autocomplete suggestions.

Additional information

SObject definitions pull in nicely.

Screenshot_2

Autocomplete doesnt work so nicely.

Screenshot_1

Additional information VS Code Version: 1.44.2 SFDX CLI Version: 7.56.1-2773b53bf5 OS and version: Windows 10 Home, Version 1909 JAVA Version: jdk-11.0.7

Have tried using various environments, both sandboxes and scratch orgs. Projects have very few apex classes, or any other components.

Test Classes do work very nicely, and I have double checked my JAVA_HOME/JDK_HOME paths (in addition to adding "salesforcedx-vscode-apex.java.home": "C:\\Program Files\\Java\\jdk-11.0.7", to preferences.

Apex Language Server output log

19:59:22.493 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types.
May 03, 2020 7:59:23 PM apex.jorje.parser.impl.BaseApexLexer dedupe
INFO: Deduped array ApexLexer.DFA22_transition. Found 7075527 shorts which is 13MB not including array overhead. Removed 6418975 shorts which is 12MB not counting array overhead. Took 12 ms.
19:59:26.822 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Patching standard library for System.Database.* methods
19:59:26.832 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Done patching standard library for System.Database.* methods
19:59:28.150 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types.
19:59:28.154 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types took 5659 ms.
19:59:38.908 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types took 10740 ms.

Other related issues https://github.com/forcedotcom/salesforcedx-vscode/issues/2095 https://github.com/forcedotcom/salesforcedx-vscode/issues/920 https://github.com/forcedotcom/salesforcedx-vscode/issues/935

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 2
  • Comments: 18 (5 by maintainers)

Most upvoted comments

autocomplete is not working on trigger files it works on certain variables but not work on other ones

image

image (it shows no suggestions)

(no errors on apex language server) vscode: 1.51.1 java: 11.0.9

Is there a work-around for this issue? Barring that, is there a specific version set (VSCode, SFDX) that I can install to get fully-functional autocomplete for Apex classes? For what it’s worth, I’m seeing the same logging output for the Apex Language Server.

Does the ‘refresh object definitions’ sfdx command somehow solve your issue? Its been deemed to solve some autocomplete issues in the past, but I have no idea if it will help in your case with the trigger/apex. Thought I’d ask because i dont see mention of that factor here.

– Sent from Gmail Mobile

Was about to comment that new triggers are working for me as well! That is really strange that old ones are not.