You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Using-GitHub-Copilot-with-Python/README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ The output should be similar to this:
104
104
<imgsrc="./images/004pydanticmodel.jpg"alt="Create a Pydantic model"width="500"height="300">
105
105
</div>
106
106
107
-
2. Now we want to use the inline feature of Copilot. When using the inline feature we can focus on the code in front of us and make progressive changes in our code base. Next, we are going to generate a new endpoint at the bottom of the `main.py` file. Place your cursor under the last route that was created and prest`CTRL + I` to open inline chat. Type or copy in the following text:
107
+
2. Now we want to use the inline feature of Copilot. When using the inline feature we can focus on the code in front of us and make progressive changes in our code base. Next, we are going to generate a new endpoint at the bottom of the `main.py` file. Place your cursor under the last route that was created and press`CTRL + I` to open inline chat. Type or copy in the following text:
108
108
109
109
```python
110
110
# Create a FastAPI endpoint that accepts a POST request with a JSON body containing a single field called "text" and returns a checksum of the text
@@ -126,7 +126,7 @@ The output should be similar to this:
126
126
127
127
Review the suggestions from Copilot and verify the output. In this instance we combined both the slash command ability and the inline chat feature. **Note:** It is important to always verify the output from Copilot.
128
128
129
-
5. After generating the `/checksum` endpoint code, you can explore a bit further with Copilot. Here are a few other suggestions that you could try, open inline chat and type (or copy) the following:
129
+
5. After generating the `/checksum` endpoint code, you can explore a bit further with Copilot. Try the following suggestions:
130
130
131
131
```python
132
132
Enhance the checksum endpoint to accept a 'hash_type' parameter that can be 'md5', 'sha1', or'sha256'
@@ -140,7 +140,7 @@ Add validation to ensure text is not empty and has a maximum length of 1000 char
140
140
Improve the docstring for the checksum_text function with more details and examples
141
141
```
142
142
143
-
7. While Inline suggestions are great at suggesting code similar to an autocomplete mechanism, Next Edit Suggestions (NES) predict the next logical change in your code based on recent edits anywhere in your file. This helps to maintain flow and consistency as a developer. NES suggests revisions to your code, comments andevent tests. It can track recent changes to anticipate future edits, working across multiple lines and symbols. It will highlight suggestions with arrows in the editor gutter. In the above steps you may have already noticed a green arrow in the gutter, providing a suggestion and the ability to accept or decline the suggestion.
143
+
7. While Inline suggestions are great at suggesting code similar to an autocomplete mechanism, Next Edit Suggestions (NES) predict the next logical change in your code based on recent edits anywhere in your file. This helps to maintain flow and consistency as a developer. NES suggests revisions to your code, comments andeven tests. It can track recent changes to anticipate future edits, working across multiple lines and symbols. It will highlight suggestions with arrows in the editor gutter. In the above steps you may have already noticed a green arrow in the gutter, providing a suggestion and the ability to accept or decline the suggestion.
144
144
145
145
**Note:** In the case that you do not see [Next Edit Suggestions](https://code.visualstudio.com/blogs/2025/02/12/next-edit-suggestions) appear in your editor, check that they are enabled in your editor.
0 commit comments