

# Using Amazon Q Developer in the IDE
<a name="q-in-IDE"></a>

Use Amazon Q Developer in integrated development environments (IDEs) to learn about AWS and get assistance with your software development needs. In IDEs, Amazon Q includes capabilities to provide guidance and support across various aspects of software development, such as answering questions about building on AWS, generating and updating code, security scanning, and optimizing and refactoring code.

To install Amazon Q in your IDE, see [Installing the Amazon Q Developer extension or plugin in your IDE](q-in-IDE-setup.md) .

**Topics**
+ [

## Supported IDEs and available features
](#supported-ides-features)
+ [

# Installing the Amazon Q Developer extension or plugin in your IDE
](q-in-IDE-setup.md)
+ [

# Chatting with Amazon Q Developer about code
](q-in-IDE-chat.md)
+ [

# Generating inline suggestions with Amazon Q Developer
](inline-suggestions.md)
+ [

# Supported languages for Amazon Q Developer in the IDE
](q-language-ide-support.md)

## Supported IDEs and available features
<a name="supported-ides-features"></a>

The features you have access to depend on the IDE where you use Amazon Q. The following table describes the IDEs supported by Amazon Q and the availability and limitations of features in each IDE.

If no language support is specified, the IDE supports languages listed in the [Supported languages](q-language-ide-support.md) topic.


****  

| Feature | VSCode | JetBrains | Eclipse | Visual Studio | 
| --- | --- | --- | --- | --- | 
|   [Chat](q-in-IDE-chat.md)   | Yes | Yes | Yes | Yes | 
|   [Agentic coding](q-in-IDE-chat.md#agentic-coding)   | Yes | Yes | Yes | Yes | 
| [MCP servers](mcp-ide.md) | Yes | Yes | Yes | Yes | 
|   [Context in chat](ide-chat-context.md)   | Yes | Yes | Yes | Yes | 
|   [Inline chat](q-in-IDE-inline-chat.md)   | Yes | Yes | Yes | No | 
|   [Workspace context in chat](workspace-context.md)   | Yes | Yes | Yes | Yes | 
|   [Inline suggestions](inline-suggestions.md)   | Yes | Yes | Yes | Yes | 
|   [Transformations](transform-java.md)   | Yes | Yes | No | Yes | 
|     | Yes | Yes | Yes | No | 

You can also generate inline suggestions in AWS coding environments. For more information, see [Generating inline suggestions in AWS coding environments](setting-up-AWS-coding-env.md) .

# Installing the Amazon Q Developer extension or plugin in your IDE
<a name="q-in-IDE-setup"></a>

To set up Amazon Q Developer in your integrated development environment (IDE), complete the following steps. After installing the Amazon Q extension or plugin, authenticate through IAM Identity Center or AWS Builder ID. You can use Amazon Q for free, without an AWS account, by authenticating with Builder ID. 

To get started, download the Amazon Q extension or plugin for your IDE:
+ [Download Amazon Q for Eclipse](https://marketplace.eclipse.org/content/amazon-q)
+ [Download Amazon Q for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode)
+ [Download Amazon Q for JetBrains IDEs](https://plugins.jetbrains.com/plugin/24267-amazon-q/)
+ [Download Amazon Q in the AWS Toolkit for Visual Studio](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2022)

**Note**  
In general, the default duration for a session that is authenticated through IAM Identity Center is 8 hours. However, in the case of Amazon Q, the default session lasts 90 days (if you set up IAM Identity Center on April 18, 2024 or later). For more information refer to [How to extend the session duration for Amazon Q in the IDE](https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html#90-day-extended-session-duration) in the *AWS IAM Identity Center User Guide*

To sign in and authenticate, complete the steps in this section.

**Topics**
+ [

## Prerequisite: Supported IDE versions
](#q-in-IDE-setup-prereqs)
+ [

## Authenticating in Eclipse IDEs
](#setup-eclipse)
+ [

## Authenticating in JetBrains IDEs
](#setup-jetbrains)
+ [

## Authenticating in Visual Studio Code
](#setup-vscode)
+ [

## Authenticating in Visual Studio
](#setup-vs)
+ [

## Using an IAM principal in your AWS console
](#q-no-IAM-in-IDEs)

## Prerequisite: Supported IDE versions
<a name="q-in-IDE-setup-prereqs"></a>
+ The minimum version of Eclipse supported by Amazon Q is 2024-06 (4.32).
+ The minimum version of JetBrains IDEs (including IntelliJ and PyCharm) supported by Amazon Q is 2024.3. 
+ The minimum version of Visual Studio Code supported by Amazon Q is 1.85.0.
+ Only Visual Studio for Windows is supported by Amazon Q. The minimum version of Visual Studio supported is Visual Studio 2022 version 17.7. All Visual Studio 2022 editions are supported.

## Authenticating in Eclipse IDEs
<a name="setup-eclipse"></a>

You can authenticate for free with AWS Builder ID or with IAM Identity Center with a Amazon Q Developer Pro subscription. Choose your authentication method to see steps to start using Amazon Q in Eclipse.

------
#### [ Builder ID ]

This procedure does not require you to have Builder ID. If you have not yet signed up for Builder ID, you will have the opportunity to do so during the sign-in process.

1. Install the [Amazon Q plugin](https://marketplace.eclipse.org/content/amazon-q) in Eclipse.

1. Choose the Amazon Q icon in the top right corner of the IDE.

1. An Amazon Q tab opens at the bottom of the IDE. Under **Choose a sign-in option**, choose **Personal account**, and then choose **Continue**. You are redirected to your browser.

1. Follow the instructions in your browser to authenticate with Builder ID. When you've completed authentication, return to the Eclipse IDE.

1. To begin using Amazon Q, choose the Amazon Q icon to open the chat Amazon Q panel.

------
#### [ IAM Identity Center ]

Before you begin this procedure, your administrator should have:
+ Created an identity for you in IAM Identity Center
+ Subscribed that identity to Amazon Q Developer Pro

After your identity has been subscribed to Amazon Q Developer Pro, complete the following steps to authenticate:

1. Install the [Amazon Q plugin](https://marketplace.eclipse.org/content/amazon-q) in Eclipse.

1. Choose the Amazon Q icon in the top right corner of the IDE.

1. An Amazon Q tab opens at the bottom of the IDE. Under **Choose a sign-in option**, choose **Company account**, and then choose **Continue**.

1. Enter the **Start URL** that your administrator got from [the Amazon Q subscription console](manage-account-details.md).

1. Choose the AWS Region in which your administrator set up your [IAM Identity Center instance](https://docs.aws.amazon.com/singlesignon/latest/userguide/identity-center-instances.html).

1. Choose **Continue**. You are redirected to your browser.

1. Follow the instructions in your browser to authenticate with IAM Identity Center. When you've completed authentication, return to the Eclipse IDE.

1. To begin using Amazon Q, choose the Amazon Q icon to open the chat Amazon Q panel.

------

## Authenticating in JetBrains IDEs
<a name="setup-jetbrains"></a>

You can authenticate for free with AWS Builder ID or with IAM Identity Center with a Amazon Q Developer Pro subscription. Choose your authentication method to see steps to start using Amazon Q in your JetBrains IDE.

------
#### [ Builder ID ]

This procedure does not require you to have Builder ID. If you have not yet signed up for Builder ID, you will have the opportunity to do so during the sign-in process.

1. Install the [Amazon Q plugin](https://plugins.jetbrains.com/plugin/24267-amazon-q/) in your JetBrains IDE.

1. Choose the Amazon Q icon in your IDE.

   The icon will be on the side of the interface by default.

1. Follow the instructions in your browser to authenticate with Builder ID.

1. To begin using Amazon Q, choose the Amazon Q icon to chat with Amazon Q, or choose **Amazon Q** from the navigation bar at the bottom of your IDE.

------
#### [ IAM Identity Center ]

Before you begin this procedure, your administrator should have:
+ Created an identity for you in IAM Identity Center
+ Subscribed that identity to Amazon Q Developer Pro

After your identity has been subscribed to Amazon Q Developer Pro, complete the following steps to authenticate:

1. Install the [Amazon Q plugin](https://plugins.jetbrains.com/plugin/24267-amazon-q/) in your JetBrains IDE.

1. Choose the Amazon Q icon in your IDE.

   The icon will be on the side of the interface by default.

1. Choose **Company account**.

1. Provide the **Start URL** that your administrator got from [the Amazon Q subscription console](manage-account-details.md).

1. Provide the AWS Region in which your administrator set up your IAM Identity Center [ instance](https://docs.aws.amazon.com/singlesignon/latest/userguide/identity-center-instances.html).

1. Choose **Continue**. The focus will switch to your web browser.

1. Follow the instructions in your browser to authenticate with IAM Identity Center, and then return to the IDE.

1. If your administrator has configured more than one Amazon Q Developer profile, you will see the profiles you have access to. Choose the profile that meets your current working needs, or that your administrator has instructed you to use. For more information about profiles, see [What is the Amazon Q Developer profile?](subscribe-understanding-profile.md).

   If there is only one profile available, that profile will automatically be chosen and you can begin using Amazon Q.

   To change your Amazon Q Developer profile, choose **Amazon Q** from the bottom of the IDE, and then choose **Change profile**. From the window that appears, choose the profile you'd like to use. 

1. To begin using Amazon Q, choose the Amazon Q icon to chat with Amazon Q, or choose **Amazon Q** from the navigation bar at the bottom of your IDE.

------

## Authenticating in Visual Studio Code
<a name="setup-vscode"></a>

You can authenticate for free with AWS Builder ID or with IAM Identity Center with a Amazon Q Developer Pro subscription. Choose your authentication method to see steps to start using Amazon Q in VS Code.

------
#### [ Builder ID ]

This procedure does not require you to have Builder ID. If you have not yet signed up for Builder ID, you will have the opportunity to do so during the sign-in process.

1. Install the [Amazon Q extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode) in VS Code.

1. Choose the Amazon Q icon in your IDE.

   The icon will be on the side of the interface by default.

1. Follow the instructions in your browser to authenticate with Builder ID.

1. To begin using Amazon Q, choose the Amazon Q icon to chat with Amazon Q, or choose **Amazon Q** from the navigation bar at the bottom of your IDE.

------
#### [ IAM Identity Center ]

Before you begin this procedure, your administrator should have:
+ Created an identity for you in IAM Identity Center
+ Subscribed that identity to Amazon Q Developer Pro

After your identity has been subscribed to Amazon Q Developer Pro, complete the following steps to authenticate:

1. Install the [Amazon Q extension](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode) in VS Code.

1. Choose the Amazon Q icon in your IDE.

   The icon will be on the side of the interface by default.

1. Choose **Company account**.

1. Provide the **Start URL** that your administrator got from [the Amazon Q subscription console](manage-account-details.md).

1. Provide the AWS Region in which your administrator set up your IAM Identity Center [ instance](https://docs.aws.amazon.com/singlesignon/latest/userguide/identity-center-instances.html).

1. Choose **Continue**. The focus will switch to your web browser.

1. Follow the instructions in your browser to authenticate with IAM Identity Center, and then return to the IDE.

1. If your administrator has configured more than one Amazon Q Developer profile, you will see the profiles you have access to. Choose the profile that meets your current working needs, or that your administrator has instructed you to use. For more information about profiles, see [What is the Amazon Q Developer profile?](subscribe-understanding-profile.md).

   If there is only one profile available, that profile will automatically be chosen and you can begin using Amazon Q.

   To change your Amazon Q Developer profile, choose **Amazon Q** from the bottom of the IDE, and then choose **Change profile**. From the command palette, choose the profile you'd like to use. 

1. To begin using Amazon Q, choose the Amazon Q icon to chat with Amazon Q, or choose **Amazon Q** from the navigation bar at the bottom of your IDE.

------

## Authenticating in Visual Studio
<a name="setup-vs"></a>

To connect to your AWS accounts from the Toolkit for Visual Studio, open the **Getting Started with the AWS Toolkit** User Interface (connection UI) by completing the following procedure.

1. From the Visual Studio main menu, expand **Extensions** then expand the **AWS Toolkit**.

1. From the **AWS Toolkit** menu options choose **Getting Started**.

1. The **Getting Started with the AWS Toolkit** connection UI opens in Visual Studio.

You can authenticate for free with AWS Builder ID or with IAM Identity Center with a Amazon Q Developer Pro subscription. Choose your authentication method to see steps to start using Amazon Q in Visual Studio.

------
#### [ Builder ID ]

1. From Visual Studio, expand **Extensions** from the main menu and then expand the **AWS Toolkit** sub-menu.

1. Choose **Getting started**. The **Getting Started** tab opens in the Visual Studio editor window. 

1. In the **Amazon Q** section, choose **Enable**. 

1. From the **Free Tier** section, choose the **Sign up or Sign in** button. 

1. Confirm that you want to open the AWS Authorize request portal in your default web browser. 

1. Follow the prompts in your default web browser. You're notified when the authorization process is complete, and it's safe to close your browser and return to Visual Studio.

------
#### [ IAM Identity Center ]

1. From Visual Studio, expand **Extensions** from the main menu and then expand the **AWS Toolkit** sub-menu.

1. Choose **Getting started**. The **Getting Started** tab opens in the Visual Studio editor window. 

1. In the **Amazon Q** section, choose **Enable**. You will fill out the Professional Tier section to authenticate.

1. The credentials profile is made up of the Profile Name, Start URL, Profile Region, or SSO Region provided by an administrator at your company or organization. For detailed information about IAM Identity Center credentials, see [What is IAM Identity Center?](https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the *IAM Identity Center User Guide*.

   If you have an existing credentials profile, choose it from the dropdown menu in the Professional tier panel, and then choose **Connect**.

   To create a new credentials profile, fill out the following fields from the Professional tier section:

   1. In the **Profile Name** text field, enter the name of the IAM Identity Center profile you want to authenticate with.

   1. In the **Start URL** text field, enter the start URL that's attached to your IAM Identity Center credentials.

   1. From the **Profile Region (defaults to us-east-1)** drop-down menu, choose the AWS Region that's defined by the IAM Identity Center user profile you're authenticating with.

   1. From the **SSO Region (defaults to us-east-1)** drop-down menu, choose the **SSO Region** that's defined by your IAM Identity Center credentials, then choose the **Connect** button to open the **Log in with AWS IAM Identity Center** dialog.

1. Confirm that you want to open the AWS Authorize request portal in your default web browser.

1. Follow the prompts in your default web browser. You're notified when the authorization process is complete, and it's safe to close your browser and return to Visual Studio.

1. A **Sign into Amazon Q** window appears. In the credentials profile dropdown, choose the profile you used to authenticate in the previous steps. 

1. If your administrator has configured more than one Amazon Q Developer profile, you are then prompted to choose a Q Developer profile from the dropdown menu. Choose the profile that meets your current working needs, or that your administrator has instructed you to use. For more information about profiles, see [What is the Amazon Q Developer profile?](subscribe-understanding-profile.md).

   If there is only one profile available, that profile will automatically be chosen and you can begin using Amazon Q.

   To change your Amazon Q Developer profile, choose **Amazon Q** from the bottom of the IDE, and then choose **Change Q Developer Profile**. From the window that appears, choose the profile you'd like to use. 

   You can also change your profile by choosing the overflow menu at the top right corner of the chat window, and then choosing **Change Q Developer Profile**.

------

For more information about authenticating in the Toolkit for Visual Studio, see [Getting Started](https://docs.aws.amazon.com/toolkit-for-visual-studio/latest/user-guide/getting-set-up.html) in the *AWS Toolkit for Visual Studio User Guide*.

## Using an IAM principal in your AWS console
<a name="q-no-IAM-in-IDEs"></a>

Depending on how you use AWS, you may be accustomed to using your IAM credentials to sign in to the console for all AWS services. However, you cannot use Amazon Q Developer in the IDE as an IAM principal, or with an IAM role. You must authenticate with credentials from either IAM Identity Center or Builder ID.

# Chatting with Amazon Q Developer about code
<a name="q-in-IDE-chat"></a>

Chat with Amazon Q Developer in your integrated development environment (IDE) to ask questions about building at AWS and for assistance with software development. Amazon Q can explain coding concepts and code snippets, generate code and unit tests, and improve code, including debugging or refactoring. 

**Topics**
+ [

## Working with Amazon Q in your IDE
](#working-with-q-in-IDE)
+ [

## Example tasks
](#example-tasks)
+ [

## Example questions
](#example-topics-questions)
+ [

## Reporting issues with responses from Amazon Q
](#report-issues)
+ [

# Reviewing code with Amazon Q Developer
](code-reviews.md)
+ [

# Transforming code in the IDE with Amazon Q Developer
](transform-in-IDE.md)
+ [

# Explaining and updating code with Amazon Q Developer
](explain-update-code.md)
+ [

# Chatting inline with Amazon Q Developer
](q-in-IDE-inline-chat.md)
+ [

# Adding context to Amazon Q Developer chat in the IDE
](ide-chat-context.md)
+ [

# Chat history compaction in Amazon Q Developer
](ide-chat-history-compaction.md)
+ [

# Viewing, deleting, and exporting the Amazon Q Developer conversation history
](ide-chat-conversation.md)
+ [

# Using shortcut keys in chat with Amazon Q Developer
](q-in-ides-chat-shortcuts.md)
+ [

# Selecting a model for Amazon Q chat in IDEs
](q-in-ides-chat-models.md)

## Working with Amazon Q in your IDE
<a name="working-with-q-in-IDE"></a>

### Using chat
<a name="w2aac11c16b7b3"></a>

 To start chatting with Amazon Q, choose the Amazon Q icon from the navigation bar in your IDE and enter your question in the text bar. To start chatting with Amazon Q in Visual Studio, choose **View** from the main menu and then choose **Amazon Q chat**.

When you ask Amazon Q a question, it uses the current file that is open in your IDE as context, including the programming language and the file path. You can add more context in your prompt or specify files, folders, or your whole workspace as context throughout a chat session. For more information, see [Adding context to the chat](ide-chat-context.md). 

If Amazon Q includes code in its response, you can copy the code or insert it directly into your file by choosing **Insert at cursor**. Amazon Q might include inline references to its sources in its response. 

Amazon Q maintains the context of your conversation within a given session inform future responses. You can ask follow up questions or refer to previous questions and responses throughout the duration of your session. To start a new conversation with Amazon Q, open a new tab in the panel. You can open up to 10 tabs at a time. Amazon Q doesn't retain context across different conversations. 

#### Chat commands
<a name="chat-commands"></a>

The following commands help you manage your chats with Amazon Q.
+ **/clear** - Use this command to clear a current conversation. This removes all previous conversation from the chat panel and clears the context that Amazon Q has about your previous conversation. 
+  **/compact** - Use this command to compact your chat history when the context window approaches its capacity limit. This creates a concise summary of your conversation while preserving essential information.
+ **/help** - Use this command to see an overview of what Amazon Q can and can't do, example questions, and available features.

### Agentic coding
<a name="agentic-coding"></a>

With agentic coding, Amazon Q acts as your coding partner, chatting with you as you develop. Agentic coding is on by default in the IDE. You can toggle agentic coding on or off with the `</>` icon at the bottom of the chat panel.

When you ask Amazon Q to improve your code, it updates your files directly. You can view the changes in a diff and have the option to undo them.

While Amazon Q is thinking or working on a task, you can continue to add instructions in the chat panel, and it will incorporate them into its work.

As you discuss your project with Amazon Q, it will offer suggestions for shell commands. Sometimes, when it deems those commands to be low-risk, it will run them on its own. 

### Chatting in natural languages
<a name="IDE-natural-language-support"></a>

Amazon Q Developer provides multi-language support when you chat in the IDE. Supported natural languages include Mandarin, French, German, Italian, Japanese, Spanish, Korean, Hindi, and Portuguese, with more languages available. To utilize this functionality, you can start a conversation with Amazon Q in the IDE using your preferred natural language. Amazon Q automatically detects the language and provides responses in the appropriate language. 

## Example tasks
<a name="example-tasks"></a>

### Developing code features
<a name="develop-code"></a>

**Note**  
This capability used to be referred to as /dev in this documentation and in the IDE.

Amazon Q can help you develop code features, make code changes to projects, and answer questions about software development tasks in your integrated development environment (IDE). You explain the task you want to accomplish, and Amazon Q uses the context of your current project or workspace to generate code that you can apply to your codebase. Amazon Q can help you build AWS projects or your own applications.

### Unit test generation
<a name="unit-tests"></a>

**Note**  
This capability used to be referred to as /test in this documentation and in the IDE.

Amazon Q can generate unit tests so you can automate testing throughout the software development lifecycle. This feature helps developers focus on accelerating feature development while ensuring code quality.

### Documentation generation
<a name="doc-generation"></a>

**Note**  
This capability used to be referred to as /doc in this documentation and in the IDE.

Amazon Q helps you understand your code and keep documentation up to date by generating READMEs and other documentation for your code. It can produce new documentation and update existing documentation in your codebase. 

### Code reviews
<a name="review-code"></a>

**Note**  
This capability used to be referred to as /review in this documentation and in the IDE.

Amazon Q can review your codebase for security vulnerabilities and code quality issues to improve the posture of your applications throughout the development cycle. For more information on how to use this feature, see [Reviewing code with Amazon Q Developer](code-reviews.md).

### Transforming code
<a name="transform-code"></a>

Amazon Q can transform your code in integrated development environments (IDEs) by performing automated language and operating system (OS)-level upgrades and conversions. You provide the code to be transformed, and Amazon Q generates changes that you can review and apply to your files. For more information, see [Transforming code](transform-in-IDE.md).

## Example questions
<a name="example-topics-questions"></a>

Within IDEs, Amazon Q can answer questions about AWS services and software development, in addition to generating code. Amazon Q is particularly useful for answering questions related to the following subject areas.
+ Building on AWS, including AWS service selection, limits, and best practices
+ General software development concepts, including programming language syntax and application development
+ Writing code, including explaining code, debugging code, and writing unit tests

Following are some example questions that you can ask to get the most out of Amazon Q in your IDE: 
+ How do I debug issues with my Lambda functions locally before deploying to AWS?
+ How do I choose between AWS Lambda and Amazon EC2 for a scalable web application backend? 
+ What is the syntax of declaring a variable in TypeScript?
+ How do I write an app in React?
+ Provide me a description of what this [*selected code or application*] does and how it works. 
+ Generate test cases for [*selected code or function*].

## Reporting issues with responses from Amazon Q
<a name="report-issues"></a>

You can optionally leave feedback for every response Amazon Q generates by using the thumbs-up and thumbs-down icons. To report an issue with a response, choose the thumbs-down icon, and enter information in the feedback window that appears.

# Reviewing code with Amazon Q Developer
<a name="code-reviews"></a>

Amazon Q Developer can review your codebase for security vulnerabilities and code quality issues to improve the posture of your applications throughout the development cycle. You can review an entire codebase, analyzing all files in your local project or workspace, or review a single file. You can also enable auto reviews that assess your code as you write it.

Reviews are powered by both generative AI and rule-based automatic reasoning. [Amazon Q detectors](https://docs.aws.amazon.com/codeguru/detector-library), informed by years of AWS and Amazon.com security best practices, power the rule-based security and quality reviews. As security policies are updated and detectors are added, reviews automatically incorporate new detectors to ensure your code is compliant with the most up-to-date policies.

For information on supported IDEs for this feature, see [Supported IDEs](q-in-IDE.md#supported-ides-features). For information on supported languages, see [Language support for code reviews](q-language-ide-support.md#code-reviews-language-support).

**Topics**
+ [

## How it works
](#how-code-reviews-work)
+ [

## Types of code issues
](#issue-types)
+ [

## Quotas
](#quotas)
+ [

# Starting a code review with Amazon Q Developer
](start-review.md)
+ [

# Addressing code issues with Amazon Q Developer
](address-code-issues.md)
+ [

# Filtering code issues
](filter-code-issues.md)
+ [

# Code issue severity in Amazon Q Developer code reviews
](code-issue-severity.md)

## How it works
<a name="how-code-reviews-work"></a>

During a code review, Amazon Q assesses both your custom code and third-party libraries in your code. Before starting a code review, Amazon Q applies filtering to ensure that only relevant code is reviewed. As part of the filtering process, Amazon Q excludes unsupported languages, test code, and open source code.

Amazon Q can either review your recent code changes, or an entire file or project. To initiate a review, you open your code folder in your IDE, and then ask Amazon Q to review your code from the chat panel. 

By default, if you simply ask Amazon Q to review your code, it will review only the code changes in the active file in your IDE. Code changes are determined by the output of the `git diff` command on your file. If there is no diff file is present, Amazon Q will review the entire code file. If no file is open, it will search for any code changes in the project to review. 

Similarly, if you ask Amazon Q to review your entire project or workspace, it will first attempt to review your code changes. If there is no diff file present, it will review your entire codebase. 

## Types of code issues
<a name="issue-types"></a>

Amazon Q reviews your code for the following types of code issues:
+ **SAST scanning — Detect security vulnerabilities in your source code.** Amazon Q identifies various security issues, such as resource leaks, SQL injection, and cross-site scripting. 
+  **Secrets detection — Prevent the exposure of sensitive or confidential information in your code.** Amazon Q reviews your code and text files for secrets such as hardcoded passwords, database connection strings, and usernames. Secrets findings include information about the unprotected secret and how to protect it. 
+ **IaC issues — Evaluate the security posture of your infrastructure files.** Amazon Q can review your infrastructure as code (IaC) code files to detect misconfiguration, compliance, and security issues. 
+  **Code quality issues — Ensure your code is meeting quality, maintainability, and efficiency standards.** Amazon Q generates code issues related to various quality issues, including but not limited to performance, machine learning rules, and AWS best practices.
+  **Code deployment risks — Assess risks related to deploying code.** Amazon Q determines if there are any risks to deploying or releasing your code, including application performance and disruption to operations. 
+  **Software composition analysis (SCA) — Evaluate third-party code. ** Amazon Q examines third-party components, libraries, frameworks, and dependencies integrated into your code, ensuring third-party code is secure and up to date. 

For a complete list of the detectors Amazon Q uses to review your code, see the [Amazon Q Detector Library](https://docs.aws.amazon.com/codeguru/detector-library/).

## Quotas
<a name="quotas"></a>

Amazon Q security scans maintain the following quotas:
+ **Input artifact size** – The maximum size of all the files within an IDE project workspace, including third-party libraries, build JAR files, and temporary files.
+ **Source code size** – The maximum size of the source code that Amazon Q scans after filtering all third-party libraries and unsupported files.

The following table describes the quotas maintained for auto scans and full project scans.


| Resource | Auto reviews | File or project reviews | 
| --- | --- | --- | 
| Input artifact size | 200 KB | 500 MB | 
| Source code size | 200 KB | 50 MB | 

# Starting a code review with Amazon Q Developer
<a name="start-review"></a>

Amazon Q can review your entire file or codebase, or auto-review your code as you write it. 

Before you get started, make sure you've installed Amazon Q in an IDE that supports code reviews. For more information, see [Installing the Amazon Q Developer extension or plugin in your IDE](q-in-IDE-setup.md).

**Topics**
+ [

## Review a file, project, or workspace
](#project-review)
+ [

## Example tasks and prompts
](#code-review-prompts)
+ [

## Review as you code
](#auto-scan)

## Review a file, project, or workspace
<a name="project-review"></a>

You can initiate a review from the chat panel to have Amazon Q review a particular file or project. File and project reviews include both rule-based and generative AI-powered reviews. 

After Amazon Q completes a review, you can investigate the issue and get a code fix to remediate the issue. For more information, see [Addressing code issues](address-code-issues.md).

To start a file or project review, complete the following steps for your IDE:

------
#### [ JetBrains ]

1. Open a file or project you want to review in your IDE.

1. Choose the Amazon Q icon to open the chat panel. 

1. Using natural language, describe the type of code review you want to run. You can review only your recent code changes, or an entire file. Code changes are determined based on the output of the git diff command on your file. If applicable, Amazon Q will only review your code changes by default unless otherwise specified.

1. With your code project or file open in the IDE, you can enter things like:

   1. **Review my code changes** – Amazon Q will review any code changes in your codebase

   1. **Run a code review on this entire file** – Amazon Q will review all code in your file, not only changes

   1. **Review this repository** – Amazon Q will review your entire codebase, not only changes

   For more detailed code review scenarios and associated prompts, see [Example prompts](#code-review-prompts). 

1. Amazon Q will begin reviewing your file or project. Once complete, it will summarize the highest priority issues and observations.

1. If any issues were detected, the **Code Issues** tab opens with a list of the issues Amazon Q found. 

1. To learn more about a code issue, navigate to the **Code Issues** panel. From there, you can do the following:

   1. Select an issue to be redirected to the specific area of the file where the vulnerable or low-quality code was detected.

   1. To get an explanation of the code issue, choose the magnifying glass icon next to the name of the code issue. Amazon Q will provide details about the issue and suggest a remediation that you can insert into your code. 

   1. To fix the code issue, choose the wrench icon next to the name of the code issue. Amazon Q will provide a brief explanation of the fix and then make an in-place fix in your code file. You will see the code change in your file, and have the option to undo the change from the chat panel. 

   1. You can also use natural language to ask more about an issue, get an explanation of proposed fixes, or ask for alternative solutions. 

1. For more information about addressing code issues, see [Addressing code issues with Amazon Q Developer](address-code-issues.md). 

------
#### [ Visual Studio Code ]

1. Open a file or project you want to review in your IDE.

1. Choose the Amazon Q icon to open the chat panel. 

1. Using natural language, describe the type of code review you want to run. You can review only your recent code changes, or an entire file. Code changes are determined based on the output of the git diff command on your file. If applicable, Amazon Q will only review your code changes by default unless otherwise specified.

1. With your code project or file open in the IDE, you can enter things like:

   1. **Review my code changes** – Amazon Q will review any code changes in your codebase

   1. **Run a code review on this entire file** – Amazon Q will review all code in your file, not only changes

   1. **Review this repository** – Amazon Q will review your entire codebase, not only changes

   For more detailed code review scenarios and associated prompts, see [Example prompts](#code-review-prompts). 

1. Amazon Q will begin reviewing your file or project. Once complete, it will summarize the highest priority issues and observations.

1. If any issues were detected, the **Code Issues** tab opens with a list of the issues Amazon Q found. 

1. To learn more about a code issue, navigate to the **Code Issues** panel. From there, you can do the following:

   1. Select an issue to be redirected to the specific area of the file where the vulnerable or low-quality code was detected.

   1. To get an explanation of the code issue, choose the magnifying glass icon next to the name of the code issue. Amazon Q will provide details about the issue and suggest a remediation that you can insert into your code. 

   1. To fix the code issue, choose the wrench icon next to the name of the code issue. Amazon Q will provide a brief explanation of the fix and then make an in-place fix in your code file. You will see the code change in your file, and have the option to undo the change from the chat panel. 

   1. You can also use natural language to ask more about an issue, get an explanation of proposed fixes, or ask for alternative solutions. 

1. For more information about addressing code issues, see [Addressing code issues with Amazon Q Developer](address-code-issues.md). 

------
#### [ Visual Studio ]

1. Open up a file from the project you want to scan in Visual Studio.

1. Choose the Amazon Q icon at the bottom of your file to open the Amazon Q task bar.

1. From the task bar, choose **Run Security Scan**. Amazon Q begins scanning your project. 

   In the following image, in Visual Studio, the user chooses the **Amazon Q** icon, prompting a task bar from which the user may choose **Run Security Scan**.  
![\[Visual Studio with the Amazon Q task bar showing "Run Security Scan" as a choice\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/VS-scans.png)

1. The status of your scan is updated in the Visual Studio output pane. You're notified when the scan is complete.

   For information about viewing and addressing findings, see [Addressing code issues with Amazon Q Developer](address-code-issues.md).

------

## Example tasks and prompts
<a name="code-review-prompts"></a>

There are several scenarios that you might be in when initiating a code review. Following is an overview of some of the ways to initiate a code review and how to prompt Amazon Q to run the review you want. 
+ To review just the code changes for a single file: 
  + Open the file in your IDE and enter **Review my code**
  + Enter **Review the code in <filename>**
+ To review an entire code file:
  + Open a file without changes and enter **Review my code**
  + Open a file with changes and enter **Review my entire code file**
  + Enter **Review all the code in <filename>**
+ To review all code changes in your repository:
  + Open the repository in your IDE and enter **Review my code**
+ To review your entire repository, not just the changes:
  + Open the repository in your IDE and enter **Review my repository**

## Review as you code
<a name="auto-scan"></a>

**Note**  
Amazon Q auto-reviews are only available with a [Amazon Q Developer Pro subscription](getting-started-q-dev.md).

Auto-reviews are rule-based reviews powered by [Amazon Q detectors ](https://docs.aws.amazon.com/codeguru/detector-library/). Amazon Q automatically reviews the file you are actively coding in, generating code issues as soon as they are detected in your code. When Amazon Q performs auto reviews, it doesn’t generate in-place code fixes.

Auto-reviews are enabled by default when you use Amazon Q. Use the following procedure to pause or resume auto-reviews.

**Pause and resume auto-reviews**

To pause auto-reviews, complete the following steps.

1. Choose **Amazon Q** from the bottom of the IDE window.

   The Amazon Q task bar opens.

1. Choose **Pause Auto-Reviews**. To resume auto-reviews, choose **Resume Auto-Reviews**.

# Addressing code issues with Amazon Q Developer
<a name="address-code-issues"></a>

The topics in this section explain how to address and resolve code issues, and, where applicable, how to ignore issues.

**Topics**
+ [

# Address code issues in JetBrains and Visual Studio Code
](address-issues-jetbrains-visualstudiocode.md)
+ [

# Address code issues in Visual Studio
](address-issues-visualstudio.md)

# Address code issues in JetBrains and Visual Studio Code
<a name="address-issues-jetbrains-visualstudiocode"></a>

To address a code issue in JetBrains and Visual Studio Code, you will either have the option to generate an in-place fix or generate an explanation that you can use to manually update your code. 

You can take the following actions: 
+ Generate an in-place code fix 
+ Explain the issue and get new code
+ Ignore the issue, or ignore all similar issues

## Generate in place fixes for your file
<a name="generate-fixes"></a>

Amazon Q can update your files in-place to automatically remediate a code issue it detected.

To automatically fix a code issue in your file:

------
#### [ JetBrains ]

1. In the **Problems** tool window, in the **Amazon Q Code Issues** tab, choose the code issue you want to address.

1. A panel opens with more information about the code issue. If applicable, you'll see details about the Amazon Q detector that was used to identify the code issue.

1. Along the bottom of the panel, choose **Fix**. 

1. In the chat panel, Amazon Q provides a brief explanation of the fix and then applies an in-place fix in your code file.

1. You will see the code change in your file, and have the option to undo the change from the chat panel.

------
#### [ Visual Studio Code ]

1. In the **Code Issues** tab, choose the code issue you want to address.

1. Choose the wrench icon.

   The following image shows the wrench icon for a code issue in Visual Studio Code.  
![\[The wrench icon for a code issue in Visual Studio Code, used to generate a code fix.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/code-review-fix-vsc.png)

1. In the chat panel, Amazon Q provides a brief explanation of the fix and then applies an in-place fix in your code file.

1. You will see the code change in your file, and have the option to undo the change from the chat panel.

------

## Explain the code issue and get new code
<a name="explain-issue"></a>

Amazon Q can provide an in-depth explanation of a code issue and provide remediation options with accompanying code for you to add to your files.

To get an explanation of a code issue:

------
#### [ JetBrains IDEs ]

1. In the **Problems** tool window, in the **Amazon Q Code Issues** tab, choose the code issue you want to address.

1. A panel opens with more information about the code issue. If applicable, you'll see details about the Amazon Q detector that was used to identify the code issue.

1. Along the bottom of the panel, choose **Explain**. 

1. In the chat panel, Amazon Q provides details about the issue and suggests how to fix it, with code that you can insert into your file.

1. To update your file, follow Amazon Q’s instructions for where to add or replace code, and copy the provided code in the correct location in your file. Make sure to remove the vulnerable code when adding the updated code.

------
#### [ Visual Studio Code ]

1. In the **Code Issues** tab, choose the code issue you want to address.

1. Choose the magnifying glass icon.

   The following image shows the magnifying glass icon for a code issue in Visual Studio Code.  
![\[The magnifying glass icon for a code issue in Visual Studio Code, used to explain a code issue.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/code-review-view-details-vsc.png)

1. In the chat panel, Amazon Q provides details about the issue and suggests how to fix it, with code that you can insert into your file.

1. To update your file, follow Amazon Q’s instructions for where to add or replace code, and copy the provided code in the correct location in your file. Make sure to remove the vulnerable code when adding the updated code.

------

## Ignore a code issue
<a name="ignore-issues"></a>

If a detected code issue isn’t applicable, you can choose to ignore it, or ignore it and all similar issues (issues with the same CWE). The issues will be removed from the Code Issues tab. 

To ignore a code issue:

------
#### [ JetBrains ]

1. In the **Problems** tool window, in the **Amazon Q Code Issues** tab, choose the code issue you want to ignore.

1. A panel opens with more information about the code issue. Along the bottom of the panel, choose **Ignore**. The code issue is removed from the Code Issue panel.

1. You can also choose **Ignore All** to ignore this and other code issues with the same CWE.

------
#### [ Visual Studio Code ]

1. In the **Code Issues** tab, choose the code issue you want to ignore.

1. Choose the ignore icon.

   The following image shows the ignore icon for a code issue in Visual Studio Code.  
![\[The ignore icon for a code issue in Visual Studio Code, used to ignore and close a code issue.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/code-review-ignore-issue-vsc.png)

1. The code issue is removed from the Code Issue panel.

1. To ignore similar issues, choose the elipses icon, and then the choose **Ignore Similar Issues** button that appears.

------

# Address code issues in Visual Studio
<a name="address-issues-visualstudio"></a>

To view code issues detected by Amazon Q in Visual Studio, open the Visual Studio **Error List** by expanding the **View** heading in the Visual Studio main menu and choosing **Error List**.

You can use the information in the code issue to update your code. After updating your code, review your code again to see if the issues were addressed.

By default, the Visual Studio **Error List** displays all of the warnings and errors for your code base. To filter your Amazon Q code issues from the Visual Studio **Error List**, create a filter by completing the following procedure.

**Note**  
Code issues are only visible after you've run a code review in which Amazon Q detected issues.  
Code issues appear as warnings in Visual Studio. In order to view issues detected by Amazon Q in the **Error List**, the **Warnings** option in the **Error List** heading must be selected.

**Filter code issues in the Error List**

1. From the Visual Studio main menu, choose view and then **Error List** to open the **Error List** pane.

1. From the **Error List** pane, right-click the header row to open the context menu.

1. From the context menu, expand **Show Columns**, and then select **Tool** in the expanded menu.

1. The **Tool** column is added to your **Error List**.

1. From the **Tool** column header, select the **Filter** icon and choose **Amazon Q** to filter for Amazon Q code issues.

# Filtering code issues
<a name="filter-code-issues"></a>

**Note**  
You can only filter code issues in JetBrains IDEs and Visual Studio Code.

When you filter code issues, only issues that meet the selected criteria are shown in the Code Issues panel. You can filter the issues based on their severity so you only see issues with the selected severity in the panel.

You can also control how code issues are organized in the Code Issues panel. You can group issues based on severity or based on their file location. 

To filter code issues:

------
#### [ JetBrains IDEs ]

1. From the **Amazon Q Code Issues** tab, choose the filter icon. 

1. A pop-up menu with Severity levels opens.

   The following image shows the Severity menu in the Code Issues tab in IntelliJ IDEA.  
![\[The severity filter menu in IntelliJ IDEA.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-filter-issues.png)

1. Select or deselect the the severity levels you want to filter for, and then choose **OK**. Only the issues with the severity you selected will appear in the **Amazon Q Code Issues** panel. 

------
#### [ Visual Studio Code ]

1. From the **Code Issues** panel, choose the filter icon. 

   The following image shows the filter icon in the Code Issues tab in Visual Studio Code.  
![\[The filter icon in the Code Issues tab in Visual Studio Code.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/filter-issues-vsc.png)

1. The **Filter Issues** menu opens. 

   Select or deselect the boxes next to the severity levels you want to filter for, and then choose **OK**. Only the issues with the severity you selected will appear in the **Code Issues** panel. 

------

To group code issues:

------
#### [ JetBrains IDEs ]

1. From the **Amazon Q Code Issues** panel, choose the grouping icon. 

1. A **Group By** pop-up menu opens.

1. Select **Severity** to group issues in the Code Issues panel based on their severity. Select **Location** to group issues based on which code file they are located in.

------
#### [ Visual Studio Code ]

1. From the **Code Issues** panel, choose the grouping icon. 

   The following image shows the grouping icon in the Code Issues tab in Visual Studio Code.  
![\[The grouping icon in the Code Issues tab in Visual Studio Code.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/group-issues-vsc.png)

1. The **Group Issues** menu opens. 

1. Select **Severity** to group issues in the Code Issues panel based on their severity. Select **Location** to group issues based on which code file they are located in.

------

# Code issue severity in Amazon Q Developer code reviews
<a name="code-issue-severity"></a>

Amazon Q defines the severity of the code issues detected in your code so you can prioritize what issues to address and track the security posture of your application. The following sections explain what methods are used to determine the severity of code issues and what each level of severity means. 

## How severity is calculated
<a name="severity-calculation"></a>

The severity of a code issue is determined by the detector that generated the issue. Detectors in the [Amazon Q Detector Library](https://docs.aws.amazon.com/codeguru/detector-library) are each assigned a severity using the Common Vulnerability Scoring System ([CVSS](https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator)). The CVSS considers how the finding can be exploited in its context (for example, can it be done over internet, or is physical access required) and what level of access can be obtained.

The following table outlines how severity is determined based on the level of access and level of effort required for a bad actor to successfully attack a system.


**Severity determination matrix**  

| Level of access | Level of effort | Severity | 
| --- | --- | --- | 
| Full control of system or its output | Requires access to system | High | 
| Full control of system or its output | Internet with high level of effort | Critical | 
| Full control of system or its output | Over internet | Critical | 
| Access to sensitive information | Requires access to system | Medium | 
| Access to sensitive information | Internet with high level of effort | High | 
| Access to sensitive information | Over internet | High | 
| Can crash or slow down the system | Requires access to system | Low | 
| Can crash or slow down the system | Internet with high level of effort | Medium | 
| Can crash or slow down the system | Over internet | Medium | 
| Provides additional security | Not exploitable | Info | 
| Provides additional security | Requires access to system | Info | 
| Provides additional security | Internet with high level of effort | Low | 
| Provides additional security | Over internet | Low | 
| Best practice | Not exploitable | Info | 

## Severity definitions
<a name="severity-definitions"></a>

The severity levels are defined as follows.

 **Critical – The code issue should be addressed immediately to avoid it escalating.**

Critical code issues suggest that an attacker can gain control of the system or modify its behavior with moderate effort. It is recommended that you treat critical findings with the utmost urgency. You also should consider the criticality of the resource.

 **High – The code issue must be addressed as a near-term priority.**

High severity code issues suggest that an attacker can gain control of the system or modify its behavior with high effort. It is recommended that you treat a high severity finding as a near-term priority and that you take immediate remediation steps. You also should consider the criticality of the resource.

 **Medium – The code issue should be addressed as a midterm priority.**

Medium severity findings can lead to crash, unresponsiveness, or unavailability of the system. It is recommended that you investigate the implicated code at your earliest convenience. You also should consider the criticality of the resource.

 **Low – The code issue does not require action on its own.**

Low severity findings suggest programming errors or anti-patterns. You do not need to take immediate action on low severity findings, but they can provide context when you correlate them with other issues.

**Informational – No recommended action.**

Informational findings include suggestions for quality or readability improvements, or alternative API operations. No immediate action is necessary.

# Transforming code in the IDE with Amazon Q Developer
<a name="transform-in-IDE"></a>

Amazon Q Developer can transform your code in integrated development environments (IDEs) by performing automated language and operating system (OS)-level upgrades and conversions. You provide the code to be transformed, and Amazon Q generates changes that you can review and apply to your files. 

To get started, install Amazon Q in an IDE that supports transformations. Then, see the topic for the type of transformation you'd like to perform with Amazon Q.

For more information on IDEs that support transformation and how to install Amazon Q, see [Using Amazon Q Developer in the IDE](q-in-IDE.md).

**Topics**
+ [

# Transforming Java applications with Amazon Q Developer
](transform-java.md)
+ [

# Transforming .NET applications with Amazon Q Developer
](transform-dotnet-IDE.md)

# Transforming Java applications with Amazon Q Developer
<a name="transform-java"></a>

**Note**  
AWS Transform custom now available for Java upgrades. Agentic AI that handles version upgrades, SDK migration, and more, and improves with every execution. [Get started](https://docs.aws.amazon.com/transform/latest/userguide/custom-get-started.html)

Amazon Q supports the following types of transformations for Java applications: 
+ Java language and dependency version upgrades
+ Embedded SQL conversion for Oracle to PostgreSQL database migration

To get started, see the topic for the type of transformation you'd like to perform. 

**Topics**
+ [

## Quotas
](#quotas-java-transformation-ide)
+ [

# Upgrading Java versions with Amazon Q Developer
](code-transformation.md)
+ [

# Converting embedded SQL in Java applications with Amazon Q Developer
](transform-sql.md)
+ [

# Transforming code on the command line with Amazon Q Developer
](transform-CLI.md)
+ [

# Viewing transformation job history
](transformation-job-history.md)
+ [

# Troubleshooting issues with Java transformations
](troubleshooting-code-transformation.md)

## Quotas
<a name="quotas-java-transformation-ide"></a>

Java application transformations with Amazon Q in the IDE and command line maintain the following quotas: 
+ **Lines of code per job** – The maximum number of code lines that Amazon Q can transform in a given transformation job. 
+ **Lines of code per month** – The maximum number of code lines that Amazon Q can transform in a month. 
+ **Concurrent jobs** – The maximum number of transformation jobs you can run at the same time. This quota applies to all transformations in the IDE, including [.NET transformations in Visual Studio](transform-dotnet-IDE.md).
+ **Jobs per month** – The maximum number of transformation jobs you can run in one month. 


| Resource | Quotas | 
| --- | --- | 
| Lines of code per job | Free tier: 1000 lines of code | 
| Lines of code per month | Free tier: 2000 lines of code | 
| Concurrent jobs |  1 job per user 25 jobs per AWS account  | 
| Jobs per month |  Pro tier: 1000 jobs Free tier: 100 jobs  | 

# Upgrading Java versions with Amazon Q Developer
<a name="code-transformation"></a>

Amazon Q Developer can upgrade your Java applications to newer language versions in the integrated development environment (IDE). Changes Amazon Q can make to upgrade your code include updating deprecated code components and APIs as well as upgrading libraries, frameworks, and other dependencies in your code. 

To transform your code, Amazon Q first builds your code in the source language version and verifies that it has the information necessary to perform the transformation. After Amazon Q successfully transforms your code, you verify and accept the changes in your IDE. Since Amazon Q Developer makes the minimal changes necessary to make your upgraded code compatible with the target JDK, an additional transformation is required to upgrade your project's libraries and dependencies. For more information about how Amazon Q transforms your code, see [How Amazon Q Developer transforms code for Java language upgrades](how-CT-works.md).

**Topics**
+ [

## Supported Java upgrades and IDEs
](#supported-languages-IDEs)
+ [

## Step 1: Prerequisites
](#java-upgrade-prerequisites)
+ [

## Step 2: Configure your project
](#configure-project)
+ [

## Step 3: Create a dependency upgrade file (optional)
](#create-dependency-upgrade-file)
+ [

## Step 4: Transform your code
](#transform-code-java)
+ [

# How Amazon Q Developer transforms code for Java language upgrades
](how-CT-works.md)

## Supported Java upgrades and IDEs
<a name="supported-languages-IDEs"></a>

Amazon Q currently supports the following Java source code versions and target versions for transformations. Transforming code to the same Java version includes upgrading libraries and other dependencies in the source code version.


**Supported Java upgrades**  

| Source code version | Supported target versions | 
| --- | --- | 
| Java 8  | Java 17 and Java 21 | 
| Java 11 | Java 17 and Java 21 | 
| Java 17 | Java 17 and Java 21  | 
| Java 21 |  Java 21   | 

Amazon Q supports Java upgrades in the following IDEs:
+ Modules in JetBrains IDEs
+ Projects and workspaces in Visual Studio Code

## Step 1: Prerequisites
<a name="java-upgrade-prerequisites"></a>

Before you continue, make sure you’ve completed the steps in [Set up Amazon Q in your IDE](q-in-IDE-setup.md).

Make sure that the following prerequisites are met before you begin a Code Transformation job: 
+ Your project is written in a [supported Java version](#supported-languages-IDEs) and is built on Maven.
+ Your project successfully builds with Maven in your IDE. Maven 3.8 or later is currently supported. 
+ Your project source JDK is available locally and is the version of your source code. For example, if you are transforming Java 8 code, your local JDK installation should be JDK 8.
+ Your project builds in 55 minutes or less. 
+ Your project is configured correctly, and the correct JDK version is specified. For more information, see [Step 2: Configure your project](#configure-project).
+ Your project doesn't require access to resources on your private network, including a virtual private cloud (VPC) or on-premise network. For example, if your project contains unit tests that connect to a database in your network, the transformation will fail.
+ Your project doesn't use plugins that package languages other than Java in your Java project. For example, if your project uses the [frontend-maven-plugin](https://github.com/eirslett/frontend-maven-plugin) for executing front-end JavaScript code in addition to your Java source code, the transformation will fail.
+ Your local network allows uploads to Amazon S3 buckets that Amazon Q uses to transform your code. For more information, see [Allow access to Amazon S3 buckets in data perimeters](firewall.md#data-perimeters).
+ Your application only uses UTF-8 characters. If your application uses non-UTF-8 characters, Amazon Q will still attempt to transform your code. 

## Step 2: Configure your project
<a name="configure-project"></a>

To configure your project, use the following information for the IDE you're using.

### Configure a project in JetBrains
<a name="configure-jetbrains"></a>

To configure your project in JetBrains, you might need to specify the following project and module settings. 

If your modules use the same JDK and language level as your project, you don't need to update module settings.
+ Project SDK – The JDK used to compile your project. 
+ Project language level – The Java version used in your project.
+ Module SDK – The JDK used to compile your module. 
+ Module language level – The Java version used in your module. 
+ Maven Runner JRE – The JDK you build your module with. 

**Update project and module settings**

To update your SDK and language level settings for your project or module, complete the following steps:

1. From your JetBrains IDE, choose **File** and then **Project Structure**. 

1. The Project Structure window opens. Under **Project Settings**, choose **Project**. 

   1. To update your project JDK, choose from the dropdown list next to **SDK**. 

   1. To update your project language, choose from the dropdown next to **Language level**. 

1. Under **Project Settings**, choose **Modules**. 

   1. To update your module JDK, choose from the dropdown list next to **SDK**. 

   1. To update your module language, choose from the dropdown next to **Language level**.

For more information, see [Project structure settings](https://www.jetbrains.com/help/idea/project-settings-and-structure.html) and [Module structure settings](https://www.jetbrains.com/help/idea/configure-modules.html) in the JetBrains documentation.

**Update Maven settings**

To update your Maven Runner JRE, complete the following steps:

1. From your JetBrains IDE, choose the gear icon, and then choose **Settings** in the menu that appears. 

1. In the **Settings** window, choose **Build, Execution, Deployment**, then **Build Tools**, then **Maven**, and then **Runner**.

1. In the JRE field, choose the JDK used to build the module you're transforming.

### Configure a project in VS Code
<a name="configure-vsc"></a>

To configure your project in VS Code, your project must contain the following: 
+ A `pom.xml` file in the project root folder
+ A `.java` file in the project directory

If your project contains a Maven wrapper executable (`mvnw` for macOS or `mvnw.cmd` for Windows), make sure it’s at the root of your project. Amazon Q will use the wrapper, and no other Maven configuration is necessary.

If you aren’t using a Maven wrapper, install Maven. For more information, see [Installing Apache Maven](https://maven.apache.org/install.html) in the Apache Maven documentation.

After installing Maven, add it to your `PATH` variable. For more information, see [How do I add Maven to my `PATH`?](troubleshooting-code-transformation.md#add-maven-to-path) Your Java `runtime` variable should also be pointing to a JDK and not to a JRE. To confirm your configuration is correct, run `mvn -v`. The output should show your Maven version and the `runtime` variable pointing to the path to your JDK.

## Step 3: Create a dependency upgrade file (optional)
<a name="create-dependency-upgrade-file"></a>

You can provide Amazon Q with a *dependency upgrade file*, a YAML file that lists your project's dependencies and which versions to upgrade to during a transformation. By providing a dependency upgrade file, you can specify third and first party dependencies that Amazon Q might not otherwise know to upgrade.

First party dependencies refer to the libraries, plugins, and frameworks that your organization maintains and are only available locally or on your organization’s private network. Amazon Q is able to access your first party dependencies when it performs builds in your local environment. For more information, see [Building code in your local environment](how-CT-works.md#java-local-builds). Third party dependencies are publicly available or open source dependencies that aren’t unique to your organization.

You can specify first party dependencies you want to upgrade in a YAML file, and Amazon Q upgrades them during the JDK upgrade (for example, Java 8 to 17). You can initiate a separate transformation (17 to 17 or 21 to 21) after the initial JDK upgrade to upgrade third-party dependencies.

Once Amazon Q performs a minimum JDK upgrade, you can initiate a separate transformation to upgrade all third party dependencies. Alternatively, you can specify third party dependencies and their versions in a YAML file to only upgrade those dependencies during the library upgrade transformation.

Amazon Q will prompt you to provide a dependency upgrade file during the transformation. If you want to provide one, first make sure you've configured the file properly. The following fields are required in the YAML file:
+ name - The name of the dependency upgrade file.
+ description (optional) - A description of the dependency upgrade file, and for which transformation.
+ dependencyManagement - Contains the list of dependencies and plugins to upgrade.
+ dependencies - Contains the name and version of the libraries to upgrade.
+ plugins - Contains the names and versions of the plugins to upgrade.
+ identifier - The name of the library, plugin, or other dependency.
+ targetVersion - The version of the dependency to upgrade to.
+ versionProperty (optional) - The version of the dependency you're defining, as set with the `properties` tag in your application's `pom.xml` file.
+ originType - Whether the dependency is first or third party, specified by either FIRST\$1PARTY or THIRD\$1PARTY.

Following is an example of a dependency upgrade YAML file, and the required configuration for Amazon Q to parse:

```
name: dependency-upgrade
  
description: "Custom dependency version management for Java migration from JDK 8/11/17 to JDK 17/21"
  
  
dependencyManagement:
  
  dependencies:
  
    - identifier: "com.example:library1"
  
      targetVersion: "2.1.0"
  
      versionProperty: "library1.version"  # Optional
  
      originType: "FIRST_PARTY"   
  
    - identifier: "com.example:library2"
  
      targetVersion: "3.0.0"
  
      originType: "THIRD_PARTY"
  
  plugins:
  
    - identifier: "com.example.plugin"
  
      targetVersion: "1.2.0"
  
      versionProperty: "plugin.version"  # Optional
            
      originType: "THIRD_PARTY"
```

## Step 4: Transform your code
<a name="transform-code-java"></a>

To test your IDE setup, download and unzip the sample project, and complete the following steps for your IDE. If you are able to view the proposed changes and transformation summary, you are ready to transform your own code project. If the transformation fails, your IDE is not configured correctly. To address configuration issues, review [Step 2: Configure your project](#configure-project) and [Troubleshooting](troubleshooting-code-transformation.md).

**Note**  
Do not turn off, close, or put your local machine to sleep during the code transformation. The initial and validation builds use the client-side environment, which requires a stable network connection. 

To upgrade the language version of your code project or module, complete the following steps for your IDE.

------
#### [ JetBrains ]

1. Open the module that you want to upgrade in JetBrains. Make sure you’ve successfully built your project in the IDE. 

1. Choose the Amazon Q logo, and ask Amazon Q to transform your application in the chat panel that opens.

1. A **Transform your application** pop-up appears. Choose the project that you want to upgrade from the dropdown list, and then choose **Transform**. 

1. Amazon Q prompts you to provide an upgrade dependency file. If you have configured a YAML with the dependencies and version to upgrade to, add your file. Amazon Q will validate the file to ensure it's configured correctly. If you get an error, review the format and required fields described in [Step 3: Create a dependency upgrade file (optional)](#create-dependency-upgrade-file).

1. Amazon Q begins the transformation. You can view progress on the **Transformation details** tab. 

1. After the transformation is complete, you can verify the upgraded code before updating your project. To view the new code, go to the **Transformation details** tab and then choose **View diff**. In the **Apply patch** window that appears, choose a file to open a diff view with your source code and upgraded code. 

1. To accept the changes that Amazon Q made, choose **View diff** to open the **Apply patch** window. Select all the updated files, and choose **OK** to update your project in place. 

1. To get details about how your code was upgraded and suggested next steps, on the **Transformation details** tab, choose **View transformation summary**. 

------
#### [ Visual Studio Code ]

1. Open the project or workspace that you want to upgrade in VS Code. Make sure that you’ve successfully built your project in the IDE. 

1. Choose the Amazon Q logo, and ask Amazon Q to transform your application in the chat panel that opens.

1. Choose the project that you want to upgrade from the search bar at the top of the IDE. 

1. If Amazon Q can’t find the version of your source code, it prompts you to choose your code version. Choose the version that your source code is written in, and then choose **Transform** in the pop-up to proceed. 

1. If prompted, enter the `JAVA_HOME` path to your JDK. For more information, see [Configure your VS Code project](#configure-vsc). 

1. Amazon Q prompts you to provide an upgrade dependency file. If you have configured a YAML with the dependencies and version to upgrade to, add your file. Amazon Q will validate the file to ensure it's configured correctly. If you get an error, review the format and required fields described in [Step 3: Create a dependency upgrade file (optional)](#create-dependency-upgrade-file).

1. Amazon Q begins the transformation. You can view progress on the **Transformation Hub** tab. 

1. After the transformation is complete, the **Proposed Changes** tab opens. To verify the upgraded code before updating your project, choose **Download proposed changes**. Choose a file to open a diff view with your source code and upgraded code. 

1. To accept the changes Amazon Q made, go to the **Proposed Changes** tab and choose **Accept**. 

1. To get details about how your code was upgraded and suggested next steps, on the **Transformation Hub**, choose the **Views and More Actions** ellipsis button, and then choose **Show Transformation Summary**.

------

# How Amazon Q Developer transforms code for Java language upgrades
<a name="how-CT-works"></a>

To transform your code, Amazon Q Developer generates a transformation plan that it uses to upgrade the code language version of your project. After transforming your code, it provides a transformation summary and a file diff for you to review changes before accepting them. Since Amazon Q Developer makes the minimal changes necessary to make your upgraded code compatible with the target JDK, an additional transformation is required to upgrade your project's libraries and dependencies. The following sections provide more details on how Amazon Q performs the transformation.

## Building your code and creating a transformation plan
<a name="build-code-create-plan"></a>

To begin transforming your code, Amazon Q builds your project locally and generates a build artifact that contains your source code, project dependencies, and build logs. 

After generating the build artifact, Amazon Q builds your code in a secure build environment and creates a transformation plan, which is customized to the project or module you’re upgrading. The transformation plan outlines the specific changes Amazon Q will attempt to make, including new dependency versions, major code changes, and suggested replacements for deprecated code. These changes are based on the preliminary build of your code, and might change during the transformation.

## Transforming your code
<a name="transform-code"></a>

To transform your code, Amazon Q attempts to upgrade your code to the target Java version based on the proposed changes in the transformation plan. As it makes changes, it re-builds and runs existing unit tests in your source code to iteratively fix any encountered errors. The JDK upgrade can be made from the following source code version to the target version:
+ Java 8 to 17
+ Java 8 to 21
+ Java 11 to 17
+ Java 11 to 21
+ Java 17 to 21

Amazon Q makes the minimal changes necessary to make your code compatible with the target Java version. Once Amazon Q performs a minimum JDK upgrade, you can initiate a separate transformation to upgrade all third party dependencies. Alternatively, you can specify third party dependencies and their versions in a YAML file to only upgrade those dependencies during the library upgrade transformation.

Amazon Q attempts to make the following changes when upgrading your code:
+ Update deprecated code components according to the target Java version recommendations
+ Upgrade popular libraries and frameworks to a version compatible with the target Java version. This includes updating the following libraries and frameworks to their latest available major versions: 
  + Apache Commons IO 
  + Apache HttpClient 
  + bc-fips 
  + Cucumber-JVM 
  + Hibernate 
  + jackson-annotations 
  + JakartaEE
  + Javax 
  + javax.servlet 
  + jaxb-api 
  + jaxb-impl 
  + jaxen 
  + jcl-over-slf4j 
  + json-simple 
  + jsr305 
  + junit 
  + junit-jupiter-api 
  + Log4j 
  + Micronaut 
  + Mockito 
  + mockito-core 
  + Okio 
  + PowerMockito 
  + Quarkus 
  + slf4j 
  + slf4j-api 
  + Spring Boot 
  + Spring Framework 
  + Spring Security 
  + Swagger 
  + testng 

**Note**  
Do not turn off or close your local machine during the code transformation because client-side build requires a stable network connection.

## Building code in your local environment
<a name="java-local-builds"></a>

During a transformation, Amazon Q performs verification builds in your local environment. Amazon Q transforms your code on the server side in multiple steps. After each step, Amazon Q sends the code to your local environment to build and test the changes it made. The code is then sent back to the server side to continue the transformation. 

The build in your local environment helps verify the transformed code by allowing Amazon Q to run tests that require access to private resources. To minimize security risks associated with building AI-generated code in your local environment, Amazon Q reviews and updates the code it generates to address security concerns.

## Reviewing the transformation summary and accepting changes
<a name="review-plan-accept-changes"></a>

After the transformation is complete, Amazon Q provides a transformation summary with details about the changes it made, including the status of the final build which indicates whether your entire project was upgraded. You can also view a build log summary to understand any issues that prevented Amazon Q from building your code in the upgraded version.

The transformation summary additionally includes the differences between the changes proposed in the transformation plan and the changes Amazon Q ultimately made to upgrade your code, and any additional changes that weren’t in the original plan. 

After you review the transformation summary, you can view the changes Amazon Q is proposing in a file diff view. Any code changes Amazon Q suggests will not affect your current project files until you accept the changes. The transformed code is available up to 30 days after the transformation completes. 

## Completing partially successful transformations
<a name="partially-successful-transformations"></a>

Depending on the complexity and specifics of your codebase, there might be instances where the transformation is partially successful. This means that Amazon Q was able to transform only certain files or areas of code in your project. In this case, you have to manually update the remaining code for your project to be buildable in the updated language version. 

To help transform the rest of your code, you can use Amazon Q chat in the IDE. You can ask Amazon Q to review the partially updated files and provide new code to address issues, such as compilation errors. You can also use features like [Feature development](q-in-IDE-chat.md#develop-code) and [Workspace context](workspace-context.md) to include more of your project as context and get suggestions for multiple files at a time. 

# Converting embedded SQL in Java applications with Amazon Q Developer
<a name="transform-sql"></a>

The Amazon Q Developer agent for code transformation in the IDE can help you convert embedded SQL to complete Oracle to PostgreSQL database migration with AWS Database Migration Service (AWS DMS).

AWS DMS is a cloud service that makes it possible to migrate relational databases, data warehouses, NoSQL databases, and other types of data stores. DMS Schema Conversion in AWS DMS helps you convert database schemas and code objects that you can apply to your target database. For more information, see [What is AWS Database Migration Service?](https://docs.aws.amazon.com/dms/latest/userguide/Welcome.html) in the *AWS Database Migration Service User Guide*.

When you use AWS DMS and DMS Schema Conversion to migrate a database, you might need to convert the embedded SQL in your application to be compatible with your target database. Rather than converting it manually, you can use Amazon Q in the IDE to automate the conversion. Amazon Q uses metadata from a DMS Schema Conversion to convert embedded SQL in your application to a version that is compatible with your target database.

Currently, Amazon Q can convert SQL in Java applications for Oracle databases migrating to PostgreSQL. You will only see the option to transform SQL code in the IDE if your application contains Oracle SQL statements. See the prerequisites for more information. 

## Step 1: Prerequisites
<a name="sql-transform-prereqs"></a>

Before you continue, make sure you’ve completed the steps in [Set up Amazon Q in your IDE](q-in-IDE-setup.md).

Before you begin a code transformation job for SQL conversion, make sure the following prerequisites are met:
+ You are migrating a Java application with embedded SQL from an Oracle database to a PostgreSQL database. Your application must contain Oracle SQL statements for it to be eligible for transformation. 
+ You have completed the process for converting your database schema using AWS DMS Schema Conversion. For more information, see [Migrating Oracle databases to Amazon RDS for PostgreSQL with DMS Schema Conversion](https://docs.aws.amazon.com/dms/latest/sbs/schema-conversion-oracle-postgresql.html) in the *Database Migration Guide*.
+ After schema conversion is complete, you have downloaded the migration project file from the AWS DMS console.

## Step 2: Configure your application
<a name="sql-transform-configure"></a>

To convert your embedded SQL code, your Java project must contain at least one `.java` file. 

If you are using a JetBrains IDE, you must set the SDK field in Project Structure settings to the applicable JDK. For information on configuring Project Structure settings, see [Project structure settings](https://www.jetbrains.com/help/idea/project-settings-and-structure.html) in the JetBrains documentation. 

## Step 3: Convert embedded SQL
<a name="convert-sql"></a>

To convert the embedded SQL code in your Java application to a format that is compatible with your PostgreSQL target database, complete the following steps:

1. In your IDE where Amazon Q is installed, open the Java codebase that contains the embedded SQL you need to convert. 

1. Choose the Amazon Q icon to open the chat panel. 

1. Ask Amazon Q to transform your application in the chat panel.

1. If your Java application is eligible for SQL conversion, Amazon Q will prompt you to choose which type of transformation you'd like to perform. Enter **SQL conversion**. 

1. Amazon Q prompts you to upload the schema metadata file you retrieved from Amazon S3. In the chat, Amazon Q provides instructions for retrieving the file. 

1. Amazon Q prompts you to provide the project that contains the embedded SQL as well as the database schema file. Choose the appropriate files from the dropdown menus in the chat panel.

1. Confirm the details Amazon Q retrieved from the database schema are accurate. 

1. Amazon Q begins converting your SQL code. This might take a few minutes.

1. After Amazon Q converts the SQL code, it provides a diff with any updates it has made to your files. Review the changes in the diffs, and then accept the changes to update your code. 

   Amazon Q also provides a transformation summary with details about the changes it made.

1. After updating your code, return to the AWS DMS console to verify the new SQL is compatible with the migrated database. 

# Transforming code on the command line with Amazon Q Developer
<a name="transform-CLI"></a>

You can transform your applications from the command line with the Amazon Q Developer command line transformation tool. To transform your code, you provide the path to your source code and any necessary configuration files, and Amazon Q generates new code in a series of steps. Throughout the transformation, Amazon Q builds code on your local environment to verify changes. For more information, see [Building code in your local environment](#local-builds). Amazon Q creates a new branch in your repository where it commits the code changes. When the transformation is complete, you can merge the branch into your original branch to incorporate the changes into your codebase. 

To get started, install the command line tool and authenticate, and then see the commands to configure and start a transformation. 

**Topics**
+ [

## Building code in your local environment
](#local-builds)
+ [

## Commands
](#commands)
+ [

# Running a transformation on the command line with Amazon Q Developer
](run-CLI-transformations.md)
+ [

# Troubleshooting transformations on the command line
](troubleshooting-CLI-transformations.md)
+ [

# Amazon Q Developer command line transformation tool version history
](transform-CLI-versions.md)

## Building code in your local environment
<a name="local-builds"></a>

During a transformation, Amazon Q performs verification builds in your local environment. Amazon Q transforms your code on the server side in multiple steps. After each step, Amazon Q sends the code to your local environment to build and test the changes it made. The code is then sent back to the server side to continue the transformation. 

The build in your local environment helps verify the transformed code by allowing Amazon Q to run tests that require access to private resources. To minimize security risks associated with building AI-generated code in your local environment, Amazon Q reviews and updates the code it generates to address security concerns.

**Note**  
Amazon Q performs transformations based on your project's requests, descriptions, and content. To maintain security, avoid including external, unvetted artifacts in your project repository and always validate transformed code for both functionality and security.

## Commands
<a name="commands"></a>

For step-by-step instructions for running these commands, see [Running a transformation on the command line with Amazon Q Developer](run-CLI-transformations.md). 

To configure a transformation and authenticate to Amazon Q Developer Pro, run:

```
qct configure
```

To start a transformation for a Java upgrade, run the following command. For *<your-source-java-version>*, you can enter `JAVA_1.8`, `JAVA_8`, `JAVA_11`, `JAVA_17`, or `JAVA_21`. For *<your-target-java-version>*, you can enter either `JAVA_17` or `JAVA_21`. Both `--source_version` and `--target_version` are optional. The `--trust` flag enables a transformation to run while vetting code to maintain security.

```
qct transform --source_folder <path-to-folder>
    --source_version <your-source-java-version>        
    --target_version <your-target-java-version>
    --trust
```

To start a transformation for a SQL conversion, run:

```
qct transform --source_folder <path-to-folder>
    --sql_conversion_config_file <path-to-sql-config-file>
```

To see what version of the command line tool for transformation you are using, run:

```
qct -v
```

To get help with transformations, run:

```
qct -h
```

To view your transformation job history, run:

```
qct history
```

For more information about viewing and managing your transformation job history, see [Viewing job history on the command line](transformation-job-history.md#cli-job-history).

# Running a transformation on the command line with Amazon Q Developer
<a name="run-CLI-transformations"></a>

Complete these steps to transform your code on the command line with the Amazon Q Developer command line tool.

## Prerequisites
<a name="CLI-transformation-prerequisites"></a>

Before you begin a transformation on the command line, the following prerequisites must be met:
+ If you're upgrading your Java code version, your project meets the [prerequisites for upgrading Java versions with Amazon Q](code-transformation.md#java-upgrade-prerequisites).
+ If you're converting embedded SQL in a Java application, your application meets the [prerequisites for converting embedded SQL with Amazon Q](transform-sql.md#sql-transform-prereqs).
+ You have Python installed on your command line environment. This is how you will install the command line tool. The minimum supported Python version is 3.12.
+ You are running the transformation on macOS or Linux. 
+ The size of your application is 2 GB or smaller. 
+ If you have specific dependencies you want Amazon Q to upgrade, you have configured a [dependency upgrade file](#step-3-dependency-upgrade-file).

## Step 1: Choose authentication method and add permissions
<a name="step-1-permissions-auth"></a>

You can authenticate IAM Identity Center to run transformations on the command line. Ensure you have the proper permissions.

**Note**  
Customer managed keys aren't supported for transformations performed on the command line.

### Add permissions
<a name="transform-CLI-add-permissions"></a>

The IAM identity associated with the Amazon Q Developer subscription you are using to authenticate must have permissions to perform transformations on the command line. Before you proceed, ensure your IAM identity has the permissions defined in [Allow users to run transformations on the command line](id-based-policy-examples-users.md#id-based-policy-examples-allow-cli-transformations).

### Authenticate with IAM Identity Center through a Amazon Q Developer subscription
<a name="auth-IdC"></a>

To authenticate with IAM Identity Center, you must be [subscribed to Amazon Q Developer Pro as a workforce user](subscribe-users.md) by your administrator, and you must provide the Start URL to authenticate through your subscription. You or your administrator can find the Start URL in the Amazon Q Developer console. For more information see, [Finding the Start URL for use with Amazon Q Developer](manage-account-details.md).

To add required permissions, see [Add permissions](#transform-CLI-add-permissions).

You provide the Start URL in [Step 4: Configure and authenticate](#step-4-configure-auth).

## Step 2: Install the tool
<a name="step-2-install"></a>



1. [Download the Amazon Q command line tool for transformations](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.2.2.zip) and unzip it.

   To download a previous version of the command line tool, see [Version history](transform-CLI-versions.md).

1. We recommend that you set up a virtual environment in Python to install the tool. To create a virtual environment, open a terminal window in the directory where you want to install the tool and run:

   ```
   python -m venv qct-cli 
   ```

1. To activate the virtual environment, run: 

   ```
   source qct-cli/bin/activate 
   ```

1. To install the tool on your command line, run the following command with the path to where you unzipped the tool, based on your machine architecture:

------
#### [ Linux\$1aarch64 ]

   ```
   pip install <path/to/unzipped-tool>/Linux_aarch64/amzn_qct_cli-1.2.2-py3-none-any.whl
   ```

------
#### [ Linux\$1x86\$164 ]

   ```
   pip install <path/to/unzipped-tool>/Linux_x86_64/amzn_qct_cli-1.2.2-py3-none-any.whl
   ```

------
**Note**  
If you are using an older version of the command line tool for transformations, replace `1.2.2` with the [version](transform-CLI-versions.md) you downloaded.

1. To verify that the tool was installed, run:

   ```
   which qct
   ```

## Step 3: Create a dependency upgrade file (optional)
<a name="step-3-dependency-upgrade-file"></a>

You can provide Amazon Q with a *dependency upgrade file*, a YAML file that lists your project's dependencies and which versions to upgrade to during a transformation. By providing a dependency upgrade file, you can specify third and first party dependencies that Amazon Q might not otherwise know to upgrade.

First party dependencies refer to the libraries, plugins, and frameworks that your organization maintains and are only available locally or on your organization’s private network. Amazon Q is able to access your first party dependencies when it performs builds in your local environment. For more information, see [Building code in your local environment](transform-CLI.md#local-builds). Third party dependencies are publicly available or open source dependencies that aren’t unique to your organization.

You can specify first party dependencies you want to upgrade in a YAML file, and Amazon Q upgrades them during the JDK upgrade (for example, Java 8 to 17). You can initiate a separate transformation (17 to 17 or 21 to 21) after the initial JDK upgrade to upgrade third-party dependencies.

Once Amazon Q performs a minimum JDK upgrade, you can initiate a separate transformation to upgrade all third party dependencies. Alternatively, you can specify third party dependencies and their versions in a YAML file to only upgrade those dependencies during the library upgrade transformation.

Amazon Q will prompt you to provide a dependency upgrade file during the transformation. If you want to provide one, first make sure you've configured the file properly. The following fields are required in the YAML file:
+ name - The name of the dependency upgrade file.
+ description (optional) - A description of the dependency upgrade file, and for which transformation.
+ dependencyManagement - Contains the list of dependencies and plugins to upgrade.
+ dependencies - Contains the name and version of the libraries to upgrade.
+ plugins - Contains the names and versions of the plugins to upgrade.
+ identifier - The name of the library, plugin, or other dependency.
+ targetVersion - The version of the dependency to upgrade to.
+ versionProperty (optional) - The version of the dependency you're defining, as set with the `properties` tag in your application's `pom.xml` file.
+ originType - Whether the dependency is first or third party, specified by either FIRST\$1PARTY or THIRD\$1PARTY.

Following is an example of a dependency upgrade YAML file, and the required configuration for Amazon Q to parse:

```
name: dependency-upgrade
  
description: "Custom dependency version management for Java migration from JDK 8/11/17 to JDK 17/21"
  
  
dependencyManagement:
  
  dependencies:
  
    - identifier: "com.example:library1"
  
      targetVersion: "2.1.0"
  
      versionProperty: "library1.version"  # Optional
  
      originType: "FIRST_PARTY"   
  
    - identifier: "com.example:library2"
  
      targetVersion: "3.0.0"
  
      originType: "THIRD_PARTY"
  
  plugins:
  
    - identifier: "com.example.plugin"
  
      targetVersion: "1.2.0"
  
      versionProperty: "plugin.version"  # Optional
            
      originType: "THIRD_PARTY"
```

## Step 4: Configure and authenticate
<a name="step-4-configure-auth"></a>

Before you can begin a transformation, you must authenticate with IAM Identity Center and provide configuration details for your transformation. 

1. To start the transformation configuration process, run the following command:

   ```
   qct configure
   ```

1. You are prompted to enter a JDK path for each supported Java version. You only need to specify the path to the JDK of the source version of your Java application, not the target version.

1. Next, to authenticate with IAM Identity Center, you are prompted to enter the start URL for your Amazon Q Developer Pro subscription profile.

   Then, enter the AWS Region where you were subscribed in the following format: `us-east-1`. For a list of supported Regions, see [Supported Regions](regions.md). For a list of Region codes, see [Regional endpoints ](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints) in the *AWS General Reference guide*. 

1. Your configuration preferences are saved to a configuration.ini file. 

## Step 5: Run a transformation
<a name="step-5-run-transformation"></a>

Choose the type of transformation you're performing to see the required configuration and commands. 

**Note**  
Do not turn off or close your local machine during the code transformation because client-side build requires a stable network connection.

------
#### [ Java upgrade ]

**Modifying the transformation plan**

During Java version upgrades, Amazon Q generates a transformation plan that you can review before the transformation begins. You have the option to request the following changes to the plan:
+ Which libraries Amazon Q upgrades, from the list included in the plan
  + Example prompts:
    + Only upgrade <dependency1>, <dependency2>, and <dependency5>
    + Don't upgrade <dependency1> or <dependency2>
+ The target version to upgrade a library to
  + Example prompts:
    + Upgrade <dependency> to this version instead <version>
+ Which steps Amazon Q should perform
  + Example prompts:
    + Only complete steps 1-7
    + Don't run steps 5-9
+ Add additional dependencies to upgrade (only an option when upgrading to a newer JDK version)
  + Example prompts:
    + Also upgrade <dependency1> to <version2>

**Upgrade Java code**

1. Run the following command to start a transformation for a Java upgrade. Replace `<path-to-folder>` with the path to the folder with the code you're transforming and `<your-target-java-version>` with either `JAVA_17` or `JAVA_21`.

   ```
   qct transform --source_folder <path-to-folder>
       --target_version <your-target-java-version>
   ```

   Additional command options: 
   + If you are specifying dependencies to upgrade, add the `--dependency_upgrade_file` option with the path to your dependency upgrade file.
   + If you don’t want to review or update the transformation plan, add the `--no-interactive` flag to your command. Amazon Q won’t ask you for feedback on the plan, and you won’t have the opportunity to request changes.

1. Your Maven version is verified before the transformation begins. If you have at least the minimum supported version, you will see the following output: 

   ```
   Running command: mvn --version at: path/to/current/directory 
   Your Maven version is supported for transformations.
   ```

   If you don’t have a supported version of Maven, you must update it to continue. For more information, see the [Prerequisites](#CLI-transformation-prerequisites). 

1. If you didn’t add the `--no-interactive` flag, Amazon Q will prompt you to provide feedback on the transformation plan. You can explain the changes you want to make in English natural language, and Amazon Q will update the plan if it can support the changes you request. 

1. Amazon Q begins the transformation. It will output status updates throughout the transformation. When it’s complete, Amazon Q provides the path where the transformation results, logs, and configuration files are outputted. 

   Your upgraded code will be committed to the new branch Amazon Q created. Amazon Q will commit the code in one or multiple commits, depending on the selection you made when you ran `qct configure`. 

1. If you're running another transformation after upgrading your Java version, start the second transformation in the same branch where you committed the changes from the first transformation. 

------
#### [ SQL conversion ]

Before you begin, make you sure you've read [Converting embedded SQL in Java applications with Amazon Q Developer](transform-sql.md) to understand the prerequisites for this type of transformation. 

1. To convert embedded SQL, you must first create a YAML file that contains the path to the schema metadata file from your [AWS DMS Schema Conversion](https://docs.aws.amazon.com/dms/latest/sbs/schema-conversion-oracle-postgresql.html).

   Following is the required format of the file: 

   ```
   schema_conv_metadata_path: <path-to-metadata-zip-file>
   ```

1. Run the following command to start a transformation for a SQL conversion. Replace `<path-to-folder>` with the path to the folder with the code you're transforming and `<path-to-sql-config-file>` with the path to the YAML file you created in step 1.

   ```
   qct transform --source_folder <path-to-folder>
       --sql_conversion_config_file <path-to-sql-config-file>
   ```

1. If Amazon Q finds multiple schemas in your schema metadata file, it will stop the transformation and provide a list of the detected schemas. Choose which schema to use for the SQL conversion, and then add a new field `schema: <schema-name>` to the YAML file. 

1. Amazon Q begins the transformation. It will output status updates throughout the transformation. When it’s complete, Amazon Q provides the path where the transformation results, logs, and configuration files are outputted. 

   Your upgraded code will be committed to the new branch Amazon Q created.

------

## Pause or cancel a transformation
<a name="pause-cancel-CLI-transformations"></a>

You can choose to pause or cancel your current transformation job. You can pause a transformation job for up to 12 hours before you can resume again.

**To pause or cancel a code transformation job**

1. In your CLI terminal, press **Ctrl\$1C** on your keyboard.

1. Select whether you want to pause or cancel your tranformation.
   + Enter `1` if you want to puase the code transformation job. You can resume the job within 12 hours to continue the code transformation using the following QCT command: ``qct transform --source_folder=≤/Path/Given/Originally/To/QCT>``.
   + Enter `2` if you want to cancel the code tranformation job.

# Troubleshooting transformations on the command line
<a name="troubleshooting-CLI-transformations"></a>

The following information can help you troubleshoot common issues when transforming applications on the command line with Amazon Q Developer.

## Why is my bearer token not refreshing?
<a name="bearer-token-refresh"></a>

If you see the following error, it means you need to refresh the bearer token used for authentication.

```
Refreshing bearer token
('Error refreshing bearer token due to: ', InvalidGrantException('An error occurred (InvalidGrantException) when calling the CreateToken operation: '))
('Error getting bearer token due to: ', RuntimeError(('Error refreshing bearer token due to: ', InvalidGrantException('An error occurred (InvalidGrantException) when calling the CreateToken operation: '))))
```

To address this error, run the following command:

```
rm ~/.aws/qcodetransform/credentials.json
```

Once you remove the outdated credentials file, run `qct transform` again to restart the transformation.

## Why isn't the most recent version of the command line tool being used?
<a name="install-latest-version"></a>

When you download a new version of the command line tool for transformations, sometimes a previous version of the tool still gets used.

To make you're using the most recent version of the tool, download the [most recent version](transform-CLI-versions.md). Then run the following command with the path to where you unzipped the tool, based on your machine architecture:

------
#### [ Linux\$1aarch64 ]

```
pip install <path/to/unzipped-tool>/Linux_aarch64/amzn_qct_cli-1.2.2-py3-none-any.whl --force-reinstall
```

------
#### [ Linux\$1x86\$164 ]

```
pip install <path/to/unzipped-tool>/Linux_x86_64/amzn_qct_cli-1.2.2-py3-none-any.whl --force-reinstall
```

------

**Note**  
If you're using an older version of the command line tool for transformations, replace `1.2.2` with the [version](transform-CLI-versions.md) you downloaded.

# Amazon Q Developer command line transformation tool version history
<a name="transform-CLI-versions"></a>

Review the following information for details about current and past releases of the Amazon Q Developer command line transformation tool. The table includes the download link, release date, and release notes for each version. 


****  

| Version | Release date | Release notes | 
| --- | --- | --- | 
|   [1.2.2 (latest)](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.2.2.zip)   | February 26, 2026 | Added promotional banner for AWS Transform custom to QCT CLI. Banner display on transform command execution and help text. New --skip-banner flag to suppress banner output. | 
|   [1.2.1](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.2.1.zip)   | September 9, 2025 | Updated Maven extension to include first-party parent POMs during initial project upload | 
|   [1.2.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.2.0.zip)   | August 7, 2025 | Added support for viewing job history and for module structure visualization for Maven Java projects. | 
|   [1.1.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.1.0.zip)   | July 21, 2025 | Includes support for collecting telemetry about transformations. | 
|   [1.0.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-1.0.0.zip)   | June 27, 2025 | The command line transformation tool is generally available and supports authentication through AWS IAM Identity Center with a Amazon Q Developer Pro subscription only. Added support for subscriptions in the Europe (Frankfurt) Region. | 
|   [0.6.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.6.0.zip)   | June 6, 2025 | Includes support for providing a dependency upgrade file and iterating on the transformation plan. | 
|   [0.5.2](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.5.2.zip)   | April 16, 2025 | Bug fixes to resolve issues when resuming jobs and failures for applications with first-party dependencies. | 
|   [0.5.1](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.5.1.zip)   | March 13, 2025 | When you authenticate with IAM, you no longer need to provide an AWS Region. Also includes bug fix to include job status in output logs.  | 
|   [0.5.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.5.0.zip)   | February 28, 2025 | Includes support for authenticating with IAM through the AWS CLI. | 
|   [0.4.1](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.4.1.zip)   | February 17, 2025 | Bug fix to include support for entering the AWS Region where your Amazon Q Developer subscription is configured. | 
|   [0.4.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.4.0.zip)   | February 14, 2025 | Includes support for upgrading Java applications to Java 21. | 
|   [0.3.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.3.0.zip)   | February 12, 2025 | Includes support for converting embedded SQL in Java applications. | 
|   [0.2.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.2.0.zip)   | February 3, 2025 | Includes support for receiving upgraded Java code in multiple commits. | 
|  [0.1.0](https://desktop-release.codewhisperer.us-east-1.amazonaws.com/amzn_qct_cli/amzn_qct_cli-0.1.0.zip)  | November 27, 2024 | Initial release. Includes support for upgrading Java code versions from the command line. | 

# Viewing transformation job history
<a name="transformation-job-history"></a>

Amazon Q provides a comprehensive overview of your Java transformation job history, allowing you to track and review your transformation jobs in both IDEs and the command line.

Transformation job history includes the following information about a job:
+ **Date** – When the transformation job was executed
+ **Project name** – The name of the project that was transformed
+ **Status** – The current status of the transformation job
+ **Duration** – How long the transformation took to complete
+ **Job ID** – A unique identifier for the transformation job
+ **Diff patch** – A link or path to the final diff patch file showing all code changes
+ **Summary** – A link or path to the transformation summary file with details about the changes made

**Note**  
Only transformations run since this feature was released will be available in the job history. For the feature release date, see [Document history for Amazon Q Developer User Guide](doc-history.md). 

## Viewing job history in IDEs
<a name="ide-job-history"></a>

**Note**  
This feature is currently available in Visual Studio Code only.

The Transformation Hub in Visual Studio Code provides a comprehensive view of your Java transformation job history. 

A table in the Transformation Hub lists your 10 most recent transformation jobs from the last 30 days. From the table, you can access transformation artifacts and refresh jobs to track progress and get missing artifacts.

### Retrieve transformation artifacts
<a name="retrieve-artifacts"></a>

You can access transformation artifacts, such as the diff patches and summary files, from the job history table. Choose the appropriate links to open the diff or summary in your IDE.

Artifacts are stored locally in the `.aws/transform` directory, so you can also access previously downloaded transformation artifacts from past jobs.

### Refresh job status
<a name="refresh-jobs"></a>

You can refresh the job status from the job history table. Refresh a failed job to get an updated status from the server side that may not have reached your server yet, such as when Amazon Q is able to resume a failed job. You can also refresh completed jobs to download artifacts that may not have appeared yet. 

### How job history is stored for jobs run in the IDE
<a name="ide-history-storage"></a>

For Visual Studio Code, all transformation job information and artifacts are stored locally in the `.aws/transform` directory. The storage is organized as follows:

```
.aws/transform/
├── [project-name-1]/
│   ├── [job-id-1]/
│   │   ├── diff.patch
│   │   ├── [summary-1]/
│   │   │   └── summary.md
│   │   │   └── buildCommandOutput.log
│   └── [job-id-2]/
│       ├── diff.patch
│       ├── [summary-2]/
│       │   └── summary.md
│       │   └── buildCommandOutput.log
└── [project-name-2]/
    └── [job-id-3]/
        ├── diff.patch
        ├── [summary-3]/
        │   └── summary.md
        │   └── buildCommandOutput.log
```

## Viewing job history on the command line
<a name="cli-job-history"></a>

For transformations on the command line, the **qct history** command provides access to your transformation job history with customization options.

For the CLI, transformation job history information is stored locally in the `.aws/qcodetransform/history/` directory.

### Using the qct history command
<a name="cli-history-command"></a>

The basic command to view your transformation job history is:

```
qct history
```

By default, this command displays the 10 most recent transformation jobs, in addition to any paused or in-progress jobs.

You can also specify how many job history entries to display with the **--limit** flag. For example, to show 20 jobs, run:

```
qct history --limit 20
```

# Troubleshooting issues with Java transformations
<a name="troubleshooting-code-transformation"></a>

The following information can help you troubleshoot common issues when transforming Java applications with Amazon Q Developer.

**Topics**
+ [

## Why can't Amazon Q upload my project?
](#project-upload-fail)
+ [

## Why are my Maven commands failing?
](#maven-commands-failing)
+ [

## How do I add Maven to my `PATH`?
](#add-maven-to-path)
+ [

## Why can't Amazon Q build my code?
](#build-fail)
+ [

## Why did my transformation fail after 55 minutes?
](#build-time-limit)
+ [

## Why can’t I download my transformed code?
](#download-code-fail)
+ [

## How do I access code transformation logs?
](#logs)
+ [

## How do I find my transformation job ID?
](#job-id)

## Why can't Amazon Q upload my project?
<a name="project-upload-fail"></a>

If your project fails to upload, it’s likely due to one of the following issues. See the topic that corresponds to the error you see from Amazon Q. 

**Topics**
+ [

### Reduce project size
](#reduce-project-size)
+ [

### Configure proxy settings in your IDE
](#configure-proxy)
+ [

### Allow access to Amazon S3
](#allowlist-s3-bucket)

### Reduce project size
<a name="reduce-project-size"></a>

To transform your code, Amazon Q generates a project artifact, which includes your source code, project dependencies, and build logs. The maximum project artifact size for a transformation job is 2 GB. If you get an error related to project artifact size, you must decrease the size of your project or try transforming a smaller project. You can view the size of your project artifact file in the code transformation logs. For more information, see [How do I access code transformation logs?](#logs)

### Configure proxy settings in your IDE
<a name="configure-proxy"></a>

To transform your code, Amazon Q uploads your project artifact to a service-owned Amazon S3 bucket. Part of the upload process involves using SSL or TLS certificates to establish communication between Amazon S3 and your IDE. If you are using a proxy server, the SSL or TLS certificates used by your proxy server must be trusted, otherwise Amazon Q is not able to upload your project. 

If you receive an error related to your proxy or certificates, you likely need to configure your IDE or operating system to trust your certificates or update other proxy settings.

**Note**  
You might also encounter issues unrelated to certificates if you are behind your organization’s proxy server or firewall. If you complete the following procedures to configure your certificates and still have issues, contact your network administrator to ensure you are allowed to communicate with Amazon S3 from your IDE. For more information, see [Allow access to Amazon S3](#allowlist-s3-bucket). 

#### Configure certificates in JetBrains
<a name="configure-proxy-JB"></a>

To configure your JetBrains IDE Java Runtime Environment (JRE) to trust the SSL or TLS certificates used by your proxy server, you must import the SSL or TLS certificates to the `cacerts` file in the JRE. The `cacerts` file is a file that contains trusted root certificates for secure connections such as HTTPS and SSL, and it's part of the JRE's security settings. To import a certificate, complete the following procedure. 

**Note**  
We recommend making a backup of the `cacerts` file before modifying it, as any mistakes can cause issues with secure connections.

1. Determine the path to the `cacerts` file in your JRE. The path of the `cacerts` file in the internal JRE shipped with your JetBrains IDE depends on the operating system and the version of the JetBrains IDE you’re using. 

   Following are examples of paths to the `cacerts` file in common operating systems. Choose your operating system to see examples.
**Note**  
 `<JetBrains Installation Folder>` refers to the directory where JetBrains products are installed. This directory is typically chosen during the installation process.  
The `jbr` folder represents the JRE bundled with JetBrains IDEs, which is a specific version of the JRE tailored for use with JetBrains IDEs.

------
#### [ Windows ]

   The `cacerts` file path for a JetBrains IDE installed on Windows is:

   ```
   <JetBrains Installation Folder>\jbr\bin\cacerts
   ```

   For example, if you installed a JetBrains IDE on Windows in the default location, the path might be:

   ```
   C:\Program Files\JetBrains\jbr\bin\cacerts
   ```

------
#### [ macOS ]

   The `cacerts` file path for a JetBrains IDE installed on macOS is:

   ```
   /Applications/JetBrains Toolbox/<version>/JetBrains Toolbox.app/Contents/jbr/Contents/Home/lib/security/cacerts
   ```

   For example, if you installed a JetBrains IDE on macOS in the default location, the path might be:

   ```
   /Applications/JetBrains Toolbox/2022.3.4/JetBrains Toolbox.app/Contents/jbr/Contents/Home/lib/security/cacerts
   ```

------
#### [ Linux ]

   The `cacerts` file path for a JetBrains IDE installed on Linux is:

   ```
   /opt/jetbrains/jbr/lib/security/cacerts
   ```

------

1. Determine the certificate you need to import to the `cacerts` file. The certificate file typically has a `.cer`, `.crt`, or `.der` file extension. If you aren’t sure which certificates you need to add, contact your network administrator.

1. Import the certificate to the `cacerts` keystore. You can do this with the Java `keytool` command. 

   1. Open a command prompt and enter the following command:

      ```
      keytool -import -alias <alias> -file <certificate_file> -keystore <path_to_cacerts>
      ```

   1. For `<alias>`, you can add a name for the certificate you are importing to refer to it later. This option is optional.

   1. For `<certificate_file>`, specify the path to the certificate you are importing. This should be a path to the `.cer`, `.crt`, or `.der` file containing the certificate.

   1. For `<path_to_cacerts>`, specify the path to the `cacerts` keystore file you saved in step 1. This is the file where you are importing the certificate. 

   For example, if you want to import a certificate named `my_certificate.cer` into the `cacerts` keystore of the bundled JRE in IntelliJ IDEA on Windows, and you want to give the alias `myalias` to the certificate, the command might be:

   ```
   keytool -import -alias myalias -file my_certificate.cer -keystore "C:\Program Files\JetBrains\IntelliJ IDEA 2022.3.2\jbr\bin\cacerts"
   ```

1. During the import process, you'll be prompted to enter the keystore password. The default password for the `cacerts` keystore is `changeit`. 

1. After running the command, you'll be asked to trust the certificate. To confirm the certificate is trusted and complete the import, enter `yes`.

1. You might also need to add the certificates to the IDE itself, in addition to the JRE. For more information, see [Server Certificates](https://www.jetbrains.com/help/idea/settings-tools-server-certificates.html) in the JetBrains documentation.

#### Configure certificates in Visual Studio Code
<a name="configure-proxy-VSC"></a>

To configure Visual Studio Code to trust the SSL or TLS certificates used by your proxy server, make sure you have configured the following proxy settings for your operating system.

##### Configure certificates in Visual Studio Code on macOS
<a name="certs-mac"></a>

Configure the following proxy settings for Visual Studio Code on macOS.

##### Add certificates to your macOS keychain
<a name="w2aac11c16c17c13c23b7b9c11b5b1b5"></a>

If you haven’t already, you must add the certificates used by your proxy server to your macOS keychain. For information on adding certificates to your keychain, see [Add certificates to a keychain using Keychain Access on Mac](https://support.apple.com/guide/keychain-access/add-certificates-to-a-keychain-kyca2431/mac) in the Keychain Access User Guide.

##### Install the Mac CA VSCode extension
<a name="w2aac11c16c17c13c23b7b9c11b5b1b7"></a>

The [Mac CA VSCode extension](https://marketplace.visualstudio.com/items?itemName=linhmtran168.mac-ca-vscode) allows Amazon Q to access the certificates you added to Keychain Access on your Mac. 

To install the extension:

1. Search for `mac-ca-vscode` in the VS Code extensions pane, and choose **Install**. 

1. Restart VS Code.

##### Update proxy settings in VS Code on macOS
<a name="w2aac11c16c17c13c23b7b9c11b5b1b9"></a>

Update the following settings to make sure VS Code is configured properly for your proxy. 

1. Open settings in VS Code.

1. Enter `proxy` in the search bar.

1. In the **Http: Proxy** field, add your proxy URL.

1. Deselect **Http: Proxy Strict SSL**.

1. In the **Http: Proxy Support** dropdown list, choose **on**.

1. In the settings search bar, enter `http.experimental.systemCertificatesV2`. Select **Http › Experimental: System Certificates V2**. 

##### Configure certificates in Visual Studio Code on Windows
<a name="certs-windows"></a>

Configure the following proxy settings for Visual Studio Code on Windows.

##### Add certificate as a trusted root certificate on Windows
<a name="w2aac11c16c17c13c23b7b9c11b5b3b5"></a>

If you haven't already, you must add the certificates used by your proxy server to your Trusted Root Certification Authorities store on Windows. To add a certificate, complete the following procedure: 

1. Open the search tool or a Run command window. 

1. Enter the following to open the Certificate Manager tool:

   ```
   certmgr.msc
   ```

1. Choose the **Trusted Root Certification Authorities** store.

1. Right-click **Certificates**, choose **All Tasks**, and then choose **Import...**.

1. Follow the instructions given to import your proxy certificate.

1. After you've imported your certificate, confirm the certificate was added. 

   In the **Trusted Root Certification Authorities** store, double click **Certificates**. Right-click the certificate you added and choose **Properties**. Under **Certificate purposes**, the option **Enable all purposes for this certificate** should be selected.

##### Install the Win-CA VSCode extension
<a name="w2aac11c16c17c13c23b7b9c11b5b3b7"></a>

The [Win-CA VSCode extension](https://marketplace.visualstudio.com/items?itemName=ukoloff.win-ca) allows Amazon Q to access the certificates you added to Trusted Root Certificates in Windows. 

To install the extension:

1. Search for `win-ca ` in the VS Code settings pane.

1. In the **Inject** dropdown list, choose **append**.

##### Update proxy settings in VS Code on Windows
<a name="w2aac11c16c17c13c23b7b9c11b5b3b9"></a>

Update the following settings to make sure VS Code is configured properly for your proxy. 

1. Open settings in VS Code.

1. Enter `proxy` in the search bar.

1. In the **Http: Proxy** field, add your proxy URL.

1. Deselect **Http: Proxy Strict SSL**.

1. In the **Http: Proxy Support** dropdown list, choose **on**.

1. In the settings search bar, enter `http.experimental.systemCertificatesV2`. Select **Http › Experimental: System Certificates V2**. 

1. Restart VS Code.

### Allow access to Amazon S3
<a name="allowlist-s3-bucket"></a>

During a transformation, Amazon Q uploads your code to a service-owned Amazon S3 bucket. If your network or organization hasn’t configured access to Amazon S3, Amazon Q isn’t able to upload your project. 

To ensure Amazon Q can upload your project, make sure your proxy configuration and other network components, such as Data Lost Prevention (DLP) policies, are configured to allow access to Amazon S3. You might also need to allowlist the Amazon S3 bucket where Amazon Q uploads your project. For more information, see [Amazon S3 bucket URLs and ARNs to allowlist](firewall.md#data-perimeters). 

If you transform a large project, DLP policies or other network components might cause delays and prevent a successful upload if they aren’t configured to allowlist the Amazon S3 bucket. If you choose not to allowlist the bucket, you might need to transform a smaller project so that Amazon Q can upload it.

## Why are my Maven commands failing?
<a name="maven-commands-failing"></a>

Following are Maven configuration issues that you might see in the JetBrains and Visual Studio Code IDEs. If you address the issues and still see Maven errors, there might be an issue with your project. Use the information in the error logs to address any issues with your project, and then try transforming your project again. 

### Update Maven configuration in JetBrains
<a name="jetbrains"></a>

If a transformation fails in JetBrains due to Maven command issues, the error logs appear on the **Run** tab. Use the information in the logs to address the issue. Following are some issues that you might need to address: 
+ Make sure that your Maven home path is set to **Bundled**. Go to **Settings**, and then expand the **Build, Execution, Deployment** section. Expand the **Build Tools** section and then expand **Maven**. In the **Maven home path** dropdown list, choose **Bundled**. 
+ Make sure that the Java runtime environment (JRE) is using your project JDK. Go to **Settings**, and then expand the **Build, Execution, Deployment** section. Expand **Maven** and choose **Runner**. In the **JRE** dropdown list, choose **Use Project JDK**. 
+ Make sure that Maven is enabled. Go to **Settings** and choose **Plugins**. Search for Maven and choose the Maven plugin. If you see an **Enable** button, choose it to enable Maven. 

### Update Maven configuration in Visual Studio Code
<a name="vscode"></a>

If a transformation fails in VS Code because of Maven command issues, a text file that contains the error logs opens in a new tab. Use the information in the logs to address the issue.

Make sure that you have configured either one of the following options: 
+ Your project contains a Maven wrapper in the project root folder
+ A version of Maven supported by Amazon Q is available on your `PATH`

For more information, see [How do I add Maven to my `PATH`?](#add-maven-to-path) 

## How do I add Maven to my `PATH`?
<a name="add-maven-to-path"></a>

To transform your code in VS Code without using a Maven wrapper, you must install Maven and add it to your `PATH` variable. 

To check if you have Maven installed correctly already, run `mvn -v` in a new OS terminal outside of Visual Studio Code. You should see an output with your Maven version.

If you get an output in your Visual Studio Code terminal but not in your OS terminal, or if the command isn't found, you need to add Maven to your `PATH`.

 To add Maven to your `PATH`, follow the instructions for your machine.

------
#### [ macOS ]

To add Maven to your macOS `PATH`, complete the following steps.

1. Locate your Maven installation directory, or the folder where you installed Maven, and save the path to that folder.

1. Open the configuration file for your shell in an editor of your choice. For recent macOS versions, the default shell is `zsh` and the default configuration file is located at `~/.zshrc`. 

   Add the following lines to the bottom of the configuration file. Set the value of `M2_HOME` to the path you saved in step 1:

   ```
   export M2_HOME="your Maven installation directory"
   export PATH="${M2_HOME}/bin:${PATH}"
   ```

   These commands make the `mvn` command available in all terminals.

1. Close all OS terminal windows and quit all Visual Studio Code instances.

1. To verify that Maven was added to your `PATH`, open a new OS terminal and run the following command:

   ```
   mvn -v
   ```

   You should see an output with your Maven version.

1. After seeing your Maven output, restart Visual Studio Code. You might also need to restart your machine. Open a new Visual Studio Code terminal and run the following command: 

   ```
   mvn -v
   ```

   The output should be identical to the output in step 4. If the Visual Studio Code output is different, try the following to make sure your setup is correct:
   + Check your `PATH` variable in Visual Studio Code. An IDE extension might be altering the `PATH` such that it differs from your local `PATH` variable. Uninstall the extension to remove it from your `PATH`.
   + Check your default shell in Visual Studio Code. If it's set to something other than `zsh`, repeat these steps for your shell.

------
#### [ Windows ]

To add Maven to your Windows `PATH`, complete the following steps: 

1. Locate your Maven installation directory, or the folder where you installed Maven, and save the path to that folder.

1. Open the Environment Variables window:

   1. Choose the Windows button to open the search bar.

   1. Enter `Edit environment variables for your account` and choose it.

1. In the **Environment Variables** window, look for the Path variable. If you have a Path variable already, choose **Edit...** to update it. If you don't see a Path variable, choose **New...** to add one. 

1. In the **Edit environment variable** window that appears, double click the existing path to edit it, or choose **New** to add a new path entry.

   Replace the existing Maven path entry with the path you saved in step 1, or add the path as a new entry. At the end of the path, add `\bin` as a suffix, as in the following example:

   ```
   C:\Users\yourusername\Downloads\apache-maven-3.9.6-bin\apache-maven-3.9.6\bin
   ```

1. Choose **OK** to save the path entry, and then choose **OK** again in the **Environment Variables** window.

1. Open a new Command Prompt and run the following command:

   ```
   mvn -v
   ```

   You should see an output with your Maven version.

------

## Why can't Amazon Q build my code?
<a name="build-fail"></a>

If the transformation fails when Amazon Q is building your code, your project may not be configured properly for the environment where Amazon Q builds your code. You might need to update your build configuration or code implementation.

Review the build log output Amazon Q provides to determine if there are changes you can make to your project. Following are some common issues that might prevent Amazon Q from building your code. 

### Remove absolute paths in pom.xml
<a name="remove-absolute-path"></a>

If you have an absolute path in your pom.xml file, Amazon Q won’t be able to find the relevant files, and as a result might not be able to build your code.

Following is an example of an absolute path that you could have in your `pom.xml` file:

```
<toolspath>
    <path>/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/lib/tools.jar</path>
</toolspath>
```

Instead of using an absolute path, you can create a relative path using a pointer. Following is an example of how you can replace the previous absolute path with a relative path:

```
<toolspath>
    <path>${java.home}/../lib/tools.jar</path>
</toolspath>
```

### Remove local or external databases in unit tests
<a name="remove-external-databases"></a>

Amazon Q runs any unit tests in your project when it builds your code. If a unit test calls a local or external database, Amazon Q won’t have access to the database, causing the build to fail. To prevent the build from failing, you must either remove the database call from the unit test or remove the unit test before submitting the transformation. 

## Why did my transformation fail after 55 minutes?
<a name="build-time-limit"></a>

If your code transformation job fails after 55 minutes, your code build time likely exceeds the build time limit. There is currently a time limit of 55 minutes for building your code. 

If your local build time takes 55 minutes or longer, reduce your project’s build time to transform your code. If your local build is faster than the build with Code Transformation, check your project for tasks that might be failing or take a longer time in a different environment. Consider disabling long-running test cases. Also consider using timeouts for attempts to access resources that might not be available from the secure IDE environment or the internet. 

## Why can’t I download my transformed code?
<a name="download-code-fail"></a>

If you aren’t able to download your code after your transformation is complete, it’s likely due to one of the following issues. See the topic that corresponds to the error you see from Amazon Q. 

**Topics**
+ [

### Reduce project size
](#reduce-project-size-output)
+ [

### Download code diff within 30 days
](#download-30-hrs)
+ [

### Configure proxy settings in your IDE
](#configure-proxy-download)
+ [

### Remove wildcard characters in JetBrains proxy settings
](#remove-wildcard)

### Reduce project size
<a name="reduce-project-size-output"></a>

After the transformation is complete, Amazon Q generates an output artifact that contains a diff with your upgraded code and a transformation summary with information about the changes it made. The output artifact must be 1 GB or less in order for the IDE to download it. 

If the output artifact exceeds the limit, you will not be able to download your upgraded code or transformation summary. Try transforming a smaller project to prevent a large output artifact. If the issue persists, contact Support. For information about contacting Support with Amazon Q, see [Using Amazon Q Developer to chat with Support](support-chat.md).

### Download code diff within 30 days
<a name="download-30-hrs"></a>

The code diff file with your upgraded code is only available for 30 days after the transformation is complete. If it’s been over 30 days since the transformation completed, restart the transformation to download the diff file.

### Configure proxy settings in your IDE
<a name="configure-proxy-download"></a>

Amazon Q downloads your upgraded code from a service-owned Amazon S3 bucket. Part of the download process involves using SSL or TLS certificates to establish communication between Amazon S3 and your IDE. If you are using a proxy server, the SSL or TLS certificates used by your proxy server must be trusted, otherwise Amazon Q is not able to upload your project.

To download your code, you might need to configure your IDE to trust certificates or update other proxy settings. For more information on updating your proxy settings, see [Configure proxy settings in your IDE](#configure-proxy).

### Remove wildcard characters in JetBrains proxy settings
<a name="remove-wildcard"></a>

If you have configured proxy settings in your JetBrains IDE, you might see the following error when downloading your upgraded code: 

```
software.amazon.awssdk.core.exception.SdkClientException: 
Unable to execute HTTP request: Dangling meta character '*' near index 0
```

This is likely caused by the presence of a wildcard character (\$1) in the **No proxy for** field of your IDE's proxy settings. The Java SDK used by Amazon Q doesn't support wildcard entries in this field. 

To download your code, remove any wildcards from the **No proxy for** field, and then restart your IDE. If you need to specify hosts that should bypass the proxy, use a regular expression instead of a wildcard. To update proxy settings in your JetBrains IDE, see [HTTP Proxy](https://www.jetbrains.com/help/idea/settings-http-proxy.html) in the JetBrains documentation.

## How do I access code transformation logs?
<a name="logs"></a>

### Access logs in JetBrains
<a name="jetbrains-logs"></a>

For information about how to access JetBrains log files, see [Locating IDE log files](https://intellij-support.jetbrains.com/hc/en-us/articles/207241085-Locating-IDE-log-files) in the JetBrains documentation. 

To find logs emitted by Amazon Q in JetBrains, search the IDE logs for the following string:

```
software.aws.toolkits.jetbrains.services.codemodernizer
```

Code transformation logs start with the preceding string. Logs generated by Maven are displayed on the **Run** tab and have the preceding string before and after the log entry. 

### Access logs in Visual Studio Code
<a name="vsc-logs"></a>

To find logs emitted by Amazon Q in VS Code, complete the following steps:

1. Choose **View** in the top navigation bar, and then choose **Command Palette**.

1. Search `Amazon Q: View Logs` in the command palette that appears.

1. The logs open in the IDE. To search the log files for `CodeTransformation`, use `CMD + F` or `Control + F`. 

Code transformation logs in VS Code are prefixed with `CodeTransformation:`. Following is an example of a log generated in VS Code for a Maven copy dependencies error:

```
2024-02-12 11:29:16 [ERROR]: CodeTransformation: Error in running Maven copy-dependencies command mvn = /bin/sh: mvn: command not found
```

## How do I find my transformation job ID?
<a name="job-id"></a>

### Find your job ID in JetBrains
<a name="jetbrains"></a>

To find a transformation job ID in JetBrains, go to the **Transformation details** tab in the **Transformation Hub** and choose the **Show Job Status** (clock) icon. 

### Find your job ID in Visual Studio Code
<a name="vs-code"></a>

To find a transformation job ID in VS Code, go to the **Transformation Hub** and choose the **Show Job Status** (clock) icon. 

# Transforming .NET applications with Amazon Q Developer
<a name="transform-dotnet-IDE"></a>

Amazon Q Developer can port your Windows-based .NET applications to Linux-compatible cross-platform .NET applications through a generative AI-powered refactoring workflow. Amazon Q also helps you upgrade outdated versions of cross-platform .NET applications to newer versions. 

To transform a .NET solution or project, Amazon Q analyzes your codebase, determines the necessary updates to port your application, and generates a transformation plan before the transformation begins. During this analysis, Amazon Q divides your .NET solution or project into code groups that you can view in the transformation plan. A *code group* is a project and all its dependencies that together generate a buildable unit of code such as a dynamic link library (DLL) or an executable. 

During the transformation, Amazon Q provides step-by-step updates in a Transformation Hub where you can monitor progress. After transforming your application, Amazon Q generates a summary with the proposed changes in a diff view for you to optionally verify the changes before you accept them. When you accept the changes, Amazon Q makes in-place updates to your .NET solution or project. 

Amazon Q performs four keys tasks to port .NET applications to Linux:
+ **Upgrades language version** – Replaces outdated C\$1 versions of code with Linux-compatible C\$1 versions.
+ **Migrates from .NET Framework to cross-platform .NET** – Migrates projects and packages from Windows dependent .NET Framework to cross-platform .NET compatible with Linux.
+ **Rewrites code for Linux compatibility** – Refactors and rewrites deprecated and inefficient code components.
+ **Generates a Linux compatibility readiness report **– For open-ended tasks where user intervention is needed to make the code build and run on Linux, Amazon Q provides a detailed report of actions needed to configure your application after transformation.

For more information about how Amazon Q performs .NET transformations, see [How it works](how-dotnet-transformation-works.md). 

**Topics**
+ [

## Quotas
](#quotas-dotnet-transformation)
+ [

# Porting a .NET application with Amazon Q Developer in Visual Studio
](port-dotnet-application.md)
+ [

# How Amazon Q Developer transforms .NET applications
](how-dotnet-transformation-works.md)
+ [

# Troubleshooting issues with .NET transformations in the IDE
](troubleshooting-dotnet-transformation-IDE.md)

## Quotas
<a name="quotas-dotnet-transformation"></a>

.NET transformations with Amazon Q in the IDE maintain the following quotas: 
+ **Lines of code per job** – The maximum number of code lines that Amazon Q can transform in a given transformation job. This is also the monthly total limit for .NET transformations. 
+ **Concurrent jobs** – The maximum number of transformation jobs you can run at the same time. This quota applies to all transformations in the IDE, including [Java transformations](transform-java.md).


| Resource | Quotas | 
| --- | --- | 
| Lines of code per job | 100,000 lines of code | 
| Concurrent jobs |  1 job per user 2 jobs per AWS account  | 

# Porting a .NET application with Amazon Q Developer in Visual Studio
<a name="port-dotnet-application"></a>

Complete these steps to port a Windows-based .NET application to a Linux-compatible cross-platform .NET application with Amazon Q Developer in Visual Studio. 

## Step 1: Prerequisites
<a name="transform-dotnet-prerequisites"></a>

Before you continue, make sure you’ve completed the steps in [Set up Amazon Q in your IDE](https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/q-in-IDE.html).

Make sure that the following prerequisites for your application are met before you begin a .NET transformation job:
+ Your application contains only .NET projects written in C\$1.
+ Your application only has Microsoft-authored NuGet package dependencies 
+ Your application only uses UTF-8 characters. If your application uses non-UTF-8 characters, Amazon Q will still attempt to transform your code.
+ If your application is dependent on Internet Information Services (IIS), only default IIS configurations are used
+ Amazon Q will evaluate the type of the project you selected and its dependencies to create a code group. Your code group can only have the following project types:
  + Console application
  + Class library 
  + Web API
  + WCF Service
  + Business logic layers of Model View Controller (MVC) and Single Page Application (SPA)
  + Test projects

**Note**  
Amazon Q doesn’t support transforming UI layer components such as Razor views or WebForms ASPX files. If Amazon Q detects UI layer components in your solution or project, it will perform a partial transformation by excluding UI layer components, and you might need to refactor further to make your code buildable on the target .NET version.

## Step 2: Transform your application
<a name="transform-dotnet-app"></a>

To transform your .NET solution or project, complete the following procedure:

1. Open any C\$1 based solution or project in Visual Studio that you want to transform. 

1. Open any C\$1 code file in the editor. 

1. Choose **Solution Explorer**.

1. From the Solution Explorer, right click a solution or project you want to transform, and then choose **Port with Amazon Q Developer**.

1. The **Port with Amazon Q Developer** window appears. 

   The solution or project you selected will be chosen in the **Choose a solution or project to transform** dropdown menu. You can expand the menu to choose a different solution or project to transform. 

   In the **Choose a .NET target** dropdown menu, choose the .NET version you want to upgrade to.

1. Choose **Confirm** to begin the transformation.

1. Amazon Q begins transforming your code. You can view the transformation plan it generates for details about how it will transform your application.

   A **Transformation Hub** opens where you can monitor progress for the duration of the transformation. After Amazon Q has completed the **Awaiting job transformation startup** step, you can navigate away from the project or solution for the duration of the transformation.

1. After the transformation is complete, navigate to the **Transformation Hub** and choose **View diffs** to review the proposed changes from Amazon Q in a diff view. 

1. Choose **View code transformation summary** for details about the changes Amazon Q made. You can also download the transformation summary by choosing **Download summary as .md**. 

   If any of the items in the **Code groups** table require input under the Linux porting status, you must manually update some files to run your application on Linux. 

   1. From the **Actions** dropdown menu, choose **Download Linux readiness report**. 

   1. A .csv file opens with any changes to your project or solution that you must complete before your application is Linux compatible. It includes the project and file that need to be updated, a description of the item to be updated, and an explanation of the issue. Use the **Recommendation** column for ideas on how to address a Linux readiness issue. 

1. To update your files in place, choose **Accept changes** from the **Actions** dropdown menu. 

# How Amazon Q Developer transforms .NET applications
<a name="how-dotnet-transformation-works"></a>

Review the following sections for details about how .NET transformation with Amazon Q Developer works. 

## Analyzing your application and generating a transformation plan
<a name="analyzing-app-generating-plan"></a>

Before a transformation begins, Amazon Q builds your code locally to ensure it’s buildable and configured correctly for transformation. Amazon Q then uploads your code to a secure and encrypted build environment on AWS, analyzes your codebase, and determines the necessary updates to port your application. 

During this analysis, Amazon Q divides your .NET solution or project into code groups. A code group is a project and all its dependencies that together generate a buildable unit of code such as a dynamic link library (DLL) or an executable. Even if you didn’t select all project dependencies to be transformed, Amazon Q determines the dependencies needed to build your selected projects and transforms them too, so that your transformed application will be buildable and ready for use.

After analyzing your code, Amazon Q generates a transformation plan that outlines the proposed changes that it will make, including a list of code groups and their dependencies that will be transformed. 

## Transforming your application
<a name="transforming-app"></a>

To start the transformation, Amazon Q builds your code again in the secure build environment to ensure it’s buildable remotely. Amazon Q then begins porting your application. It works from the bottom up, starting with the lowest level dependency. If Amazon Q runs into an issue with porting a dependency, it stops the transformation and provides information about what caused the error. 

The transformation includes the following updates to your application: 
+ Replacing outdated C\$1 versions of code with Linux-compatible C\$1 versions
+ Upgrading .NET Framework to cross-platform .NET, including: 
  + Identifying and iteratively replacing packages, libraries, and APIs
  + Upgrading and replacing NuGet packages and APIs
  + Transitioning to cross-platform runtime
  + Setting up middleware and updating runtime configurations
  + Replacing private or third-party packages 
  + Handling IIS and WCF components 
  + Debugging build errors
+ Rewriting code for Linux compatibility, including refactoring and rewriting deprecated and inefficient code to port existing code 

## Reviewing transformation summary and accepting changes
<a name="reviewing-summary-accepting-changes"></a>

After the transformation is complete, Amazon Q provides a transformation summary with information about the proposed updates it made to your application, including the number of files changed, packages updated, and APIs changed. It flags any unsuccessful transformations, including affected files or portions of files and the errors encountered during an attempted build. You can also view a build summary with build logs to learn more about what changes were made. 

The transformation summary also provides a Linux porting status, which indicates whether or not additional user input is needed to make the application Linux compatible. If any of the items in a code group require input from you, you download a Linux readiness report that contains Windows-specific considerations that Amazon Q could not address at build time. If input is needed for any code groups or files, review the report for details about what type of change still needs to be made and, if applicable, for recommendations for how to update your code. These changes must be made manually before your application can be run on Linux. 

You can review the proposed changes Amazon Q made in a diff view before accepting them as in-place updates to your files. After updating your files and addressing any items in the Linux readiness report, your application is ready to run on cross-platform .NET.

# Troubleshooting issues with .NET transformations in the IDE
<a name="troubleshooting-dotnet-transformation-IDE"></a>

Use the following sections to troubleshoot common issues with .NET transformations in the IDE with Amazon Q Developer.

## How do I know if a job is progressing?
<a name="job-progressing"></a>

If Amazon Q appears to be spending a long time on a step in the Transformation Hub, you can check whether the job is still active in the output logs. If diagnostic messages are being generated, the job is still active. 

To check the outputs, choose the **Output** tab in Visual Studio. In the **Show output from:** menu, choose **Amazon Q Language Client**.

The following screenshot shows an example of the outputs Amazon Q generates during a transformation.

![\[Screenshot of the Amazon Q Developer Code Transformation Hub, showing the output from the Amazon Q Language Client.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/code-transform-troubleshoot4.png)


## Why are some projects not selected for transformation?
<a name="projects-not-selected"></a>

Amazon Q can only transform supported project types in the C\$1 language. Currently, Amazon Q does not support porting UI layer components or projects written in the VB.NET or F\$1 languages. For a list of supported project types and other prerequisites for transforming your .NET projects, see [Step 1: Prerequisites](port-dotnet-application.md#transform-dotnet-prerequisites).

## How can I get support if my project or solution isn’t transforming?
<a name="get-support"></a>

If you aren’t able to troubleshoot issues on your own, you can reach out to Support or your AWS account team to submit a support case. 

To get support, provide the transformation job ID so AWS can investigate a failed job. To find a transformation job ID, choose the **Output** tab in Visual Studio. In the **Show output from:** menu, choose **Amazon Q Language Client**.

## How can I prevent my firewall from interfering with transformation jobs?
<a name="firewall-inteference"></a>

If your organization uses a firewall, it might interfere with transformations in Visual Studio. You can temporarily disable security checks in Node.js to troubleshoot or test what is preventing the transformation from running. 

The environment variable `NODE_TLS_REJECT_UNAUTHORIZED` controls important security checks. Setting `NODE_TLS_REJECT_UNAUTHORIZED` to "0" disables Node.js's rejection of unauthorized TLS/SSL certificates. This means:
+ Self-signed certificates will be accepted
+ Expired certificates will be allowed
+ Certificates with mismatched hostnames will be permitted
+ Any other certificate validation errors will be ignored

If your proxy uses a self-certificate, you can set the following environment variables instead of disabling `NODE_TLS_REJECT_UNAUTHORIZED`:

```
NODE_OPTIONS = —use-openssl-ca
NODE_EXTRA_CA_CERTS = Path/To/Corporate/Certs
```

Otherwise, you must specify the CA certs used by the proxy to disable `NODE_TLS_REJECT_UNAUTHORIZED`.

**To disable NODE\$1TLS\$1REJECT\$1UNAUTHORIZED on Windows:**

1. Open the Start menu and search for **Environment Variables**.

1. Choose **Edit the system environment variables**.

1. In the **System Properties** window, choose **Environment Variables**.

1. Under **System variables**, choose **New**.

1. Set **Variable name** to NODE\$1TLS\$1REJECT\$1UNAUTHORIZED and **Variable value** to 0.

1. Choose **OK** to save the changes.

1. Restart Visual Studio.

# Explaining and updating code with Amazon Q Developer
<a name="explain-update-code"></a>

Amazon Q Developer can explain and update specific lines of code in your integrated development environment (IDE). To update your code, ask Amazon Q to make changes to a given line or block of code, and it will generate new code that reflects the changes that you asked it to make. Then, you can insert the updated code directly into the file where the code originated. 

You can choose from the following options:
+ **Explain** – Get your code explained in natural language.
+ **Refactor** – Improve code readability or efficiency, among other improvements.
+ **Fix** – Debug code.
+ **Generate tests** – Create unit tests for the current file or selected code.
+ **Optimize** – Enhance code performance.
+ **Send to prompt** – Send the highlighted code to the Amazon Q chat panel, and ask questions that you have about the code.

## Send code to Amazon Q
<a name="send-code"></a>

To get your code explained or updated by Amazon Q, complete the following steps.

1. Highlight a section of a code file in your IDE. 

1. Right-click your highlighted code to open a context window. Choose **Amazon Q**, and then choose **Explain**, **Refactor**, **Fix**, **Generate tests**, **Optimize**, or **Send to prompt**.

   If you choose **Send to prompt**, Amazon Q copies the highlighted code to the chat panel, where you can enter questions that you have about the code.

1. To replace the highlighted code with the newly generated code, you can copy the code or insert it directly into your file by choosing **Insert code**. Amazon Q replaces the original code with the updated code.

# Chatting inline with Amazon Q Developer
<a name="q-in-IDE-inline-chat"></a>

The *inline chat* feature lets you chat with Amazon Q from your IDE's main coding window. To use the inline chat feature, you highlight code that you want suggestions for, and provide instructions in the small input screen. Amazon Q proceeds to generate code for you, which it presents in a diff within the main coding window. You can then choose to accept or reject the changes.

The advantage of inline chat is that it eliminates the context switching that occurs when moving between a chat window and the main coding window.

You would typically use the inline chat feature when you're reviewing code, writing unit tests, or performing other tasks that require code-based answers. For situations where you want text-based answers (for example, an answer to "Explain this code") then using the [chat window]() is a better option.

Amazon Q considers the code in the current file when generating a code recommendation through the inline chat. It won’t look at code in other files or projects.

## Amazon Q inline chat in action
<a name="q-in-IDE-inline-chat-action"></a>

An inline chat session unfolds as follows.

1. You highlight the code that you want suggestions for, and then choose from the following options based on your IDE: 
   + In Visual Studio Code and JetBrains, press `⌘+I` (Mac) or `Ctrl+I` (Windows)
   + In Eclipse, press `⌘+Shift+I` (Mac) or `Ctrl+Shift+I` (Windows)
   + Alternatively, you can right-click the selection and choose **Amazon Q** and then **Inline chat**

   This launches a small input screen at the top of the main coding window where you can enter a prompt, such as **Fix this code**.  
![\[The inline chat input screen.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/inline-chat-input-screen.png)

1. Amazon Q generates code and presents it in a diff.  
![\[The inline chat diff.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/inline-chat-diff.png)

1. You accept or reject the change by choosing **Accept** or **Reject**, or by pressing the keyboard equivalents (`Enter` or `Esc`).  
![\[The inline chat accept and reject buttons.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/inline-chat-accept.png)

## Example topics and questions
<a name="q-in-IDE-inline-chat-questions"></a>

The inline chat always returns code as the answer, so you can enter prompts like:
+ Document this code
+ Refactor this code
+ Write unit tests for this function

## Diff format
<a name="q-in-IDE-inline-chat-diff"></a>

The inline chat displays the diff in multiple blocks, with the existing code on the top, and the suggested code on the bottom. A side-by-side diff is not supported.

# Adding context to Amazon Q Developer chat in the IDE
<a name="ide-chat-context"></a>

When you chat with Amazon Q in the integrated development environment (IDE), you can provide Amazon Q with additional *context*, such as files and folders, that Amazon Q can use to tailor and improve its answers.

There are two ways to provide context to Amazon Q:
+ **Explicitly** – To provide context explicitly, you enter **@** in the chat window. The **@** launches a context picker pop-up from which you select items to include as context. Alternatively, you can type **@** and begin typing the name of the file, folder, or other context type to have it auto-complete. For more information, see [Explicit context types](#context-explicit).
+ **Automatically** – To provide context automatically, you set up the context separately, outside of the chat. Amazon Q automatically references the context whenever any developer working on the project types a question into the chat window. For more information, see [Automatic context types](#context-automatic).

After Amazon Q generates an answer, it shows you the files it used as context in the **Context** drop-down list, which appears immediately above the start of the answer.

## Explicit context types
<a name="context-explicit"></a>

When you type **@** in the chat, you can select from the following context types:
+ **@workspace** – Amazon Q uses your project’s workspace as context for its answers. The **@workspace** option requires configuration. For more information, see [Adding workspace context to Amazon Q Developer chat in the IDE](workspace-context.md).
+ **Folders** – Amazon Q shows you a list of folders in the current project, and uses the folder you select as context for its answers.
+ **Files** – Amazon Q shows you a list of files in the current project, and uses the file you select as context for its answers.
+ **Code** – Amazon Q shows you a list of classes, functions, global variables in the current project, and uses your selection as context for its answers.
+ **Images** – Amazon Q allows you to add images as context for your prompts, useful for scenarios like generating code from UI mockups or sequence diagrams. Images must be in JPEG, PNG, GIF, or WebP format, with a maximum size of 3.75 MB and dimensions not exceeding 8,000 x 8,000 pixels. You can include up to 20 images in a single message, including any images pinned to context.
+ **Prompts** – Amazon Q shows you a list of prompts that you have saved, and uses the prompt you select as context for its answers. The **Prompts** option requires some configuration. For more information, see [Saving prompts to a library for use with Amazon Q Developer chat](context-prompt-library.md).

## Automatic context types
<a name="context-automatic"></a>

The following types of contexts will be used automatically by Amazon Q, if you've set them up:
+ **Project rules** – Amazon Q will automatically use a set of project rules that you define as context. For more information, see [Creating project rules for use with Amazon Q Developer chat](context-project-rules.md).
+ **Customizations** – Amazon Q will automatically use a repository of source code as context.

# Adding workspace context to Amazon Q Developer chat in the IDE
<a name="workspace-context"></a>

When you chat with Amazon Q in the integrated development environment (IDE), you can add **@workspace** to your question to automatically include the most relevant chunks of your workspace code as context. Amazon Q Developer determines relevance based on an index that is updated periodically.

With workspace context, Amazon Q has enhanced capabilities, including locating files, understanding how code is used across files, and generating code that leverages multiple files, including files that aren’t opened. 

**Topics**
+ [

## Setup
](#setup)
+ [

## Ask questions with workspace context
](#ask-questions-workspace-context)

## Setup
<a name="setup"></a>

Before you continue, make sure you have the latest version of your IDE installed. You can then complete the following setup steps. 

### Enable indexing
<a name="setup-enable-indexing"></a>

To use your workspace as context, Amazon Q creates a local index of your workspace repository, including code files, configuration files, and project structure. During indexing, non-essential files like binaries or those specified in `.gitignore` files are filtered out. 

It can take 5 to 20 minutes to index a new workspace. During this time, you can expect elevated CPU usage in your IDE. After initial indexing, the index is incrementally updated when you make changes to your workspace.

The first time you add workspace context, you must enable indexing in your IDE. Complete the following steps to enable indexing: 

1. Add **@workspace** to your question in the Amazon Q chat panel.

1. Amazon Q prompts you to enable indexing. Choose **Settings** to be redirected to Amazon Q settings in your IDE. 

   If you aren't prompted, you can go to settings by choosing **Amazon Q** at the bottom of your IDE. Then, choose **Open Settings** from the Amazon Q task bar that opens.

1. Select the box next to **Workspace Index**.

### Configure indexing (optional)
<a name="setup-configure-indexing"></a>

No configuration is necessary for the indexing process, however you can choose to specify the number of threads dedicated to indexing. If you increase the number of threads used, indexing will complete faster, and it will use more of your CPU. To update the indexing configuration, specify the number of threads for the **Workspace Index Worker Threads** setting. You can also set the maximum size of the files that can be indexed for workspace context, and enable the use of your graphics processing unit (GPU) for indexing.

## Ask questions with workspace context
<a name="ask-questions-workspace-context"></a>

To add your workspace as context to your conversation with Amazon Q, open the workspace you want to ask questions about, and then add **@workspace** to your question in the chat panel. You must add @workspace to any question that you want to add workspace context to.

If you want to start chatting about a different workspace, open the workspace, and then open a new chat tab. Include **@workspace** in your question to add the new workspace as context. 

You can ask Amazon Q about any file in your workspace, including unopened files. Amazon Q can explain files, locate code, and generate code across files, in addition to existing conversational coding capabilities.

Following are example questions you can ask Amazon Q that leverage workspace context in the chat: 
+ @workspace where is the code that handles authorization?
+ @workspace what are the key classes with application logic in this project?
+ @workspace explain main.py 
+ @workspace add auth to this project
+ @workspace what third-party libraries or packages are used in this project, and for what purpose?
+ @workspace add unit tests for function *<function name>*

# Saving prompts to a library for use with Amazon Q Developer chat
<a name="context-prompt-library"></a>

You can build a library of common prompts that you can use when chatting with Amazon Q in the IDE. By storing these prompts in your library, you can easily insert them into the chat without having to retype the prompt each time. You can use saved prompts across multiple conversations and projects.

Prompts are saved in the `~/.aws/amazonq/prompts` folder.

**To save a prompt to a prompt library**

1. In your IDE, open an Amazon Q chat window.

1. Type **@**, and select **Prompts**.

1. Choose **Create a new prompt**. (You might have to scroll down to find it.)

1. In **Prompt name**, enter a prompt name such as **Create\$1sequence\$1diagram** and press Enter. Note that prompt names cannot include spaces.

   Amazon Q creates a prompt file called `Create_sequence_diagram.md` in the `~/.aws/amazonq/prompts` folder, and opens the file in your IDE.

1. In the prompt file, add a detailed prompt. For example:

   `Create a sequence diagram using Mermaid that shows the sequence of calls between resources. Ignore supporting resources like IAM policies and security group rules.`

1. Save the prompt file.

**To use a saved prompt**

1. In your IDE, open an Amazon Q chat window.

1. Type **@**, and select **Prompts**.

1. Choose your saved prompt, for example, **Create\$1sequence\$1diagram**.

1. (Optional) In the chat input window, add details, as required. You can type more text and add more context types. An example prompt might look like this...

   `@Create_sequence_diagram using the files in the @lib folder`

1. Submit the prompt and wait for Amazon Q to generate an answer.

# Pinning context items
<a name="context-pinning"></a>

**Note**  
Context pinning is currently only available in the VS Code IDE.

Context pinning lets you specify context items that get added to all messages within your chat session. When you pin a context item, it's automatically included in every message within your current conversation, eliminating the need to repeatedly type commands like **@workspace**, **@file**, or **@folder**.

Pinned items can come from two sources: you can manually pin items you frequently reference, or Amazon Q may automatically add context, (such as your current active file,) to improve response quality. Pinned context items appear at the top of the text input box of your chat panel, and you have control to remove any context you don't want included.

To help maintain clear context boundaries, pinned items only apply to your current chat tab. When you open a new tab, you'll start fresh with only the default pinned context, such as the active file.

## Using pinned context
<a name="w2aac11c16c25c19b7"></a>

**To add pinned context items**

1. In your IDE, open the Amazon Q chat panel.

1. After using a context command like **@workspace**, **@file**, **@folder**, or **@prompt** in a chat, click the desired context to pin it.

   Alternatively, you can click the "@ Pin Context" button to view the available options and select a context to pin.

1. The pinned context will appear in the pinned context area at the top of your chat panel.

### Methods to pin context items
<a name="w2aac11c16c25c19b7b5"></a>

There are three ways to pin context items:

1. Using the @Pin Context menu:
   + Click the "@Pin Context" button in your chat panel.
   + Select the desired context item from the available options.

1. Using the context menu and keyboard shortcut:
   + Type "@" in the chat input to bring up the context menu.
   + Navigate to the desired item.
   + Press Option/Alt \$1 Enter to pin the selected item.

1. Pinning from the input prompt:
   + If you've already typed a context command (like **@workspace**, **@file**, **@folder**, or **@prompt**) in your input, hover over the context item in your input.
   + Click on the item to pin it.

After pinning, the context item will appear in the pinned context area at the top of your chat's text input box.

**To remove pinned context items**
+ To remove a pinned context item, click the X on the left side of the pill. This works for both user-pinned and system-added context items.

# Creating project rules for use with Amazon Q Developer chat
<a name="context-project-rules"></a>

You can build a library of project rules that you can use when chatting with Amazon Q in the IDE. These rules describe coding standards and best practices across your team. For example, you could have a rule that states that all Python code must use type hints, or that all Java code must use Javadoc comments. By storing these rules in your project, you can ensure consistency across developers, regardless of their experience level.

Project rules are defined in Markdown files in the project's `project-root/.amazonq/rules` folder.

Once you've created your project rules, Amazon Q will automatically use them as context whenever a developer chats with Amazon Q within your project, and will make sure to adhere to them when generating answers. For more information about adding context to the chat, see [Adding context to Amazon Q Developer chat in the IDE](ide-chat-context.md).

You can create project rules either directly in the file system or through the Amazon Q chat interface.

**To create a project rule using the Amazon Q chat interface**

1. In your IDE, open the Amazon Q chat panel.

1. In the chat input box, click the **Rules** button.

1. Select **Create new rule**.

1. In the dialog that appears, enter a name for your rule.

   This will create a Markdown file with that name in your project's `project-root/.amazonq/rules` folder.

1. Add your rule content in the editor.

1. Save the file.

**To create a project rule using the file system**

1. In your IDE, open the project's root folder. 

1. In the project root folder, create the following folder:

   `project-root/.amazonq/rules`

   This folder holds all your project rules.

1. In `project-root/.amazonq/rules`, create a project rule file. It must be a Markdown file. For example:

   `cdk-rules.md`

1. Open your project rule Markdown file.

1. Add a detailed prompt to the file. For example:

   ```
   All Amazon S3 buckets must have encryption enabled, enforce SSL, and block public access.
   All Amazon DynamoDB Streams tables must have encryption enabled. 
   All Amazon SNS topics must have encryption enabled and enforce SSL. 
   All Amazon SNS queues must enforce SSL.
   ```

1. Save the file.

1. (Optional) Add more project rule Markdown files.

   You have now created one or more project rules. Amazon Q will use these rules as context automatically whenever a developer chats with Amazon Q within your project.

**To manage rules in the Amazon Q chat interface**

1. In your IDE, open the Amazon Q chat panel.

1. In the chat input box, click the **Rules** button to see all available rules.

1. Click on a rule to toggle it on or off for the current chat session:
   + Rules with a check mark are active and will be applied to your conversation.
   + Rules without a check mark are inactive for the current session.

# Generating a memory bank for Amazon Q chat
<a name="context-memory-bank"></a>

Amazon Q can automatically generate memory bank files that provide a quick index of your project's structure, technology stack, and product information. This feature analyzes key files in your project to create summary files that help Amazon Q understand your codebase without having to analyze the entire project each time you ask a question.

When you generate memory bank files, Amazon Q creates a `memory-bank` subfolder under `.amazonq/rules` that contains the following auto-generated files:
+ `product.md` – Overview of your project and its capabilities.
+ `structure.md` – Your project's architecture, folder organization, and key components.
+ `tech.md` – Your technology stack, frameworks, dependencies, and coding standards.
+ `guidelines.md` – Development standards and patterns for your project.

These files are automatically used as context when you chat with Amazon Q, providing it with background information about your project.

## Generate a memory bank for your project
<a name="generate-files"></a>

To generate a memory bank, complete the following procedure.

1. In your IDE, open the Amazon Q chat panel.

1. In the chat input box, choose the **Rules** button.

1. Select **Generate Memory Bank**.

1. A new chat tab opens where Amazon Q begins analyzing your project to create the memory bank files.

1. Once complete, you can view the files by choosing the **Rules** button.

   You can select and deselect individual files to be used as context when you ask a question.

1. If your project changes, you can have Amazon Q generate new memory bank files to update its context. To do so, choose the **Rules** button and then select **Regenerate Memory Bank**.

## Customize memory bank generation
<a name="customize-files"></a>

You can customize how memory bank files are generated by creating custom project rules. For example, you can create a rule that specifies the language or format for the generated files:

```
When generating the memory bank files like product.md, structure.md, and tech.md, 
always generate content in Spanish and include detailed code examples.
```

Save your memory bank rules in a file in your project's `project-root/.amazonq/rules` folder.

For more information about creating custom project rules, see [Creating project rules for use with Amazon Q Developer chat](context-project-rules.md).

# Chat history compaction in Amazon Q Developer
<a name="ide-chat-history-compaction"></a>

As you interact with Amazon Q Developer in your IDE, your conversation accumulates in the chat history. This history provides important context that helps Amazon Q understand your project and deliver more relevant responses. However, there are limits to how much conversation history can be included in each request to the underlying model.

## Understanding context window limits
<a name="understanding-context-window-limits"></a>

The context window represents the maximum amount of information that can be processed in a single interaction with Amazon Q. This includes:
+ Your current question or request
+ Previous messages in your conversation
+ Code snippets and files you've shared
+ System information about your project

When this context window approaches its capacity limit, Amazon Q's ability to reference earlier parts of your conversation may be affected.

## How chat history compaction works
<a name="how-chat-history-compaction-works"></a>

Chat history compaction allows you to preserve the essential information from your conversation while reducing the amount of context used. When compaction occurs:

1. Amazon Q analyzes your conversation history

1. It creates a concise summary of key points, questions, and decisions

1. This summary replaces the detailed conversation history in the context window

1. Your complete conversation remains visible in the chat interface

Compaction helps you continue your conversation without losing important context, while avoiding the need to start a completely new chat when you reach context window limits.

## Using chat history compaction
<a name="using-chat-history-compaction"></a>

You can use compaction in two ways:

### Manual compaction
<a name="manual-compaction"></a>

To manually compact your chat history:

1. Enter **/compact** in the chat input field

1. Amazon Q will process your request and display a confirmation message with a summary of the compacted conversation

Use manual compaction when you want to continue your current conversation but notice slower response times or less relevant answers.

### Automatic compaction nudge
<a name="automatic-compaction-nudge"></a>

When your context window reaches approximately 80% of its capacity, Amazon Q will display a notification suggesting compaction. This notification includes:
+ An explanation of why compaction is recommended
+ A button to trigger compaction immediately

## After compaction
<a name="after-compaction"></a>

After compaction occurs:
+ Your complete conversation history remains visible in the chat interface until the end of the current session
+ Amazon Q uses the compacted summary (not the full history) for generating responses
+ The compacted summary is included in the context window instead of the detailed history
+ The detailed chat history will reset when you restart your IDE

## Related commands
<a name="related-commands"></a>

### Clearing chat history
<a name="clearing-chat-history"></a>

As an alternative to compaction, you can completely clear your chat history using the **/clear** command:

1. Enter **/clear** in the chat input field

1. Amazon Q will remove all previous conversation history from both the display and the context window

### When to choose compaction vs. clearing history
<a name="when-to-choose-compaction-vs-clearing"></a>

Choose compaction when:
+ You want to continue your current conversation topic
+ Previous context is still relevant to your current task
+ You want to preserve the general direction and knowledge from your conversation

Choose to clear history when:
+ You're starting a completely new task or topic
+ Previous conversation is no longer relevant
+ You want to ensure no previous context influences new responses
+ You want to remove potentially sensitive information from the conversation

# Viewing, deleting, and exporting the Amazon Q Developer conversation history
<a name="ide-chat-conversation"></a>

When you chat with Amazon Q in the integrated development environment (IDE), Amazon Q saves each of your chat tabs as a separate conversation. You can view, search for, and delete these conversations. You can also export them to Markdown or HTML format files.

Amazon Q stores your conversations on your local computer, in your home directory.

Amazon Q saves conversations for each workspace separately, so if you don't see your conversation history, it might be because you're in the wrong workspace. Amazon Q only displays the conversation history for the current workspace.

Use the following instructions to view, search for, delete, and export your conversations.

**To view and search for past conversations**

1. In your IDE, sign in to Amazon Q.

1. Open an Amazon Q chat tab.

1. Open the chat history by doing one of the following:
   + On the top-right of the chat panel, choose the **View chat history** button.
   + Press `ctrl+F` (Windows and Linux) or `⌘ F` (Mac).

1. Do one of the following:
   + Choose the conversation you want to view. Conversations are organized by date.
   + Use the search bar near the top of the chat history to find a conversation. Amazon Q finds conversations that match exactly the text you enter.

**To delete a single conversation**

1. In your IDE, sign in to Amazon Q.

1. Do one of the following:
   + In the chat tab of an open chat session, enter **/clear** to delete the contents of the chat tab.
   + Open an Amazon Q chat tab, and then open the chat history by doing one of the following:
     + On the top-right of the chat panel, choose the **View chat history** button.
     + Press `ctrl+F` (Windows and Linux) or `⌘ F` (Mac).

     In the conversation that you want to delete, choose the vertical ellipsis (⋮) and choose **Delete**.

**To export a conversation to Markdown or HTML**

1. In your IDE, sign in to Amazon Q.

1. Do one of the following:
   + With a chat session already started, on the top-right of the chat panel, choose the **Export** button to export the conversation displayed in the tab.
   + Open an Amazon Q chat tab, and then open the chat history by doing one of the following:
     + On the top-right of the chat panel, choose the **View chat history** button.
     + Press `ctrl+F` (Windows and Linux) or `⌘ F` (Mac).

     In the conversation that you want to export, choose the vertical ellipsis (⋮) and choose **Export** to export the conversation to a Markdown or HTML format file.

   By default, Amazon Q names the file `q-dev-chat-yyyy-mm-dd.md|html` and saves it in the root of your project.

# Using shortcut keys in chat with Amazon Q Developer
<a name="q-in-ides-chat-shortcuts"></a>

Amazon Q provides keyboard shortcuts to help you interact with the agentic chat interface efficiently. Using keyboard shortcuts can help you maintain your workflow without switching between keyboard and mouse.

**Note**  
Keyboard shortcuts are only currently available in the Visual Studio Code IDE.

## Keyboard shortcuts
<a name="keyboard-shortcuts"></a>


**Keyboard shortcuts for Amazon Q chat**  

| Action | Visual Studio Code Shortcut | 
| --- | --- | 
| Run command |  Shift \$1 Cmd \$1 Enter (Mac) Shift \$1 Ctrl \$1 Enter (Windows) Shift \$1 Meta \$1 Enter (Linux)  | 
| Reject command |  Shift \$1 Cmd \$1 R (Mac) Shift \$1 Ctrl \$1 R (Windows) Shift \$1 Meta \$1 R (Linux)  | 
| Stop generation |  Shift \$1 Cmd \$1 Backspace (Mac) Shift \$1 Ctrl \$1 Backspace (Windows) Shift \$1 Meta \$1 Backspace (Linux)  | 

## Customizing keyboard shortcuts
<a name="customizing-keyboard-shortcuts"></a>

Shortcuts can be modified through the standard keyboard shortcut customization interface in your IDE. Amazon Q uses each IDE's native shortcut system, so any changes you make will be reflected in the Amazon Q interface. The shortcuts shown in tooltips and UI elements will automatically update to match your customized key mappings.

## Shortcut discoverability
<a name="shortcut-discoverability"></a>

Amazon Q provides several ways to discover keyboard shortcuts:
+ **Tooltips**: Hover over the Run command button, Reject command button, or Stop button to see the current keyboard shortcut
+ **Settings**: View all shortcuts in your IDE's keyboard shortcut customization interface

## Shortcut behavior
<a name="shortcut-behavior"></a>
+ Keyboard shortcuts for agentic chat are only active when your focus is in the Amazon Q chat panel
+ This prevents conflicts with existing IDE keybindings
+ If you modify a shortcut, you may need to refresh your IDE for the changes to be reflected in tooltips

# Selecting a model for Amazon Q chat in IDEs
<a name="q-in-ides-chat-models"></a>

You can select the model you want Amazon Q to use while chatting in the IDE. The model you select persists across all future chat sessions.

The following table describes the models that are available for Amazon Q chat in the IDE and their context windows.


****  

| Model | Context window | 
| --- | --- | 
| Claude Sonnet 3.7 | 200k | 
| Claude Sonnet 4 (default) | 200k | 

## Select the model used for chatting in the IDE
<a name="select-model-ide-chat"></a>

To select the model Amazon Q uses when you chat in your IDE:

1. Open the Amazon Q chat panel in your IDE.

1. At the bottom of the text box, choose the model menu dropdown. Select the model you want to use from the available options.

   The model you select persists until you change it.

## Context windows
<a name="context-window"></a>

The context window is the amount of context, including your conversation history and any explicit or automatic context, that Amazon Q can use to process and respond to your requests. Context is measured in tokens, which includes text and code.

For more information about context, see [Adding context to the chat](ide-chat-context.md).

# Generating inline suggestions with Amazon Q Developer
<a name="inline-suggestions"></a>

Amazon Q can provide you with code recommendations in real time. As you write code, Amazon Q automatically generates suggestions based on your existing code and comments. Your personalized recommendations can vary in size and scope, ranging from a single line comment to fully formed functions.

When you start typing out single lines of code or comments, Amazon Q makes suggestions based on your current and previous inputs. Filenames are also taken into consideration.

Inline suggestions are automatically enabled when you download the Amazon Q extension. To get started, start writing code, and Amazon Q will begin generating code suggestions.

You can also customize the suggestions Amazon Q generates to your software development team's internal libraries, proprietary algorithmic techniques, and enterprise code style.

**Topics**
+ [

## Pausing suggestions with Amazon Q
](#toggling-suggestions)
+ [

## Amazon Q code completion in action
](#what-is-walkthrough)
+ [

# Generating inline suggestions in AWS coding environments
](setting-up-AWS-coding-env.md)
+ [

# Using shortcut keys
](actions-and-shortcuts.md)
+ [

# Using code references
](code-reference.md)
+ [

# Code examples
](inline-suggestions-code-examples.md)

## Pausing suggestions with Amazon Q
<a name="toggling-suggestions"></a>

Choose your IDE to see steps for pausing and resuming inline code suggestions in Amazon Q.

------
#### [ Visual Studio Code ]

1. In VS Code, choose **Amazon Q** from the component tray at the bottom of the IDE window.

   The Amazon Q task bar opens at the top of the IDE window. 

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

The following image shows the Amazon Q task bar in VS Code.

![\[The Amazon Q task bar in VS Code.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/VSC-taskbar.png)


------
#### [ JetBrains ]

1. In your JetBrains IDE, choose **Amazon Q** from the status bar at the bottom of the IDE window.

   The Amazon Q task bar opens above the status bar. 

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

The following image shows the Amazon Q task bar in a JetBrains IDE.

![\[The Amazon Q task bar in a JetBrains IDE.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/JB-taskbar.png)


------
#### [ Eclipse ]

1. In your Eclipse IDE, choose the **Amazon Q** icon in the top right corner of the IDE. 

1. With the Amazon Q chat tab open, choose the ellipsis icon in the top right corner of the tab. The Amazon Q task bar opens.

   The following image shows the Amazon Q task bar in an Eclipse IDE.  
![\[The Amazon Q task bar in an Eclipse IDE.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/eclipse-taskbar.png)

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

------
#### [ Visual Studio ]

1. From the edge of the window, choose the Amazon Q icon.

1. Select **Pause Auto-Suggesions** or **Resume Auto-Suggestions**

The following image shows the Amazon Q task bar in a Visual Studio.

![\[The Developer Tools menu in Visual Studio.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/vstudio-toggle-suggestions.png)


------
#### [ AWS Cloud9 ]

Amazon Q does not support toggling suggestions on and off in AWS Cloud9.

To stop receiving Amazon Q suggestions in AWS Cloud9, remove the IAM policy that gives Amazon Q access to AWS Cloud9 from the role or user that you are using to access AWS Cloud9. 

------
#### [ AWS Lambda ]

To deactivate or re-activate Amazon Q code suggestions in Lambda:

1. In the Lambda console, open the screen for a particular Lambda function.

1. In the **Code source** section, from the toolbar, choose **Tools**.

1. From the dropdown menu, choose **Amazon Q Code Suggestions.**

------
#### [ Amazon SageMaker AI Studio ]

1. In the SageMaker AI Studio console, choose Amazon Q from the bottom of the window.

   The Amazon Q panel will open.

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

------
#### [ JupyterLab ]

1. In the JupyterLab console, choose Amazon Q from the bottom of the window.

   The Amazon Q panel will open.

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

------
#### [ AWS Glue Studio Notebook ]

1. In the AWS Glue Studio Notebook console, choose Amazon Q from the bottom of the window.

   The Amazon Q panel will open.

1. Choose **Pause Auto-Suggestions** or **Resume Auto-Suggestions**.

------

## Amazon Q code completion in action
<a name="what-is-walkthrough"></a>

This section demonstrates how Amazon Q can help you write a complete application. This application creates an Amazon S3 bucket and a Amazon DynamoDB table, plus a unit test that validates both tasks.

Here, Amazon Q helps the developer choose which libraries to import. Using the arrow keys, the developer toggles through multiple suggestions.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-1.gif)


Here, the developer enters a comment, describing the code they intend to write on the next line.

Amazon Q correctly anticipates the method to be called. The developer can accept the suggestion with the tab key.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-2.png)


Here, the developer prepares to define constants.

Amazon Q correctly anticipates that the first constant will be `REGION` and that its value will be `us-east-1`, which is the default.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-3.png)


Here, the developer prepares to write code that will open sessions between the user and both Amazon S3 and DynamoDB.

Amazon Q, familiar with AWS APIs and SDKs, suggests the correct format.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-4.1.png)


The developer has merely written the name of the function that will create the bucket. But based on that (and the context), Amazon Q offers a full function, complete with try/except clauses.

Notice the use of `TEST_BUCKET_NAME, which is a constant declared earlier in the same file.`

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-5.png)


The developer has only just begun to type in the name of the function that will create a DynamoDB table. But Amazon Q can tell where this is going.

Notice that the suggestion accounts for the DynamoDB session created earlier, and even mentions it in a comment.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-6.png)


The developer has done little more than write the name of the unit test class, when Amazon Q offers to complete it.

Notice the built-in references to the two functions created earlier in the same file.

The developer has only just begun to type in the name of the function that will create a DynamoDB table. But Amazon Q can tell where this is going.

Notice that the suggestion accounts for the DynamoDB session created earlier, and even mentions it in a comment.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-7.png)


Based only on a comment and the context, Amazon Q supplies the entire main function.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-8.1.png)


All that's left is the main guard, and Amazon Q knows it.

Based only on a comment and the context, Amazon Q supplies the entire main function.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-9.png)


Finally, the developer runs the unit test from the terminal of the same IDE where the coding took place.

![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whatis-demo-10.png)


# Generating inline suggestions in AWS coding environments
<a name="setting-up-AWS-coding-env"></a>

In addition to third-party IDEs, Amazon Q Developer can generate inline suggestions within AWS services that provide their own coding environments.

The following sections describe how to set up Amazon Q inline code suggestions within integrated AWS services.

**Note**  
If you are using Amazon Q as part of an enterprise, then you are using Amazon Q Developer Pro. In that case, administrators at your organization must complete additional steps before you can start coding. For more information, see [Getting started with Amazon Q Developer](getting-started-q-dev.md).

**Topics**
+ [

# Using Amazon Q Developer with Amazon SageMaker AI Studio
](sagemaker-setup.md)
+ [

# Using Amazon Q Developer with JupyterLab
](jupyterlab-setup.md)
+ [

# Using Amazon Q Developer with Amazon EMR Studio
](emr-setup.md)
+ [

# Using Amazon Q Developer with AWS Glue Studio
](glue-setup.md)
+ [

# Using Amazon Q Developer with AWS Lambda
](lambda-setup.md)
+ [

# Using Amazon Q Developer with other services
](other-setup.md)

# Using Amazon Q Developer with Amazon SageMaker AI Studio
<a name="sagemaker-setup"></a>

You can chat with Amazon Q inside Amazon SageMaker AI Studio. You can also make code recommendations automatically as you write your code.

To use Amazon Q Developer with Amazon SageMaker AI Studio, you must add Amazon Q permissions to your SageMaker AI execution role. The way you configure permissions depends on whether you are using the Amazon Q Developer Free tier or the Pro tier.

 To set up and activate Amazon Q for Amazon SageMaker AI Studio, see [Set up Amazon Q Developer for your users](https://docs.aws.amazon.com/sagemaker/latest/dg/studio-updated-jl-admin-guide-set-up.html) in the *Amazon SageMaker AI User Guide*.

# Using Amazon Q Developer with JupyterLab
<a name="jupyterlab-setup"></a>

This page describes how to set up and activate Amazon Q Developer for JupyterLab. Once activated, Amazon Q can make code recommendations automatically as you write your code.

**Note**  
Python is the only programming language that Amazon Q supports in JupyterLab.

## Installing JupyterLab
<a name="jupyterlab-setup-itself"></a>

Install [JupyterLab](https://pypi.org/project/jupyterlab) on your computer or if you already have JupyterLab installed, check its version by running the following command.

```
pip show jupyterlab
```

Note the version in the response, and follow the corresponding directions in one of the following sections.

## Installation using pip for Jupyter Lab version >= 4.0
<a name="jupyterlab-setup-pip-v4"></a>

You can install and enable the Amazon Q extension for JupyterLab 4 with the following commands.

```
# JupyterLab 4
pip install amazon-q-developer-jupyterlab-ext
```

## Installation using pip for Jupyter Lab version >= 3.6 and < 4.0
<a name="jupyterlab-setup-pip-v3"></a>

You can install and enable the Amazon Q extension for JupyterLab 3 with the following commands.

```
# JupyterLab 3
pip install amazon-q-developer-jupyterlab-ext~=3.0
jupyter server extension enable amazon-q-developer-jupyterlab-ext
```

## Authenticating with AWS Builder ID
<a name="jupyterlab-setup-bid"></a>

In the following procedure, you will set up Builder ID, which you will use to authenticate when you enable Amazon Q.

1. Refresh the browser tab on which you are using JupyterLab.

1. From the Amazon Q panel at the bottom of the window, choose **Get Started**.

1. From the pop-up window, choose **Copy Code and Proceed**.

1. On the **Get started** page, sign in or sign up for a Builder ID using your email address or Google account. For more information, see [Getting started with a personal account (Builder ID)](getting-started-builderid.md).

   If you already have a Builder ID, skip to the step about the **Authorize request** page.

1. After you receive your email verification code, enter it in the blank field and choose **Verify**.

1. On the next screen, choose and confirm a password, then choose **Create AWS Builder ID**

1. On the next page choose **Allow** to allow Amazon Q to access your data.

Now you should be logged into Amazon Q in JupyterLab with Builder ID.

To begin coding, see [Using shortcut keys](actions-and-shortcuts.md).

![\[An example of Amazon Q in use with JupyterLab.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/qdev-demo-example.png)


# Using Amazon Q Developer with Amazon EMR Studio
<a name="emr-setup"></a>

This page describes how to set up and activate Amazon Q Developer for Amazon EMR Studio. Once activated, Amazon Q can make code recommendations automatically as you write your ETL code.

**Note**  
Amazon Q supports Python, which can be used to code ETL scripts for Spark jobs in Amazon EMR Studio.

Use the following procedure to set up Amazon EMR Studio to work with Amazon Q.

1. Set up [Amazon EMR Studio Notebook](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-managed-notebooks-create.html).

1. Attach the following policy to the IAM user role for Amazon EMR Studio Notebook.
**Note**  
The `codewhisperer` prefix is a legacy name from a service that merged with Amazon Q Developer. For more information, see [Amazon Q Developer rename - Summary of changes](service-rename.md). 

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "AmazonQDeveloperPermissions",
               "Effect": "Allow",
               "Action": [
                   "codewhisperer:GenerateRecommendations"
               ],
               "Resource": "*"
           }
       ]
   }
   ```

------

1. Open the [Amazon EMR console](https://console.aws.amazon.com/emr).

1. Under Amazon EMR Studio, choose **Workspaces (Notebooks).**

1. Select your desired Workspace and choose **Quick launch**.

# Using Amazon Q Developer with AWS Glue Studio
<a name="glue-setup"></a>

This page describes how to set up and activate Amazon Q Developer for [AWS Glue Studio Notebook](https://docs.aws.amazon.com/glue/latest/ug/notebooks-chapter.html). Once activated, Amazon Q can make code recommendations automatically as you write your ETL code.

**Note**  
Amazon Q supports both Python and Scala, the two languages used for coding ETL scripts for Spark jobs in AWS Glue Studio.

In the following procedure, you will set up AWS Glue to work with Amazon Q.

1. [Set up AWS Glue Studio Notebook](https://docs.aws.amazon.com/glue/latest/ug/notebook-getting-started.html).

1. Attach the following policy to your IAM role for Glue Studio notebook
**Note**  
The `codewhisperer` prefix is a legacy name from a service that merged with Amazon Q Developer. For more information, see [Amazon Q Developer rename - Summary of changes](service-rename.md). 

------
#### [ JSON ]

****  

   ```
   {
       "Version":"2012-10-17",		 	 	 
       "Statement": [
           {
               "Sid": "AmazonQDeveloperPermissions",
               "Effect": "Allow",
               "Action": [
                   "codewhisperer:GenerateRecommendations"
               ],
               "Resource": "*"
           }
       ]
   }
   ```

------

1. Open the [Glue console](https://console.aws.amazon.com/glue)

1. Under **ETL jobs**, choose **Notebooks**.

1. Verify that **Jupyter Notebook** is selected. Choose **Create**.

1. Enter a **Job name**.

1. For IAM role, select the role that you configured to interact with Amazon Q

1. Choose **Start notebook**.

# Using Amazon Q Developer with AWS Lambda
<a name="lambda-setup"></a>

This document describes how to set up and activate Amazon Q Developer for the Lambda console. Once activated, Amazon Q can make code recommendations on demand in the Lambda code editor as you develop your function.

**Note**  
In the Lambda console, Amazon Q only supports functions using the Python and Node.js runtimes.

## AWS Identity and Access Management permissions for Lambda
<a name="lambda-q-dev-IAM-policies"></a>

 For Amazon Q to provide recommendations in the Lambda console, you must enable the correct IAM permissions for either your IAM user or role. You must add the `codewhisperer:GenerateRecommendations` permission, as outlined in the sample IAM policy below: 

**Note**  
The `codewhisperer` prefix is a legacy name from a service that merged with Amazon Q Developer. For more information, see [Amazon Q Developer rename - Summary of changes](service-rename.md). 

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "AmazonQDeveloperPermissions",
      "Effect": "Allow",
      "Action": ["codewhisperer:GenerateRecommendations"],
      "Resource": "*"
    }
  ]
}
```

------

It is best practice to use IAM policies to grant restrictive permissions to IAM principals. For details about working with IAM for AWS Lambda, see [Identity and access management in AWS Lambda](https://docs.aws.amazon.com/lambda/latest/dg/security-iam.html) in the *AWS Lambda Developer Guide*.

## Activating Amazon Q Developer with Lambda
<a name="lambda-activation"></a>

To activate Amazon Q in the Lambda console code editor, complete these steps.

1. Open the [Functions page](https://console.aws.amazon.com/lambda/home#/functions) of the Lambda console, and choose the function that you want to edit.

1. As you type in the code editor, automatic code suggestions from Amazon Q are enabled by default. To pause suggestions, choose **Amazon Q** in the bottom left corner of the **Code source** panel. The command palette opens at the top of the Code source panel. From there, choose **Pause auto-suggestions**.

For shortcut keys, see [Using shortcut keys](actions-and-shortcuts.md).

# Using Amazon Q Developer with other services
<a name="other-setup"></a>

## AWS Identity and Access Management permissions for other services
<a name="q-dev-IAM-policies-other"></a>

 For Amazon Q to provide recommendations in the context of another service, you must enable the correct IAM permissions for either your IAM user or role. You must add the `codewhisperer:GenerateRecommendations` permission, as outlined in the sample IAM policy below: 

**Note**  
The `codewhisperer` prefix is a legacy name from a service that merged with Amazon Q Developer. For more information, see [Amazon Q Developer rename - Summary of changes](service-rename.md). 

------
#### [ JSON ]

****  

```
{
  "Version":"2012-10-17",		 	 	 
  "Statement": [
    {
      "Sid": "AmazonQDeveloperPermissions",
      "Effect": "Allow",
      "Action": ["codewhisperer:GenerateRecommendations"],
      "Resource": "*"
    }
  ]
}
```

------

It is best practice to use IAM policies to grant restrictive permissions to IAM principals. For details about working with IAM, see [Security best practices](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the *IAM user guide*. 

# Using shortcut keys
<a name="actions-and-shortcuts"></a>

While getting inline suggestions from Amazon Q, you can use keyboard shortcuts for common actions you take, such as initiating Amazon Q or accepting a recommendation.

Choose the integrated development environment (IDE) where you are developing code to see keyboard shortcuts for your IDE. 

------
#### [ Visual Studio Code ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  Right arrow  | 
|  Previous recommendation  |  Left arrow  | 
|  Reject a recommendation  |  ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch.  | 
|  Accept next word  |  Cmd \$1 right arrow  | 

To change keybindings in VS Code, see [Key Bindings for Visual Studio Code](https://code.visualstudio.com/docs/getstarted/keybindings) on the VS Code website.

**Note**  
The inline suggestions toolbar in VS Code is disabled by default. For more information, see [Redesigned inline suggestions toolbar](https://code.visualstudio.com/updates/v1_75#_redesigned-inline-suggestions-toolbar) on the VS Code website.

------
#### [ JetBrains ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  Right arrow  | 
|  Previous recommendation  |  Left arrow  | 
|  Reject a recommendation  |  ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch.  | 

To change keybindings in IntelliJ, see [IntelliJ IDEA keyboard shortcuts](https://www.jetbrains.com/help/idea/mastering-keyboard-shortcuts.html) on the JetBrains website.

------
#### [ Eclipse ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  MacOS: Option \$1 ] Windows: Alt \$1 ]  | 
|  Previous recommendation  |  MacOS: Option \$1 [ Windows: Alt \$1 [  | 
|  Reject a recommendation  |  ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch.  | 

To change keybindings in Eclipse, see [Changing the key bindings ](https://help.eclipse.org/latest/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftkeybindings.htm) in the Eclipse documentation.

------
#### [ Toolkit for Visual Studio ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q `AWSToolkit.CodeWhisperer.GetSuggestion` in the keybindings  |  Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation `Edit.NextSuggestion` in the keybindings  |  Windows: Alt \$1 .  | 
|  Previous recommendation `Edit.PreviousSuggestion` in the keybindings  |  Windows: Alt \$1 ,  | 
|  Reject a recommendation  |  ESC, backspace, or keep typing and the recommendation will disappear as soon as there is a character mismatch.  | 

See also Microsoft's [Visual Studio default keyboard shortcuts](https://visualstudio.microsoft.com/keyboard-shortcuts.pdf).

To change keybindings in Visual Studio, use Tools -> Options -> Keyboard.

------
#### [ Amazon SageMaker AI ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  Down arrow  | 
|  Previous recommendation  |  Up arrow  | 
|  Reject a recommendation  |  ESC  | 

------
#### [ JupyterLab ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  Down arrow  | 
|  Previous recommendation  |  Up arrow  | 
|  Reject a recommendation  |  ESC  | 

------
#### [ AWS Glue Studio Notebook ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually initiate Amazon Q  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a recommendation  |  Tab  | 
|  Next recommendation  |  Down arrow  | 
|  Previous recommendation  |  Up arrow  | 
|  Reject a recommendation  |  ESC  | 

------
#### [ AWS Lambda ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually fetch a code suggestion  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a suggestion  |  Tab  | 
|  Reject a suggestion  |  ESC, Backspace, scroll in any direction, or keep typing and the recommendation automatically disappears.  | 

To change the key bindings, use the following procedure.

1. While viewing a particular function, choose the gear icon to open the **Preferences** tab.

1. On the **Preferences** tab, select **Keybindings**.

1. In the keybindings search box, enter Amazon Q.

![\[Keybindings settings in AWS Cloud9 IDE with Amazon CodeWhisperer option highlighted.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/CWSPR-Lambda-keybinding-settings.png)


------
#### [ AWS Cloud9 ]


| Action | Keyboard shortcut | 
| --- | --- | 
|  Manually fetch a code suggestion  |  MacOS: Option \$1 C Windows: Alt \$1 C  | 
|  Accept a suggestion  |  Tab  | 
|  Reject a suggestion  |  ESC, Backspace, scroll in any direction, or keep typing and the recommendation automatically disappears.  | 

1. While viewing a particular environment, choose the gear icon to open the **Preferences** tab.

1. On the **Preferences** tab, select **Keybindings**.

1. In the keybindings search box, enter Amazon Q.

1. In the Keystroke column, double-click the space corresponding to the function you're interested in.

1. Enter the keys that you want to bind the function to.

![\[AWS Cloud9 interface showing Keybindings settings with options for keyboard mode and custom keybindings.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/CWSPR-C9-keybinding-settings.png)


------

# Using code references
<a name="code-reference"></a>

Amazon Q learns, in part, from open-source projects. Sometimes, a suggestion it's giving you may be similar to publicly available code. Code references include information about the source Amazon Q used to generate a recommendation.

**Topics**
+ [

## View and update code references
](#show-code-reference)
+ [

## Turn code references off and on
](#toggle-code-reference)
+ [

## Opt out of code with references
](#opt-out-code-reference)

## View and update code references
<a name="show-code-reference"></a>

With the reference log, you can view references to code recommendations that are similar to publicly available code. You can also update and edit code recommendations suggested by Amazon Q.

Choose your IDE to see steps for how to view and update code references. 

------
#### [ Visual Studio Code ]

To display the Amazon Q reference log in VS Code, use the following procedure.

1. Make sure you are using the latest version of both VS Code and the Amazon Q extension. 

1. In VS Code, choose **Amazon Q** from the component tray at the bottom of the IDE window.

   The Amazon Q task bar opens at the top of the IDE window. 

1. Choose **Open Code Reference Log**.

   The code reference log tab opens. Any references to code recommendations are listed.

The following image shows the open Amazon Q task bar and code reference log tab.

![\[The Amazon Q code reference log in Visual Studio Code.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/VSC-coderef.png)


------
#### [ JetBrains ]

To display the Amazon Q reference log in JetBrains IDEs, use the following procedure.

1. Make sure you are using the latest version of both your JetBrains IDE and the Amazon Q plugin. 

1. In JetBrains, choose **Amazon Q** from the status bar at the bottom of the IDE window.

   The Amazon Q task bar opens above the status bar. 

1. Choose **Open Code Reference Log**.

   The code reference log tab opens. Any references to code recommendations are listed.

The following image shows the open Amazon Q task bar and code reference log tab.

![\[The Amazon Q code reference log in JetBrains.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/JB-coderef.png)


------
#### [ Eclipse ]

To display the Amazon Q reference log in Eclipse IDEs, use the following procedure.

1. Make sure you are using the latest version of both the Eclipse IDE and the Amazon Q plugin. 

1. In your Eclipse IDE, choose the **Amazon Q** icon in the top right corner of the IDE. 

1. With the Amazon Q chat tab open, choose the ellipsis icon in the top right corner of the tab. The Amazon Q task bar opens.

   The following image shows the Amazon Q task bar in an Eclipse IDE.  
![\[The Amazon Q task bar in an Eclipse IDE.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/eclipse-taskbar.png)

1. Choose **Open Code Reference Log**.

   The code reference log tab opens. Any references to code recommendations are listed.

------
#### [ Toolkit for Visual Studio ]

When Amazon Q suggests code that contains a reference in the Toolkit for Visual Studio, the reference type appears in the suggestion description.

![\[Code snippet showing a function to create a DynamoDB table with 'Products' as the table name.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/visual-studio-view-code-suggestions.png)


All accepted suggestions that contain references are captured in the reference log.

To access the reference log, choose the AWS icon, then select **Open Code Reference Log**.

A list of accepted suggestions that contain references will appear. This list includes:
+ The location where the suggestion was accepted. Double clicking on this will take you to that location in your code.
+ The associated license
+ The referenced source code
+ The fragment of code attributed to the reference

![\[CodeWhisperer Reference Log output showing accepted recommendation with MIT license.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/vstudio-reference-log2.png)


------
#### [ AWS Cloud 9 ]

When you use Amazon Q with AWS Cloud 9, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. On the AWS Cloud 9 console, in the upper left corner, choose the AWS Cloud 9 logo.

1. From the dropdown menu, choose **Preferences**.

   On the right side of the console, the **Preferences** tab will open.

1. On the **Preferences** tab, under **Project Settings**, under **Extensions**, select **AWS Toolkit**.

1. Select or deselect **Amazon Q: Include Suggestions With Code References**.

------
#### [ Lambda ]

Amazon Q in Lambda does not support code references. When you use Amazon Q with Lambda, any code suggestions with references are omitted.

------
#### [ SageMaker AI Studio ]

To display the Amazon Q reference log in SageMaker AI Studio, use the following procedure.

1. At the bottom of the SageMaker AI Studio window, open the Amazon Q panel.

1. Choose **Open Code Reference Log**.

------
#### [ JupyterLab ]

To display the Amazon Q reference log in JupyterLab, use the following procedure.

1. At the bottom of the JupyterLab window, open the Amazon Q panel.

1. Choose **Open Code Reference Log**.

------
#### [ AWS Glue Studio Notebook ]

To display the Amazon Q reference log in AWS Glue Studio Notebook, use the following procedure.

1. At the bottom of the AWS Glue Studio Notebook window, open the Amazon Q panel.

1. Choose **Open Code Reference Log**.

------

## Turn code references off and on
<a name="toggle-code-reference"></a>

In most IDEs, code references are on by default. Choose your IDE to see steps for how to turn code references off or on. 

------
#### [ Visual Studio Code ]

When you use Amazon Q with VS Code, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. Make sure you are using the latest version of both VS Code and the Amazon Q extension. 

1. In VS Code, choose **Amazon Q** from the component tray at the bottom of the IDE window.

   The Amazon Q task bar opens at the top of the IDE window. 

1. Choose **Open Settings**. The settings tab opens with the options related to Amazon Q displayed.

1. Select or deselect the box next to **Show Code With References**.

------
#### [ JetBrains ]

When you use Amazon Q with your JetBrains IDE, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. Make sure you are using the latest version of both your JetBrains IDE and the Amazon Q plugin. 

1. In JetBrains, choose **Amazon Q** from the status bar at the bottom of the IDE window.

   The Amazon Q task bar opens above the status bar. 

1. Choose **Open Settings**. The settings window opens with the options related to Amazon Q displayed. 

1. Select or deselect the box next to **Show Code With References**.

------
#### [ Eclipse ]

When you use Amazon Q with Eclipse, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. Make sure you are using the latest version of both the Eclipse IDE and the Amazon Q plugin. 

1. Open **Settings** in your Eclipse IDE.

1. Choose **Amazon Q** from the left navigation bar.

1. Select or deselect the box next to **Show Code With References**.

1. Choose **Apply** to save your changes.

------
#### [ Toolkit for Visual Studio ]

When you use Amazon Q in the Toolkit for Visual Studio, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. Make sure you are using the latest version of the Toolkit for Visual Studio. 

1. Open **Options** in Visual Studio.

1. Choose **AWS Toolkit** from the left navigation bar, and then choose **Amazon Q**.

1. From the dropdown next to **Include Suggestions With References**, select True or False.

1. Choose **OK** to save your changes.

------
#### [ AWS Cloud 9 ]

When you use Amazon Q with AWS Cloud 9, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. On the AWS Cloud 9 console, in the upper left corner, choose the AWS Cloud 9 logo.

1. From the dropdown menu, choose **Preferences**.

   On the right side of the console, the **Preferences** tab will open.

1. On the **Preferences** tab, under **Project Settings**, under **Extensions**, select **AWS Toolkit**.

1. Select or deselect **Amazon Q: Include Suggestions With Code References**.

------
#### [ Lambda ]

Amazon Q in Lambda does not support code references. When you use Amazon Q with Lambda, any code suggestions with references are omitted.

------
#### [ SageMaker AI Studio ]

When you use Amazon Q with SageMaker AI Studio, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. From the top of the SageMaker AI Studio window choose **Settings**.

1. From the **Settings** dropdown, choose **Advanced Settings Editor**.

1. In the Amazon Q dropdown, select or deselect the box next to **Enable suggestions with code references**.

------
#### [ JupyterLab ]

When you use Amazon Q with JupyterLab, code references are on by default.

To turn them off, or to turn them back on later, use the following procedure.

1. From the top of the JupyterLab window choose **Settings**.

1. From the **Settings** dropdown, choose **Advanced Settings Editor**.

1. In the Amazon Q dropdown, select or deselect the box next to **Enable suggestions with code references**.

------
#### [ AWS Glue Studio Notebook ]

1. From the bottom of the AWS Glue Studio Notebook window choose **Amazon Q**.

1. From the pop-up menu, toggle the switch next to **Code with references**.

**Note**  
Pausing code references will be valid only for the duration of the current AWS Glue Studio Notebook.

------

## Opt out of code with references
<a name="opt-out-code-reference"></a>

In some IDEs, you can opt out of receiving suggestions with references at the administrator level.

Choose your IDE to see steps for opting out as an administrator.

------
#### [ Visual Studio Code ]

If you are an enterprise administrator, you can opt out of suggestions with code references for your entire organization. If you do this, individual developers in your organization will not be able to opt back in through the IDE. Those developers will be able to select and deselect the box discussed in the previous section, but it will have no effect if you have opted out at the enterprise level.

To opt out of suggestions with references at the enterprise level, use the following procedure.

1. In the Amazon Q Developer console, choose **Settings**. 

1. In the **Amazon Q Developer account details** pane, choose **Edit**.

1. On the Edit details page, in the **Advanced settings** pane, deselect **Include suggestions with code references**.

1. Choose **Save changes**.

------
#### [ JetBrains ]

If you are an enterprise administrator, you can opt out of suggestions with code references for your entire organization. If you do this, individual developers in your organization will not be able to opt back in through the IDE. Those developers will be able to select and deselect the box discussed in the previous section, but it will have no effect if you have opted out at the enterprise level.

To opt out of suggestions with references at the enterprise level, use the following procedure.

1. In the Amazon Q Developer console, choose **Settings**. 

1. In the **Amazon Q Developer account details** pane, choose **Edit**.

1. On the Edit details page, in the **Advanced settings** pane, deselect **Include suggestions with code references**.

1. Choose **Save changes**.

------
#### [ Eclipse ]

If you are an enterprise administrator, you can opt out of suggestions with code references for your entire organization. If you do this, individual developers in your organization will not be able to opt back in through the IDE. Those developers will be able to select and deselect the box discussed in the previous section, but it will have no effect if you have opted out at the enterprise level.

To opt out of suggestions with references at the enterprise level, use the following procedure.

1. In the Amazon Q Developer console, choose **Settings**. 

1. In the **Amazon Q Developer account details** pane, choose **Edit**.

1. On the Edit details page, in the **Advanced settings** pane, deselect **Include suggestions with code references**.

1. Choose **Save changes**.

------
#### [ Toolkit for Visual Studio ]

To opt out of suggestions with references at the enterprise level, use the following procedure. 

1. You can get to the code references setting in one of two ways:

   1. Choose the Amazon Q icon at the edge of the window, and then choose **Options...**

   1. Go to **Tools** -> **AWS Toolkit** -> **Amazon Q**

1. Change the toggle to **True** or **False**, depending on whether you want to include suggestions with references.

------
#### [ AWS Cloud 9 ]

Amazon Q in AWS Cloud 9 does not support opting out of code suggestions with references at the enterprise level.

To opt out at the individual developer level, see Toggling code references.

------
#### [ Lambda ]

Amazon Q in Lambda does not support code references. When you use Amazon Q with Lambda, any code suggestions with references are omitted.

------
#### [ SageMaker AI Studio ]

Amazon Q does not support opting out of code suggestions with references at the enterprise level in SageMaker AI Studio.

------
#### [ JupyterLab ]

Amazon Q does not support opting out of code suggestions with references at the enterprise level in JupyterLab.

------
#### [ AWS Glue Studio Notebook ]

Amazon Q does not support opting out of code suggestions with references in AWS Glue Studio Notebook.

------

# Code examples
<a name="inline-suggestions-code-examples"></a>

Amazon Q can suggest code in different scenarios. To understand how it can help you as you write code in your programming language of choice, view the following code examples.

**Topics**
+ [

# Using Amazon Q Developer for single-line code completion
](single-line-completion.md)
+ [

# Using Amazon Q Developer for full function generation
](full-function-generation.md)
+ [

# Using Amazon Q Developer for block completion
](code-block.md)
+ [

# Using Amazon Q Developer for Docstring, JSDoc, and Javadoc completion
](docstring-javadoc.md)
+ [

# Using Amazon Q Developer for line-by-line recommendations
](line-by-line-1.md)

# Using Amazon Q Developer for single-line code completion
<a name="single-line-completion"></a>

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

------
#### [ C\$1\$1 ]

![\[An example of the single-line completion feature using C++.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/single-line-completion-c-plus.gif)


------
#### [ JavaScript ]

In this example, Amazon Q completes a line of code that the developer begins.

![\[An example of the single-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/javascript_vscode_SingleLine.gif)


------
#### [ TypeScript ]

In this example, the user enters a full comment, and then Amazon Q supplies the code that goes with it.

![\[An example of the single-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/typescript_vscode_single-line.gif)


------
#### [ C\$1 ]

In this example, Amazon Q provides a single-line recommendation based on a comment.

![\[An example of the single line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/c-sharp-single-line.gif)


------
#### [ Shell ]

In the image below, Amazon Q offers recommendations on how to complete a single line of code.

![\[An example of the single-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-single-line-shell.gif)


------
#### [ Java ]

When you start typing out single lines of code, Amazon Q 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, Amazon Q generates a suggestion for the signature of the main method. 

![\[An example of the single-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-single-line-completion.gif)


------
#### [ Python ]

In this example, Amazon Q recommends a single line of code, based on the developer's comment. 

![\[An example of the single-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_singleline.gif)


------

# Using Amazon Q Developer for full function generation
<a name="full-function-generation"></a>

Amazon Q can generate an entire function based on a comment that you've written. As you finish your comment Amazon Q will suggest a function signature. If you accept the suggestion, Amazon Q automatically advances your cursor to the next part of the function and makes a suggestion. Even if you enter an additional comment or line of code in between suggestions, Amazon Q will refactor based on your input.

------
#### [ C ]

![\[An example of the full function completion feature using C.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/full-function-completion-c-plus.gif)


------
#### [ C\$1\$1 ]

![\[An example of the full function completion feature using C++.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/full-function-completion-c-plus.gif)


------
#### [ JavaScript ]

In the following example, the user generates, and then edits, a full function based on a set of comments.

![\[An example of the full-function generation feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/javascript_lambda_FullFunctionGeneration.gif)


In the following image, a user has written a function signature for reading a file from Amazon S3. Amazon Q then suggests a full implementation of the `read_from_s3` method.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-function-read-from-s3.png)


**Note**  
Sometimes, as in the previous example, Amazon Q includes `import` statements as part of its suggestions. As a best practice, manually move these `import` statements to the top of your file.

As another example, in the following image, a user has written a function signature. Amazon Q then suggests a full implementation of the `quicksort` method.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-function-quicksort.png)


Amazon Q considers past code snippets when making suggestions. In the following image, the user in the previous example has accepted the suggested implementation for `quicksort` above. The user then writes another function signature for a generic `sort` method. Amazon Q then suggests an implementation based on what has already been written.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-function-from-context-sort.png)


In the following image, a user has written a comment. Based on this comment, Amazon Q then suggests a function signature.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-comment-binary-search.png)


In the following image, the user in the previous example has accepted the suggested function signature. Amazon Q can then suggest a complete implementation of the `binary_search` function.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-function-binary-search.png)


------
#### [ Java ]

The following list contains examples of how Amazon Q makes suggestions and advances you through the entire process of creating a function.

1. In the following example, a user inputs a comment. Amazon Q suggests a function signature.

   After the user accepts that suggestion, Amazon Q suggests a function body.  
![\[An example of a function generated from a comment.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-function-from-comment.gif)

1. In the image below, a user inputs a comment in the body of the function prior to accepting a suggestion from Amazon Q. On the following line, Amazon Q generates a suggestion based on the comment.  
![\[An example of a function generated from a comment inside an existing block of code.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-function-from-comment-within-block.gif)

------
#### [ C\$1 ]

In the following example, Amazon Q recommends a full function.

![\[Function declaration for ListTables with AmazonDynamoDBClient parameter in code editor.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/c-sharp-full-function.gif)


------
#### [ TypeScript ]

In the following example, Amazon Q generates a function based on the user's docstrings.

![\[An example of the full function completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/typescript_vscode_function.gif)


------
#### [ Python ]

Amazon Q can generate an entire function based on a comment that you've written. As you finish your comment, Amazon Q will suggest a function signature. If you accept the suggestion, Amazon Q automatically advances your cursor to the next part of the function and makes a suggestion. Even if you enter an additional comment or line of code in between suggestions, Amazon Q will refactor based on your input.

In the following example, Amazon Q generates both a full function and the corresponding unit test.

![\[An example of the full function completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_pycharm_fullfunction_unittests.GIF)


The following list contains examples of how Amazon Q makes suggestions and advances you through the entire process of creating a function.

1. In the image below, a user has input a comment. The function signature, located below the comment, is a suggestion from Amazon Q.  
![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-jb-comment-062022.png)

1. In the image below, the user has accepted the Amazon Q suggestion for a function signature. Accepting the suggestion automatically advanced the cursor and Amazon Q has made a new suggestion for the function body.  
![\[alt_text\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-jb-commentfunctionadvance-062022.png)

1. In the image below, a user input a comment in the body of the function prior to accepting a suggestion from Amazon Q. On the following line, Amazon Q has generated a new suggestion based on the content of the comment.  
![\[generateing a new suggestion based on the content of a comment\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-jb-commentfunction-062022.png)

In this example, Amazon Q recommends a full function after the user types part of the signature. 

![\[An example of the full function feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_fullfunction.gif)


------

# Using Amazon Q Developer for block completion
<a name="code-block"></a>

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

------
#### [ C ]

![\[An example of the block completion feature using C\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/block-completion-c.gif)


------
#### [ C\$1\$1 ]

![\[An example of the block completion feature using C++.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/block-completion-c-plus.gif)


------
#### [ Java ]

In the example below, a user enters the signature of an `if` statement. The body of the statement is a suggestion from Amazon Q.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-block-completion.gif)


------
#### [ C\$1 ]

In the image below, Amazon Q recommends a way to complete the function.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/c-sharp-block.gif)


------
#### [ TypeScript ]

In the image below, Amazon Q recommends a way to complete the function.

![\[An example of the block completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/typescript_vscode_block-completion.gif)


------
#### [ Python ]

In this example, Amazon Q recommends a block of code, based on the context. 

![\[An example of the code block feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_codeblock.gif)


------

# Using Amazon Q Developer for Docstring, JSDoc, and Javadoc completion
<a name="docstring-javadoc"></a>

Amazon Q can help you generate or complete documentation inside your code.

------
#### [ C\$1\$1 ]

![\[An example of the docstring completion feature using C++.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/docstring-completion-c-plus.gif)


------
#### [ Javascript ]

In this example, Amazon Q fills in JSDoc parameters based on existing constants.

![\[An example of JSDoc completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/javascript_vscode_JSDocCompletion.gif)


------
#### [ C\$1 ]

In this example, Amazon Q fills in JSDoc parameters based on existing constants.

![\[An example of C3 with DocString completion.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/c-sharp-docstring.gif)


------
#### [ Java ]

The following example is adapted from [an example on the Oracle website](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html).

In the image below, the user has started entering a docstring. Amazon Q has suggested words to add to the docstring.

![\[suggesting a function to complete a docstring\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-docstring-java.png)


The following example is adapted from [an example on the Oracle website](https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html).

In the example below, in Java, the user enters a docstring. Amazon Q suggests a function to process the docstring.

![\[An example of code completion based on a Javadoc.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/cw-c9-javadoc.gif)


------
#### [ Python ]

In this example, Amazon Q recommends a Docstring, based on the surrounding context. 

![\[An example of the Docstring feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_commentblock.gif)


------

# Using Amazon Q Developer for line-by-line recommendations
<a name="line-by-line-1"></a>

Depending on your use case, Amazon Q may not be able to generate an entire function block in one recommendation. However, Amazon Q can still provide line-by-line recommendations.

------
#### [ Go and GoLand ]

In this example, Amazon Q provides line-by-line recommendations.

![\[An example of the line-by-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-line-by-line-go.gif)


Here is another example of line-by-line recommendations, this time with a unit test.

![\[An example of the line-by-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-line-by-line-unit-test-go.gif)


------
#### [ C\$1\$1 and CLion ]

In this example, Amazon Q provides line-by-line recommendations.

![\[An example of the line-by-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/jb-line-by-line-cpp.gif)


------
#### [ Python ]

In the following image, the customer has written an initial comment indicating that they want to publish a message to an Amazon CloudWatch Logs group. Given this context, Amazon Q is only able to suggest the client initialization code in its first recommendation, as shown in the following image.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-line-by-line-cwlogs-1.png)


However, if the user continues to request line-by-line recommendations, Amazon Q also continues to suggest lines of code based on what's already been written.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-line-by-line-cwlogs-2.png)


**Note**  
In the example above, `VPCFlowLogs` may not be the correct constant value. As Amazon Q makes suggestions, remember to rename any constants as required.

Amazon Q can eventually complete the entire code block as shown in the following image.

![\[\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/whisper-line-by-line-cwlogs-3.png)


In this example, Amazon Q provides recommendations, one line at at time.

![\[An example of the line-by-line completion feature.\]](http://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/images/python_sagemakerstudio_linebyline.gif)


------

# Supported languages for Amazon Q Developer in the IDE
<a name="q-language-ide-support"></a>

You can use the following features of Amazon Q Developer in the IDE with any programming language:
+ [Chat](q-in-IDE-chat.md) 
+ [Inline chat](q-in-IDE-inline-chat.md)

The quality of outputs while using these features varies based on the popularity of the language.

For the remaining features of Amazon Q in the IDE, the supported languages are listed in the following sections. 

## Language support for inline suggestions
<a name="inline-suggestions-language-support"></a>

Amazon Q supports [inline code suggestions](inline-suggestions.md) for multiple programming languages. The accuracy and quality of the code generation for a programming language depends on the size and quality of the training data.

In terms of the quality of the training data, the programming languages with the most support are:
+ C
+ C\$1\$1
+ C\$1
+ Dart
+ Go
+ Java
+ JavaScript
+ Kotlin
+ Lua
+ PHP
+ PowerShell
+ Python
+ R
+ Ruby
+ Rust
+ Scala
+ Shell
+ SQL
+ Swift
+ SystemVerilog
+ TypeScript

The Infrastructure as Code (IaC) languages with the most support are:
+ CDK (Typescript, Python)
+ HCL (Terraform)
+ JSON
+ YAML

## Language support for transformations
<a name="transformation-language-support"></a>

The supported languages for transformation depend on the environment where you are transforming code.

In JetBrains IDEs and Visual Studio Code, Amazon Q can transform code in the following languages:
+ [Java](code-transformation.md)
+  [Embedded SQL conversion for Oracle to PostgreSQL database migration ](transform-sql.md)

In Visual Studio, Amazon Q can transform code in the following languages:
+ [C\$1 in .NET applications](transform-dotnet-IDE.md)

For more information about supported languages and other prerequisites for transformation, see the topic for the type of transformation you're performing.

## Language support for code reviews
<a name="code-reviews-language-support"></a>

Amazon Q can create [code reviews](code-reviews.md) and provide automatic code fixes for files and projects written in the following languages: 
+ Java ‐ Java 17 and earlier
+ JavaScript ‐ ECMAScript 2021 and earlier
+ Python ‐ Python 3.11 and earlier, within the Python 3 series
+ C\$1 ‐ All versions (.NET 6.0 and later recommended)
+ TypeScript ‐ All versions
+ Ruby ‐ Ruby 2.7 and 3.2
+ Go ‐ Go 1.18 
+ C ‐ C11 and earlier 
+ C\$1\$1 ‐ C\$1\$117 and earlier 
+ PHP ‐ PHP 8.2 and earlier 
+ Kotlin ‐ Kotlin 2.0.0 and earlier 
+ Scala ‐ Scala 3.2.2 and earlier 
+ JSX ‐ React 17 and earlier 
+ Infrastructure as Code (IaC) languages
  + CloudFormation ‐ 2010-09-09
  + Terraform ‐ 1.6.2 and earlier
  + AWS CDK ‐ TypeScript and Python

## Language support for customizations
<a name="customization-language-support"></a>

Amazon Q supports for the following languages, and uses the listed file types to create customizations:
+ Bash/Shell (.sh, .zsh, .bash)
+ C (.c, .h)
+ C\$1 (.cs)
+ C\$1\$1 (.cpp, .hpp, .h)
+ Dart (.dart)
+ Go (.go)
+ HCL (.hcl)
+ HTML (.html, .htm)
+ Java (.java) 
+ JavaScript (.js, .jsx) 
+ JSON (.json)
+ Kotlin (.kt, .kts)
+ Markdown (.md, .mdx) 
+ PHP (.php)
+ Powershell (.ps1, .psm1, .psd1)
+ Python (.py) 
+ reStructuredText (.rst) 
+ Ruby (.rb)
+ Rust (.rs)
+ Scala (.scala)
+ Terraform (.tf, .tfvars)
+ Text (.txt) 
+ TypeScript (.ts, .tsx) 
+ YAML (.yaml, .yml)