# SonarLint connected Mode VSCode

**URL:** <https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432>\
**Category:** VS Code\
**Tags:** vscode, connected\_mode\
**Created:** [May 11, 2020, 6:13am UTC](https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432 "2020-05-11T06:13:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitkumar2283](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/amitkumar2283/32/6103_2.png) [@amitkumar2283](https://community.sonarsource.com/u/amitkumar2283)\
**Post date:** [May 11, 2020, 6:13am UTC](https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432/1 "2020-05-11T06:13:48Z")

</div>

I am trying to use SonarLint in connected Mode, in conjunction with sonarqube enterprise server, but till now haven’t had the success.

Here is what I have tried:

Configured settings.json in VSCode

> “sonarlint.connectedMode.connections.sonarqube”: [  
> {  
> “serverUrl”: “[https://myEnterpriseSonarServer.com](https://myEnterpriseSonarServer.com)”,  
> “token”: “ef7ddc7b6c856cc”  
> }  
> ],  
> “sonarlint.connectedMode.project”:  
> {  
> “projectKey”: “conan-scripts”  
> }

- Questions:

To verify that my source code is analysed “while in connected mode”, I make a code change and check the sonarqube “token” page for the last access time for my token. For some reason, the token is not accessed (which should have been by vscode for connected mode).  
Also, the Active Rules defined on the connected project does not seem to sync to VSCode  
Here is the [package.json](https://community.sonarsource.com/uploads/short-url/eYgA9KzFzusP7TvewNElKGJFBvv.json) (16.3 KB) (which does not contained any information on connectedmode servers)

❓ How do I verify that the connected mode is established correctly on VSCode? is there a log that I can check?

Further, I see that below languages are supported by SonarLInt offline mode (and are available in my VSCode SonarLInt Rules as well).

- HTML
- Java
- JS
- PHP
- Python
- TS

❓ how do I check what languages are supported in connected mode? I would like to analyse a C project

---

<div class="post-metadata">

**Author:** ![Julien\_HENRY](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/julien_henry/32/61_2.png) [@Julien\_HENRY](https://community.sonarsource.com/u/Julien_HENRY)\
**Post date:** [May 11, 2020, 1:38pm UTC](https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432/2 "2020-05-11T13:38:44Z")

</div>

Hi,

> [@amitkumar2283](#):
>
> How do I verify that the connected mode is established correctly on VSCode? is there a log that I can check?

Yes, if you look at the SonarLint output, after enabling verbose logs, you should see this each time an analysis is triggered:

```auto
[Debug - 15:30:04.757] Analysis triggered on 'file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/scripts/prepare.js' with configuration: 
[
  projectKey: org.sonarsource.sonarlint.vscode:sonarlint-vscode
  baseDir: /home/julien/Prog/Projects/sonarlint/sonarlint-vscode
  extraProperties: {}
  inputFiles: [
    file:///home/julien/Prog/Projects/sonarlint/sonarlint-vscode/scripts/prepare.js (UTF-8) [js]
  ]
]

```

The presence of the `projectKey` attribute is a confirmation the connected mode is used.

> [@amitkumar2283](#):
>
> I make a code change and check the sonarqube “token” page for the last access time for my token. For some reason, the token is not accessed (which should have been by vscode for connected mode).

Connected mode is not reaching the server continuously. It is only contacting the server to fetch (and cache) some metadata needed to ensure SonarLint analysis will produce similar results than SonarQube/SonarCloud analysis (enabled rules, file exclusions, issue suppresion, …). To “refresh” the local storage of those metadata, you have to manually trigger it (use `SonarLint: Update all projects bindings to SonarQube/SonarCloud` action).

> [@amitkumar2283](#):
>
> how do I check what languages are supported in connected mode? I would like to analyse a C project

I agree the documentation is missing here. Only Apex and PL/SQL are added by using connected mode. C is not yet supported, you can follow/vote for:  
[https://community.sonarsource.com/t/sonarlint-for-vscode-c-c-support/4732](https://community.sonarsource.com/t/sonarlint-for-vscode-c-c-support/4732)

---

<div class="post-metadata">

**Author:** ![duncanp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/duncanp/32/293_2.png) [@duncanp](https://community.sonarsource.com/u/duncanp)\
**Post date:** [June 9, 2021, 11:37am UTC](https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432/3 "2021-06-09T11:37:16Z")

</div>

Split this topic on June 9, 2021, 11:37am UTC

A post was split to a new topic: [Connected mode configuration](https://community.sonarsource.com/t/connected-mode-configuration/44515)

---

<div class="post-metadata">

**Author:** ![duncanp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/duncanp/32/293_2.png) [@duncanp](https://community.sonarsource.com/u/duncanp)\
**Post date:** [June 9, 2021, 11:37am UTC](https://community.sonarsource.com/t/sonarlint-connected-mode-vscode/24432/4 "2021-06-09T11:37:35Z")

</div>

Closed on June 9, 2021, 11:37am UTC


