CodeWhisperer - Getting Started



It is very easy to start working with Amazon CodeWhisperer. Whether you are a beginner or an experienced programmer, it can significantly enhance your coding efficiency.

With the help of a few easy steps, you can install, configure, and start using CodeWhisperer in your preferred IDE.

Prerequisites for Using CodeWhisperer

Before start working with Amazon CodeWhisperer, you need to fulfill the following prerequisites −

AWS Account

To use Amazon CodeWhisperer, you must have an Amazon Web Services (AWS) account. If you do not have an AWS account, you can create it for free on AWS website. Once created an account, you now need to log in to the AWS Management Console.

Integrated Development Environment (IDE)

CodeWhisperer works well with several popular IDEs such as Visual Studio Code, IntelliJ IDEA, CLion, GoLand, WebStorm, Rider, PhpStorm, PyCharm, RubyMine, DataGrip, and AWS Cloud9.

You must have one of these IDEs installed on your machine. If you do not have any, you can download and install the IDE of your choice before proceeding.

Supported Programming Languages

CodeWhisperer currently supports programming languages like Java, Python, JavaScript, TypeScript, C#, GO, PHP, Rust, Kotlin, SQL, Scala, C, C++.

Before starting to work with CodeWhisperer, it is recommended to ensure that your project is using one of these supported languages so that it can provide you with relevant suggestions.

AWS Toolkit

You will also need to have the AWS Toolkit installed in your IDE. The AWS Toolkit is a plugin that integrates your IDE with AWS services, including CodeWhisperer.

How to Install and Configure CodeWhisperer?

Follow the steps given below to install and configure Amazon CodeWhisperer −

Step 1: Install AWS Toolkit in Your IDE

First, you need to install AWS toolkit in your preferred IDE. For example, if you're using Visual Studio Code, you can search for the AWS Toolkit in the Extensions Marketplace and install it. For IntelliJ IDEA, you can find the AWS Toolkit in the Plugins section.

Once the AWS Toolkit is installed, you need to restart your IDE to activate the plugin.

Step 2: Enable Amazon CodeWhisperer

After installing the AWS Toolkit, first open the AWS Toolkit panel in your IDE. Now, find the Amazon CodeWhisperer under the list of available services and enable it. You may need to log in to your AWS account to authenticate the service.

Step 3: Connect to Your AWS Account

If you are not already signed in, you will need to sign in to your AWS account using the username and password you used to set up your AWS account. This step is very important as it allows CodeWhisperer to access your coding environment and provide suggestions based on your code.

Step 4: Configure the Settings

You can easily configure CodeWhisperer settings as per your needs. For example, if you want to customize CodeWhisperers suggestions, go to the settings in your IDEs AWS Toolkit section. Here, you can control how often suggestions appear and what type of suggestions you prefer (e.g., single lines, blocks of code, etc.).

Setting Up Amazon CodeWhisperer in Your IDE

After installing and configuring CodeWhisperer, you now need to set it up in your IDE so you can start using it to enhance your coding experience. Follow the below given steps −

Step 1: Open a New or Existing Project

In your IDE, you need to open your project that uses one of the supported programming languages like Python, Java, or JavaScript. Amazon CodeWhisperer will automatically detect the language you are using and start providing suggestions based on the context of your code.

Step 2: Start Writing Code

As you start typing in your code editor, CodeWhisperer will analyze your code and offer real-time suggestions. These suggestions will appear as a dropdown or inline in your editor. You can choose to accept, reject, or modify the suggestions.

Advertisements