

# 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)


------