|
1 |
| -## How to Use Amazon CodeWhisperer |
| 1 | +## Using Amazon CodeWhisperer |
2 | 2 |
|
3 |
| -Welcome to the Amazon CodeWhisperer preview! CodeWhisperer uses machine learning to generate code suggestions |
4 |
| -from the existing code and comments in your IDE. Supported languages include: **Java, Python, and JavaScript**. |
| 3 | +CodeWhisperer uses machine learning to generate code suggestions from the existing code and comments in your IDE. Supported languages include **Java, Python, JavaScript, C# and TypeScript**. |
5 | 4 |
|
6 |
| -### TAB. Left Arrow. Right Arrow. That’s all! |
| 5 | +--- |
7 | 6 |
|
8 |
| -You should automatically see inline code suggestions. Use the **TAB key to accept** a suggestion. CodeWhisperer may |
9 |
| -provide multiple suggestions to choose from, use **[left arrow] and [right arrow] to navigate** between suggestions. |
| 7 | +**Navigating with the tab and arrow keys** |
10 | 8 |
|
11 |
| -That’s all you need to know. If you don’t like the suggestions you see, simply keep typing (or hit ESC key). |
12 |
| -The suggestions will go away and CodeWhisperer will generate new ones at a later point based on the additional context. |
| 9 | +As you enter your code, CodeWhisperer will offer inline code suggestions. Use **TAB to accept** a suggestion. CodeWhisperer may provide multiple suggestions to choose from. Use **[left arrow] and [right arrow] to navigate** between suggestions. |
13 | 10 |
|
14 |
| -### Requesting Suggestions Manually |
| 11 | +If you don’t like the suggestions you see, keep typing (or hit ESC). The suggestions will disappear, and CodeWhisperer will generate new ones at a later point based on the additional context. |
15 | 12 |
|
16 |
| -You can also request a suggestion at any time, use **Option C** on Mac and **ALT C** on Windows. Once you receive |
17 |
| -the suggestions use TAB to accept and the Arrow keys to navigate. |
| 13 | +<img src="twosum_vsc.gif" style="max-height:400px;" alt="twosum"> |
18 | 14 |
|
19 |
| -### How to get the best recommendations |
| 15 | +--- |
20 | 16 |
|
21 |
| -- More context = better recommendations. You will see better recommendations when your current file has more |
22 |
| - existing code. |
| 17 | +**Requesting suggestions manually** |
23 | 18 |
|
24 |
| -- Write more comments and be more descriptive. “Function to upload a file to S3” will get better results than |
25 |
| - “Upload a file.” |
| 19 | +You can request suggestions at any time. Use **Option-C** on Mac or **ALT-C** on Windows. After you receive suggestions, use TAB to accept and arrow keys to navigate. |
26 | 20 |
|
27 |
| -- Try to specify the libraries you prefer by inserting import statements. |
| 21 | +--- |
28 | 22 |
|
29 |
| -- Use descriptive names for variable and functions. A function called “upload_file_to_S3” will get better results |
30 |
| - than a function called “file_upload” |
| 23 | +**Getting the best recommendations** |
31 | 24 |
|
32 |
| -- Break down complex tasks into smaller tasks and write descriptive comments. |
| 25 | +For best results, follow these practices. |
33 | 26 |
|
34 |
| -### How to provide feedback |
| 27 | +- Give CodeWhisperer something to work with. The more code your file contains, the more context CodeWhisperer has for generating recommendations. |
| 28 | +- Write descriptive comments. “Function to upload a file to S3” will get better results than “Upload a file”. |
| 29 | +- Specify the libraries you prefer by using import statements. |
| 30 | +- Use descriptive names for variable and functions. A function called “upload_file_to_S3” will get better results than a function called “file_upload”. |
| 31 | +- Break down complex tasks into simpler tasks. |
35 | 32 |
|
36 |
| -CodeWhisperer is in preview, let us know what your think by sharing feedback (using the AWS Toolkit |
37 |
| -feedback button) or reaching out to [[email protected]](mailto:[email protected]) . |
| 33 | +--- |
| 34 | + |
| 35 | +**Further reading** |
| 36 | + |
| 37 | +To learn more about working with CodeWhisperer and VS Code, see [CodeWhisperer for VS Code](https://docs.aws.amazon.com/toolkit-for-vscode/latest/userguide/codewhisperer.html). |
| 38 | + |
| 39 | +--- |
| 40 | + |
| 41 | +**Providing feedback** |
| 42 | + |
| 43 | +CodeWhisperer is in preview. Let us know what you think by sharing feedback (using the AWS Toolkit feedback button) or by reaching out to [[email protected]](mailto:[email protected]). |
0 commit comments