microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
348 stars 37 forks source link

Copilot (Sonnet) Initiates Two Different Edits on the Same File in a Single Response #2816

Open self-driven opened 1 week ago

self-driven commented 1 week ago

I asked copilot if there is already such an issue and he said that there is not.

There was an instance where Copilot (Sonnet) provided two different suggestions for modifying the same piece of code in a single response. Both suggestions were implemented immediately, which is not feasible because they represent different modifications of the same original code. As a result, only the last edit remained in effect, overwriting the first suggestion.

Steps to Reproduce:

me: func decodeMsgpack is unused (U1000)go-staticcheck func decodeMsgpack(data []byte) string

Github Copilot: This function was defined but never used in the code. Here are two possible solutions:

Solution 1 - Remove the unused function: main.go Solution 2 - Use the function to improve logging: main.go I recommend Solution 2 as it will improve the readability of your debug logs by showing decoded msgpack values instead of hex dumps. However, if you want to keep the logs in their current format, go with Solution 1 and simply remove the unused function.