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.
Topics
The agentic coding experience with Amazon Q Developer in all supported IDEs
Agentic coding is on by default for Amazon Q Developer in the IDE.
With agentic coding, Amazon Q acts as your coding partner, chatting agentically with you as you develop.
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.
When you ask Amazon Q to improve your code, it will do so directly. You can view the changes in a diff and optionally undo them.
While Amazon Q is thinking between prompts, you have the option to continue to add instructions in the input window.
You can toggle agentic coding on or off with the </>
icon at the bottom of the chat panel.
Chatting with Amazon Q in natural languages
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.
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 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.
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. 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
You can enter the following commands in the chat panel to access Amazon Q features, depending on your IDE. For information about what Amazon Q features are available in your IDE, see Supported IDEs.
-
/transform
- Use this command to update the code language version of an entire project. For more information, see Upgrading Java versions. -
/dev
- Use this command to get an implementation plan to develop a feature with Amazon Q. For more information, see Developing features (/dev). -
/test
- Use this command to generate unit tests for your code with Amazon Q. For more information, see Generating unit tests (/test). -
/review
- Use this command to review your codebase for security vulnerabilities and code quality issues with Amazon Q. For more information, see Reviewing code (/review). -
/doc
- Use this command to generate READMEs for your project base with Amazon Q. For more information, see Generating documentation (/doc). -
/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.