Copilot edits break code formatting #178114
Replies: 7 comments 3 replies
-
|
I haven't personally experienced this issue, but here are some things that might help: Troubleshooting Steps:
Information to Add to Your Report:
Quick Test: Hope this helps narrow down the issue! If you find a workaround, please share it back here. |
Beta Was this translation helpful? Give feedback.
-
|
You’re right — this appears to be a recent regression affecting both Visual Studio 2025 (v17.14.x) and VS Code where Copilot edits alter or strip code formatting, especially indentation and whitespace in C# files. 🔍 What’s Happening Copilot suggestions are overwriting existing whitespace/indentation. Formatting is lost immediately after accepting edits (even when auto-format is disabled). The issue also appears in Copilot’s documentation/code generation agents (C# examples). ✅ Workarounds (for now) Manually reformat after each Copilot edit — use: Use “Preview Changes” before accepting Copilot suggestions to review formatting impact. Accept edits in smaller chunks instead of entire blocks. Disable Copilot temporarily for files where precise formatting matters. Rollback Copilot extension to a pre-October 2025 build if possible (users confirmed older versions didn’t cause this). 🧭 To Report It Properly Since this seems tied to the latest Copilot + IDE update: In Visual Studio → Help → Send Feedback → Report a Problem Mention: “Copilot edits remove whitespace/indentation in C# after October 2025 update.” Include before/after screenshots and your VS version (v17.14.18). For VS Code → Open Help → Report Issue → GitHub Copilot extension and attach your settings file snippet (settings.json). 💡 Additional Notes This isn’t a formatter conflict — it’s likely a token optimization bug in Copilot’s latest completion handler that compresses spacing to reduce output size. Multiple users have confirmed it across IDEs. Hopefully GitHub/Microsoft pushes a patch soon. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
Same problem for me. |
Beta Was this translation helpful? Give feedback.
-
|
It seems to be the same issue as reported here: "A fix for this issue has been internally implemented and is being prepared for release. We’ll update you once it becomes available for download." |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Copilot Feature Area
General
Body
Is anyone else noticing that after the visual studio october update Copilot started changing the formatting of the files it touches? It leaves it in a bad shape, always have to run the formatter and do some manual edits to put it back in "normal" state.
Beta Was this translation helpful? Give feedback.
All reactions