Copilot generates incorrect C# and may delete existing code if adding XML comments #140185
Unanswered
watfordsuzy
asked this question in
Copilot
Replies: 1 comment 1 reply
-
It seems like you’re encountering an issue where GitHub Copilot keeps adding XML comments even after deleting them in VS Code. Here’s a short solution to fix it: Disable Inline Suggestions: Go to Settings in VS Code. Use Ctrl+Shift+P to open the command palette. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Bug
Body
Visual Studio Code: 1.93.1 (Universal) Commit: 38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40
GitHub Copilot extension: v1.234.0
If I do something like the following in VS Code:
Then with my cursor where indicated, do something like:
You'll note it deleted the existing comments (and code if there is more), and pushed the last const field in the class off to the right.
Worse, when I click discard I'm left in an inconsistent state and hopefully have the Undo buffer to get back to proper code:
If I instead add some whitespace like so:
I no longer have the issue of code being deleted from prior in the class, but excessive documentation comment starts (
///
) are added and break the trailing brace in the class:If I go ham on the whitespace and pick a nice cursor location in the middle, I still get excessive documentation comment starts but I at least don't get anything overwritten:
Beta Was this translation helpful? Give feedback.
All reactions