2

The Assert class does not appear to be available in VSCODE with extensions installed. While I can still use the class and its methods with no errors on Push , the editor complains about it and there is no IntellliSence available, so I resort to using System.assertEquals instead.

Is this a problem with my extension installation or is there an extension I am missing ?

I have tried

  • Installed lates Java JRE version v1.8.0_361
  • Updated 'Apex PMD: Jre Path path'. Had to use abbreviated path C:\Progra~1\Java\jre1.8.0_361 exension was complaining about "Program Files"
  • sfdx-project.json is version 55
  • Cleared cache by deleting .sfdx/tools/apex.db

But still Assert is not recognised.

Thank you

1 Answer 1

0

You can try to clear the cache (delete .sfdx/tools/apex.db), make sure you're using the latest version of the language server (e.g. update your Salesforce Extension Bundle), and make sure you have an appropriate version of Java is installed and configured. Also, make sure your sfdx-project.json file is using the latest API versions. The service that provides Intellisense auto-completion is the Apex Language Server, so you can also check the OUTPUT section of the terminal pane to make sure you're not getting any errors from the language server. Typically, the usual reason auto-complete doesn't work is because Java isn't installed or configured correctly.

3
  • Thank you I have - installed Java v17.0.6 and updated path in to it in VSCode - sfdx-project.json is using version 55 - Deleted .sfdx/tools/apex.db, but it has not yet regenerated Commented Mar 28, 2023 at 16:22
  • @RicardodaSilva After deleting it, the docs say you need to restart VS Code. If it's not generating, you likely have a Java problem. It's one of my least-favorite parts about the language server.
    – sfdcfox
    Commented Mar 28, 2023 at 16:23
  • Thanks for the replies, I have updated my question accordingly Commented Mar 28, 2023 at 16:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .