Address code issues in JetBrains and Visual Studio Code
To address a code issue in JetBrains and Visual Studio Code, you will either have the option to generate an in-place fix or generate an explanation that you can use to manually update your code.
You can take the following actions:
-
Generate an in-place code fix
-
Explain the issue and get new code
-
Ignore the issue, or ignore all similar issues
Generate in place fixes for your file
If you open a code issue and see the Generate fix button, complete the following procedure to update your code in-place.
-
In the Code Issues tab, choose the code issue you want to address.
-
Choose the wrench glass icon to open the Code Issue Details panel, where Amazon Q will start generating a fix.
The following image shows the wrench icon for a code issue in Visual Studio Code.
-
Updated code appears in the Code Issue Details panel. You can perform the following actions:
-
Below the suggested code, choose Open diff to see a diff of the suggested code changes in the file where the code originated.
-
Below the suggested code, choose Copy to copy the code to your clipboard.
-
-
To apply the generated fix to your file, choose Accept fix at the bottom of the panel to replace the problematic code with the suggested code.
-
If the suggested code doesn’t satisfy your requirements, you can choose Regenerate fix to see an alternate solution.
-
When you apply the fix, the Code Issue Details panel closes, and the issue is automatically resolved and removed from the list of issues in the Code Issues tab.
-
Explain the code issue and get new code
If the code issue doesn’t include the Generate fix button, complete the following procedure to see an in-depth explanation of the issue and steps for resolving it manually in the chat panel.
-
In the Code Issues tab, choose the code issue you want to address.
-
Choose the magnifying glass icon to open the Code Issue Details panel.
The following image shows the magnifying glass icon for a code issue in Visual Studio Code.
-
At the bottom of the Code Issue Details panel, choose Explain.
-
The type of code issue and associated code are sent to Amazon Q in the chat panel. Amazon Q provides an explanation of the issue and suggests new code you can use to replace the problematic code.
-
To add the code to your file, you can choose Insert at cursor to add the new code where your cursor is in the file. You can also choose Copy and paste the code to your file yourself.
Make sure to remove the underlined code to replace it with the new code.
Ignore a code issue
If the code issue isn’t applicable, you can choose the ignore icon from the Code Issues tab to ignore the issue and remove it from the list of issues in the Code Issues tab.
The following image shows the ignore icon for a code issue in Visual Studio Code.

You can also choose Ignore from the Code Issue Details panel. The issue will be ignored and removed from the list of issues in the Code Issues tab. If you choose Ignore all from the Code Issue Details panel, this and other code issues with the same CWE will be ignored.