Chatting with Amazon Q Developer about code - Amazon Q Developer

Chatting with Amazon Q Developer about code

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.

Working with Amazon Q in your IDE

You can ask Amazon Q questions, update your code, and initiate actions with quick commands all from the Amazon Q chat panel in your IDE. To ask a question, choose the Amazon Q icon from the navigation bar in your IDE. You can enter your question in the text bar.

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.

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. To view a list of sources, expand the Sources section at the bottom of a 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. You can start a new conversation with Amazon Q by opening 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

You can enter the following commands in the chat panel to access Amazon Q features:

  • /transform - Use this command to update the code language version of an entire project. For more information, see Transforming your code.

  • /dev - Use this command to get an implementation plan to develop a feature with Amazon Q. For more information, see Developing software.

  • /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.

  • /help - Use this command to see an overview of what Amazon Q can and can't do, example questions, and quick commands.

Example topics and questions

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

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.