Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apex extension stopped working in big repos #5529

Closed
mnunezdm opened this issue Apr 5, 2024 · 8 comments
Closed

Apex extension stopped working in big repos #5529

mnunezdm opened this issue Apr 5, 2024 · 8 comments

Comments

@mnunezdm
Copy link

mnunezdm commented Apr 5, 2024

Summary

Since a couple of weeks / maybe days, most of the functionality of the apex extension stopped working in our main repo.

We have a big organization with a lot of apex classes (7000 apex classes), I think this has something to do, because in a smaller org that we have, it works as always

I'm unable to:

  • Use the lightning replay debugger
  • Use the get debug logs
  • Autocompletion
  • Execute anonymous apex
  • Run tests from file, as the option does not appear under the decorators
  • List test classes

Deployment / retrieval, seems to be working, soql is also working

Steps To Reproduce:

  1. Run any of those commands

Expected result

The commans to work

Actual result

The commands not working, it appears the activating extensions bottom bar action for a couple of seconds and the disappear

Additional information

working repo

WORKING

not working repo

Grabación de pantalla 2024-04-05 a las 17 23 36

execute anonymous

Salesforce Extension Version in VS Code: v60.7.0

SFDX CLI Version: @salesforce/cli/2.35.6 darwin-arm64 node-v20.11.1

OS and version: mac os sonoma 14.4.1

VS Code version: 1.88.0

@mnunezdm mnunezdm changed the title Apex extension stopped working Apex extension stopped working in big repos Apr 5, 2024
@mingxuanzhangsfdx
Copy link
Member

Hi @mnunezdm , could you pop up command palette (cmd+ shift + p), choose Developer: Show Running Extensions and see if all salesforce extensions have been loaded (from you info, it looks like Apex, Apex Replay Debugger are failing)?

Then could you pop up command palette (cmd+ shift + p), choose Developer: Toggle Developer Tools and see if there are any errors?

Also, could you check the output of Apex Language Server (pop up with cmd + shift + u) and any other extensions and see if there are errors?

@mnunezdm
Copy link
Author

mnunezdm commented Apr 6, 2024

Hello!

Apex is in activating state

image

I cannot find the apex replay debugger, but I think that extension is launched after the Apex one

The only warning I could find related to this is in the developer toots is this one

 WARN [mainThreadStorage] large extension state detected (extensionId: salesforce.salesforcedx-vscode-core, global: true): 1348.978515625kb. Consider to use 'storageUri' or 'globalStorageUri' to store this data on disk instead.

This is the output of the extension

11:30:11.838 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types.
11:30:11.885 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Scanning built-in Apex types.
11:30:11.889 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Collecting built-in standard types from jar
11:30:13.455 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Done collecting built-in standard types from jar
11:30:13.456 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Scanning Apex Standard Library.
11:30:14.472 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Done scanning Apex Standard Library.
11:30:14.479 [Apex Prelude Service STARTING] INFO  a.j.l.i.s.ApexPreludeManagedService - Starting ApexIndexer.
11:30:14.480 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Start indexer.
11:30:14.512 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types.
11:30:14.512 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning workspace source.
11:30:20.667 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Building change list.
11:30:22.412 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Applying found changes
11:30:22.416 [ApexIndexer STARTING] INFO  a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Creating 7249 Apex artifacts in Apex DB
abr 06, 2024 11:30:31 A. M. apex.jorje.parser.impl.BaseApexLexer dedupe
INFORMACIÓN: Deduped array ApexLexer.DFA22_transition. Found 7075545 shorts which is 13MB not including array overhead. Removed 6418975 shorts which is 12MB not counting array overhead. Took 54 ms.

@mnunezdm
Copy link
Author

mnunezdm commented Apr 6, 2024

First I tried to rename the apex.db in the .sfdx folder with no success

After that I tried renaming the .sfdx folder in my workpsace and automatically the get apex debug logs started working

@daphne-sfdc
Copy link
Contributor

What is your Java version? We currently support Java 11 and 17. If you have a supported Java version, try the below:

Since this is looks like a project-specific issue, can you do the following to get your project into a very clean state?

  1. In the Explorer view of the sidebar, delete the .sfdx and .sf folders.
  2. Run Developer: Reload Window from the command palette.
  3. Re-authorize to your org.

Then check again to see if your Apex extension is able to activate.

Copy link

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

@github-actions github-actions bot added the stale label Apr 17, 2024
@mnunezdm
Copy link
Author

Hello!

I have found what was causing the plugin to stop working after a while

This has something to do with the SOBject refresh, I had this setting active in my project salesforcedx-vscode-core.enable-sobject-refresh-on-startup and some minutes after deleting the .sfdx/.sf folder and reloading window the plugin stopped working again

Disabling that check makes the plugin to stop failing

@peternhale
Copy link
Contributor

@mnunezdm I was wondering in you could enumerate the exact steps you are taking to get the vscode session into a bad state.

@github-actions github-actions bot removed the stale label Apr 20, 2024
Copy link

This issue has not received a response in 7 days. It will auto-close in 7 days unless a response is posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants