Copilot auto deleting my code when trying to add to an existing line. Help? #58416
Replies: 18 comments 4 replies
-
|
🕒 Stale Discussion Alert 🕒 This Discussion has been labeled as stale by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This stale notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I am having this issue as well, and haven't found anyone outside of this post having the same behavior. |
Beta Was this translation helpful? Give feedback.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I am having this issue as well. im using vs code |
Beta Was this translation helpful? Give feedback.
-
|
I'm also having this issue in VSCode: Highlighting a function and using /doc works for a few functions, but then it starts deleting lots of code (multiple functions) to add documentation for 1 function. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
I am also having this issue. Funny how before I decided to part with cash and subscribe there were none of these problems! |
Beta Was this translation helpful? Give feedback.
-
|
Yeah this happens to me all the time too. I asked it to adjust positioning of players in the battle maps and it deleted 80% of my battle code instead |
Beta Was this translation helpful? Give feedback.
-
|
It's been doing the same here. I'll ask it to add to a file and it will get rid of most of my code |
Beta Was this translation helpful? Give feedback.
-
|
It hasn't done it for a while for me, but I'm working on a project right
now without any super long files. It was usually doing that on longer files
…On Sun, Apr 27, 2025 at 3:13 PM Eupham ***@***.***> wrote:
It's been doing the same here. I'll ask it to add to a file and it will
get rid of most of my code
—
Reply to this email directly, view it on GitHub
<#58416 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJIPZIHTMAUCYUK7DETV7N323UT4BAVCNFSM6AAAAAAZLGBBB6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJWGI3DINA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
I have the exact same problem, and I'm using the most recent versions. It does not happen all the time, but it happens frequently. As a workaround, I ask it to show me the complete code for the file, and then I copy and paste it. But that's not a good solution. |
Beta Was this translation helpful? Give feedback.
-
|
Copilot auto deletes unrelated code blocks during editing without any specific explanation. This is very dangerous for people who do not double check the positions that Copilot has edited. 😑 |
Beta Was this translation helpful? Give feedback.
-
|
This is not only still happening, copilot even claims it didn't touch the unrelated code it has deleted. Incredibly dangerous, but also incredibly stupid. |
Beta Was this translation helpful? Give feedback.
-
|
Someone on Reddit suggested I use instruction.md to set rules so Copilot would follow exactly what I want. But honestly, it didn’t help much — all it does is ask me to confirm before Copilot makes automatic changes. And Boommm!!..... I still have to waste an extra prompt just to get it to fix things in a dumb way, like deleting unrelated code or adding new files I never asked for. -_- |
Beta Was this translation helpful? Give feedback.
-
|
I'm using Gemini Code Assist now so I don't have that problem. |
Beta Was this translation helpful? Give feedback.
-
|
z |
Beta Was this translation helpful? Give feedback.
-
|
It didn't happen to me before but it started happening since last month... And i think it mainly happens in my C# code. Most of the time it happens when it edits a block at the end of a method, during which it removes the closing bracket of the method. Some times it removes the first few lines in the next method. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question, Bug
Body
Previously this behavior was witnessed just in VSC Insiders for Github Copilot Chat (and is why I stopped using Insiders and Copilot Chat entirely and went back to VSC and the release version of Copilot), but it seems it's made it down to the release version of VSC/Copilot now as well. When I'm typing code, I sometimes want to add some code to the left hand side of the line, but it's randomly just deleting variables on the right hand side of the cursor when I press space.
This isn't the insert behavior, which would replace the right hand character for every character I type.
This is a weird like contextual variable replacement. For example, if I had a line "obj.Foo()" and I wanted to add "var foo = " to the left hand side of that, so I put my cursor to the left of "o" and type "var", then when I have "varobj..." and press space between the "r" and "o", it removes all of "obj" leaving me with "var .Foo()". If I don't notice it then, and type the whole line, I get "var foo = .Foo()" which is an error because it lost my variable name "obj". This is incredibly annoying. how can I turn this off? When I disable Copilot extension it goes away. But the copilot extension says it has no settings.
I'm about to just remove copilot entirely because of how annoying this anti-"feature" is. I like what copilot does in general, but this is not at all even somewhat helpful and is actively slowing down my development process, forcing me to undo all the time because it's automatically deleting my variable names. I'm all for copilot suggesting edits and changes that I can choose to accept, but to just automatically alter (and delete) my code when I press the spacebar through normal use, is unacceptable.
The work around for the behavior is to press space, then left arrow, and then type, but that's just annoying. I have no idea why this feature would ship, it's the most annoying thing I can think of when trying to code, deleting my valid and desired code.
Beta Was this translation helpful? Give feedback.
All reactions