Single-line code completion - CodeWhisperer

CodeWhisperer's features are becoming a part of Amazon Q Developer. Learn more

Single-line code completion

When you start typing out single lines of code, CodeWhisperer makes suggestions based on your current and previous inputs.

AWS Toolkit for Visual Studio Code

In this example using JavaScript and VS Code, CodeWhisperer completes a line of code that the developer begins.

An example of the single-line completion feature.

In this example using TypeScript and VS Code, the user enters a full comment, and then CodeWhisperer supplies the code that goes with it.

An example of the single-line completion feature.

In this example, CodeWhisperer provides a single-line recommendation based on a comment, using C# and VS Code.

An example of the single line completion feature.
AWS Toolkit for JetBrains

In the image below, using a shell script written in IntelliJ, CodeWhisperer offers recommendations on how to complete a single line of code.

An example of the single-line completion feature.
Lambda

When you start typing out single lines of code, CodeWhisperer makes suggestions based on your current and previous inputs. In the image below, a user has begun to define a variable for an Amazon S3 client. Based on this, CodeWhisperer then suggests a way to complete this line of code.

A screenshot that shows a CodeWhisperer recommendation to complete a single line of code that initializes an Amazon S3 client and assigns it to a local variable.

As another example, in the image below, a user has already written some code, and now wants to send a message to an Amazon SQS queue. CodeWhisperer suggests a way to complete this final line of code.

A screenshot that shows a CodeWhisperer recommendation to complete a single line of code that sends a message to an Amazon SQS queue.
AWS Cloud9

When you start typing out single lines of code, CodeWhisperer makes suggestions based on your current and previous inputs.

In the example below, in Java, a user enters the string public into an existing class.

Based on the input, CodeWhisperer generates a suggestion for the signature of the main method.

An example of the single-line completion feature.
SageMaker Studio

In this example using Python and SageMaker Studio, CodeWhisperer recommends a single line of code, based on the developer's comment.

An example of the single-line completion feature.