Install Free
VS Code | Using SonarQube for IDE | AI capabilities

AI capabilities in your IDE

On this page

AI features are only available when running in connected mode with SonarQube Cloud Team and Enterprise plans.

AI CodeFix in your IDE

AI CodeFix is an Early Access feature that generates AI-generated fix suggestions in SonarQube Cloud and SonarQube for VS Code. It must be activated by an Organization Admin in SonarQube Cloud. See Enabling AI-generated fix suggestions in the SonarQube Cloud documentation for more details.

About AI CodeFix

Running SonarQube for VS Code in connected mode with SonarQube Cloud is required to get AI-generated fix suggestions in your IDE. See the Connected mode setup page for details.

The suggestions are generated using the LLM selected when enabling the feature in SonarQube Cloud. Please see the enabled Enabling AI-generated fix suggestions instructions for more details. 

Getting AI-generated fix suggestions

With AI-CodeFix enabled in SonarQube Cloud, issues eligible for an AI-generated fix are identifiable by the ✧˖° icon found in the SonarQube for VS Code Quick Fix menu. You may need to restart your IDE if the feature was recently enabled in SonarQube Cloud and the server has not yet synced with SonarQube for VS Code.

To generate a fix suggestion:

  • In VS Code, select an issue in the PROBLEMS view panel or click the lightbulb in the left margin of the VS Code editor to reveal available Quick Fixes for your issue.
  • Select SonarQube: ✧˖° Fix with AI CodeFix ‘<YOUR_ISSUE_DESCRIPTION>’
    • An AI CodeFix snippet, or series of snippets if your issue is an injection vulnerability or something like a duplicated string that requires multiple snippets, will be generated and displayed with a diff view in the REFACTOR PREVIEW view panel. 
  • To open a contextual diff view, select the checkbox and click on the snippet in the REFACTOR PREVIEW view panel. 
  • Select the snippets you would like to keep, and then select Apply or Discard to accept or decline the AI CodeFix suggestion and close the REFACTOR PREVIEW view panel.
Select your AI-generated fix suggestion (the AI CodeFix feature) in the REFACTOR PREVIEW view panel to see the diff view in the code editor.

It's also possible to use the Open in IDE button from SonarQube Cloud to navigate to your issue in the code editor. See the article on Opening issues in the IDE for more information.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License