The Code Whisper Magic with Amazon Code Whisperer
Tags: beginners, productivity, ai, java
Published: 2023-10-26 22:15:32

## Amazon CodeWhisperer 

A coding companion that is intended to improve developer efficiency and productivity with **AI Power**

##Features of Code Whisperer

>  **Supports Multiple programming languages and IDEs**
CodeWhisperer supports 15 programming languages and can be used in several IDEs and code editors

> **Languages Supported**
>    - Java
>    - Python
>    - Java Script
>    - Type Script
>    - C#
>    - Script
>    - Ruby
>    - Go
>    - PHP
>    - C++
>    - C
>    - Shell
>    - Scala
>    - Rust
>    - Kotlin
>    - SQL

> **IDE Supported**

> -     Amazon SageMaker Studio
> -        JupyterLab
> -       Visual Studio Code
> -   IDEs produced by JetBrains
> -   AWS Cloud9
> - AWS Lambda console

---



> **Boost the speed of any coding process**
> - CodeWhisperer can understand comments given in natural language and generate multiple code ideas in real time. This tool has the potential to dramatically increase developer productivity by offering relevant code recommendations rapidly.

---


> **CodeWhisperer accelerates the implementation of unit tests** 
> - It effectively incorporates logic for the majority of the explicit unit tests required and also makes suggestions for edge cases that may have gone unnoticed, increasing test coverage and ensuring comprehensive testing beyond what was initially planned.

---

## How CodeWhisperer generate code?

- **Prompts** are the comments that you add to your code.
- CodeWhisperer uses your prompts to make suggestions.
- CodeWhisperer can create an entire function based on a comment that you add to your code in supported languages, and it adds the function to your code **line by line**, where you can review each line before accepting it.

## Keyboard shortcuts for Amazon Code Whisperer



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gxhiqfbs11l5wvdnax3q.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aey0khrod8h71bbhq4ae.png)

---


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5sp9lz1am4eltpcx4pm.png)

---



## Demo : AWS CodeWhisperer integration with Cloud9 IDE 


<u>Prerequisite</u>

- An EC2 Environment created in Cloud9

<u>To activate CodeWhisperer in the AWS Cloud9 console code editor, complete these steps.</u>

- Navigate to AWS Cloud9 Console 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/psh5pyacwya1az8h1el6.png)

- Click Open link beside your Cloud9 Ec2 environment


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uc3f6vnl7cz2a59s6i9p.png)

- Go to **Preferences**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9lo8ehfxitir7ou4w2e.png)

- Ensure that the two options related to Code Whisperer is enabled on Project Settings --> AWS Toolkit


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ckhht3ohpu6l3815ijhr.png)




- From inside your existing AWS Cloud9 environment, choose the AWS logo on the left edge of the window. 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kp3f0agd8ch3zbavprwz.png)

- A panel will expand rightward.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gn08bte98vop6lv1b0gn.png)

- In the lower part of the panel, under Developer tools, open the CodeWhisperer dropdown and choose **Enable CodeWhisperer**




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2wqhypigujz3nqqkarkx.png)

---

**The following YouTube video illustrates the Creation of java program in Amazon Cloud9 IDE using Amazon Code Whisperer**


{% embed https://www.youtube.com/watch?v=Lj_B_jwvpYs %}

**Note: Delete the cloud9 ec2 environment after use**