Is there a way to set up Amazon Code Whisperer in VS Code so that it only displays with a certain key command?

3.2k Views Asked by At

CodeWhisperer often offers up some code too quickly and interrupts my flow. It would be great to say "now" with a keyboard command to ask it to go into action.

Possible?

2

There are 2 best solutions below

1
Doug Seven On BEST ANSWER

Option+C (MacOS) or Alt+C (Windows) will manually trigger CodeWhisperer any time. You can go into the Developer Tools panel of the AWS Toolkit and click Pause Auto-Suggestions and then only manually trigger it.

1
Ricardo Sueiras On

One way you could do this is by using VSCode Keyboard short cuts. This would allow you to choose a set of keys that would toggle (enable/disable) CodeWhisperer from running.

From PREFERENCES>KEYBOARD SHORTCUTS in VSCode, search for "codewhisper" and this will highlight all the options.

I selected "aws.codewhisperer.enableCodeSuggestions" and then selected a key convenient to me. Now when I want to enable/disable, I can do this using that key combination.

enter image description here