CodeWhisperer Tips and Tricks¶
Keyboard Shortcut¶
A keyboard shortcut is a series of keys we can press to trigger a codewhisperer action
- AWS Toolkit for Visual Studio Code
| Action | Keyboard shortcut |
|---|---|
| Manually trigger CodeWhisperer | MacOS: Option + C Windows: Alt + C |
| Accept a recommendation | Tab |
| Next recommendation | Right arrow |
| Previous recommendation | Left arrow |
| Reject a recommendation | ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch |
- Toolkit for Visual Studio
| Action | Keyboard shortcut |
|---|---|
| Manually trigger CodeWhisperer | Alt + C |
| Accept a recommendation | Tab |
| Next recommendation | Alt + . |
| Previous recommendation | Alt + , |
| Reject a recommendation | ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch |
- Toolkit for JetBrains
| Action | Keyboard shortcut |
|---|---|
| Manually trigger CodeWhisperer | MacOS: Option + C Windows: Alt + C |
| Accept a recommendation | Tab |
| Next recommendation | Right arrow |
| Previous recommendation | Left arrow |
| Reject a recommendation | ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch |
Pausing suggestions with Amazon CodeWhisperer¶
This chapter describes how to pause and resume automatic suggestions in CodeWhisperer
- VS Code

- In VS Code, choose the AWS logo from the left sidebar.
- Near the bottom of the VS Code window expand the Developer Tools section.
- Expand the CodeWhisperer section.
-
Choose Pause Auto-Suggestions or Resume Auto-Suggestions
-
JetBrains
-
In JetBrains, choose the AWS logo from the left sidebar.
- In the AWS Toolkit window, select the Developer Tools tab.
- Expand the CodeWhisperer section.
- Choose Pause Auto-Suggestions or Resume Auto-Suggestions
CodeWhisperer References¶
The CodeWhisperer reference tracker detects whether a code suggestion might be similar to particular CodeWhisperer open source training data. The reference tracker can flag such suggestions with a repository URL and project license information or optionally filter them out. You can then more easily find and review the referenced code and see how it is used in the context of another project before deciding to use it. All references are logged for you to review later to ensure that your code flow is not disturbed, and you can keep coding without interruption.
Viewing code references¶
To display the CodeWhisperer reference log in, use the following procedure.
-
VS Code
-
Make sure you are using the latest version of both VS Code and the AWS Toolkit.
- In VS Code, choose the AWS logo from the left side of the window.
- Open the Developer Tools dropdown menu.
- Choose Open Code Reference Log.
-
The code reference log will appear in the lower right part of the VS Code window.
-
JetBrains
-
Make sure you are using the latest version of both JetBrains and the AWS Toolkit.
- On the left side of the JetBrains window, choose the AWS logo.
- In the AWS Toolkit panel, select the Developer Tools tab.
- In the CodeWhisperer dropdown, choose Open Code Reference Log.
Turning code references off and on¶
With the reference log, you can view references to code recommendations. You can also update and edit code recommendations suggested by CodeWhisperer To turn them off, or to turn them back on later, use the following procedures.
-
VS Code
-
In VS Code, choose the AWS logo from the left side of the window.
- Open the Developer Tools dropdown menu.
- Open the Developer Tools dropdown menu.
- Next to the CodeWhisperer option, choose the gear icon.
- On the side of the VS Code window, the Settings tab will open, with the options related to CodeWhisperer displayed.
- Select or deselect the box under Include Suggestions with Code References.
2 JetBrains
- In IntelliJ, open Preferences.
- In the Preferences window, under Tools, under AWS, select CodeWhisperer.
- In the CodeWhisperer panel on the right, select or deselect the box labeled Include suggestions with code references.