Block completion - CodeWhisperer

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

Block completion

Block completion is used to complete your if/for/while/try code blocks.

AWS Cloud9

In the example below, in Java, a user enters the signature of an if statement. The body of the statement is a suggestion from CodeWhisperer.

An example of the block completion feature.
AWS Toolkit for Visual Studio Code

In the image below, using TypeScript and VS Code, CodeWhisperer recommends a way to complete the function.

An example of the block completion feature.
AWS Toolkit for JetBrains

In the image below, a user has input the signature of an if statement. The body of the statement, System.out.println("negative"); is a suggestion from CodeWhisperer.

alt_text
SageMaker AI Studio

In this example using Python and SageMaker AI Studio, CodeWhisperer recommends a block of code, based on the context.

An example of the code block feature.