Q. What is Amazon CodeWhisperer?
CodeWhisperer is a machine learning (ML)–powered service that helps improve developer productivity by generating code recommendations based on developers’ comments in plain English text and their prior code. With CodeWhisperer, developers can simply write a comment that outlines a specific task in plain English, such as “Upload a file with server side encryption.” Based on this information, CodeWhisperer automatically determines which cloud services and public libraries are best suited for the specified task and recommends a code snippet directly in the integrated development environment (IDE). Developers can accept the top recommendation, view more recommendations, or continue writing their own code.
Q. Why should I use CodeWhisperer?
CodeWhisperer helps improve developer productivity by providing ML-powered code recommendations to reduce their total development effort and allow more time for ideation and writing differentiated code.
Q. How does CodeWhisperer work?
With CodeWhisperer, developers can simply write a comment in their IDE’s code editor. CodeWhisperer automatically analyzes the comment, determines which cloud services and public libraries are best suited for the specified task, and recommends a code snippet directly in the source code editor. The code recommendations provided by CodeWhisperer are based on ML models trained on various data sources, including Amazon and open-source code. Developers can accept the top recommendation, view more recommendations, or continue writing their own code.
Q. Which programming languages and IDEs does CodeWhisperer support?
Q. What contextual information does CodeWhisperer use to provide recommendations?
CodeWhisperer uses the contextual information in the IDE, including the code and the comments (in English), and the cursor location in the source code file as contextual information. The service also analyzes the code in the current file and other files in the developer’s project to generate its recommendations.
Q. How can I get started with CodeWhisperer?
You can download the AWS IDE Toolkit extension on your desktop and sign up for the preview. After the extension is installed and CodeWhisperer is enabled, you can start writing code or comments and automatically receive code recommendations in your IDE’s code editor.
Q. After activating the service, where will I see recommendations from CodeWhisperer?
You will receive code recommendations in your IDE’s code editor after CodeWhisperer is enabled.
Q. What guidelines can developers follow to get better results from CodeWhisperer?
CodeWhisperer works best when developer comments are short and map to smaller discrete tasks so that no single function is too long. Similarly, CodeWhisperer can generate helpful code recommendations when developers use intuitive names for various code elements, such as function names and docstrings (a type of code comment). Note that even after following these recommended guidelines, recommended code might not always work as intended and could require the developer to either edit the recommended code or continue writing code so CodeWhisperer can suggest better recommendations. Developers can also use the CodeWhisperer toggle in the AWS Toolkit panel to switch off auto suggestions.
Q. What is the CodeWhisperer reference tracker?
The CodeWhisperer reference tracker detects whether a code recommendation might be similar to particular CodeWhisperer training data and can provide those references to you. This allows you to easily find and review that reference code and see how it is used in the context of another project.
Q. Who owns the code generated by CodeWhisperer?
Developers own the code and are responsible for it.
Q. Where did AWS obtain the training data to build this service?
CodeWhisperer code generation is powered by ML models trained on various data sources, including Amazon and open-source code.
Q. Does CodeWhisperer use developer-written code to improve its ML models?
During the preview, CodeWhisperer will not use any developer-written code to train its models. However, CodeWhisperer does store user activity data related to developers’ responses to code recommendations (such as accepting or rejecting a recommendation). The service uses this feedback to make its ML models more accurate so that CodeWhisperer can improve future recommendations.
Pricing and availability
Q: How much does CodeWhisperer cost?
During the preview period, developers can use CodeWhisperer at no cost.
Q: In which AWS Regions is CodeWhisperer available?
CodeWhisperer is Region agnostic and available to developers worldwide.