VS code - SonalLint for Apex ( Salesforce )

VS Code - APex ( salesforce ) : Not able to see the problem , which says apex code have issues .
Please help how to configure for Apex ( Salesforce )

Hi,

Are you using connected mode? SonarApex is not packaged by default in SonarLint, it will be downloaded from your SonarQube server or from SonarCloud as soon as you use connected mode.

Please also open the SonarLint output, and copy/paste logs when you do a change in an Apex file.

Hi,

No , we are not using connected mode . Please let us know what is connected mode , so I can setup it in VS code

Thanking You,

Shiva Shankar

Hi,

ConnectMode ,I have setuped ie serverid , Serve, project Key and Token Right

INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ INFO: Total time: 433618:38:08.957s
INFO: Final Memory: 1M/123M INFO: ------------------------------------------------------------------------ ERROR: Error executing SonarLint ERROR: No SonarQube server configuration found in ‘D:\Users\sshank10.sonarlint\conf\global.json’ for the server id
defined in the project binding: ‘AV6aa_MllzJIQb-e9i9m’ ERROR: ERROR: To see the full stack trace of the errors, re-run SonarLint with the -e switch. ERROR: Re-run SonarLint using the -X switch to enable full debug logging.

Thanking You,

Shiva Shankar

Hello, did you manage to configure your project in connected mode?

Note that there are 2 parts to configure:

  • In your user settings, sonarlint.connectedMode.servers should contain an entry with your server URL and access token, e.g
{
    "sonarlint.connectedMode.servers": [
        {
            "serverId": "MySonarQubeServer",
            "serverUrl": "https://sonarqube.local",
            "token": "secret_token_from_my_sq_user_profile"
        }
    ]
}
  • In your project or folder settings, sonarlint.connectedMode.project should refer to the serverId you defined in the previous step
{
  "sonarlint.connectedMode.project": {
    "serverId": "MySonarQubeServer",
    "projectKey": "my.project.key:from-server"
  }
}

Closing this thread due to lack of activity.

Feel free to open a new thread if you still have an issue/question.