DEV Community

Cover image for Amazon Q Developer Tips: No.9 Using import statements to direct suggestions
Ricardo Sueiras for AWS

Posted on • Edited on

3 1 1

Amazon Q Developer Tips: No.9 Using import statements to direct suggestions

In this series I will be sharing daily hints and tips to help you get ahead and start to accelerate you on your own journey with Amazon Q Developer. Each day I will share a new tip, categorised against a few themes and topics. If you have your own tips or your own experiences with tips I share, please use the comment feature or feel free to contact me directly. Check out the previous tips here.

Ok, time for today's tip....

Tip 9 - Guiding Amazon Q : Using import statements to direct suggestions

In the previous Amazon Q Developer tip I shared some of the ways that the Amazon Q Developer AI coding assistant uses context as consideration when generating its output and coding suggestions.

One of the ways that Amazon Q Developer understands context is by reviewing the current open file's import statements. If you are starting a new file, you can influence and guide Amazon Q Developer by ensuring that you add any relevant library imports before you prompt.

Check out this short video that shows this in action. When I provide an initial prompt to Amazon Q Developer with no additional context (just the prompt) I get one result. When I add a single line to add library imports into a new file and try again, you can see that Amazon Q Developer has picked this up and provides me with a completely different code suggestions.

That's it for today's tip. Let me know how you get on with this tip, and if you have your own drop me a message or reply. I would love to feature them here.

Try Amazon Q Developer today, and claim your free Builder ID

You can try Amazon Q Developer for free today, by signing up for a Builder ID. You can also check out my other posts on community.aws, as I have been sharing a lot of tips and use cases of how I am using Amazon Q Developer. You can also keep up to date with all the new features and improvements of Amazon Q Developer by checking out the changelog.


Made with ♥ from DevRel

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay