The Option "Collapse #regions on file open" not working
- Dominant language
- C#
- Stars
- 20.7k
- Forks
- 4.3k
- PR merge metrics
- PR metrics pending
Description
_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/t/The-Option-Collapse-regions-on-file-op/11049190)._
---
[severity:It bothers me. A fix would be nice]
Hello Visual Studio Team!
With the "Collapse #regions on file open" option, one would expect that every time a file with regions is opened, the regions would be collapsed. However, this option does not work correctly. Only the first time you open a file with regions will the regions be collapsed. From then on, the file is opened in whatever state you left the regions in. Meaning that if the regions are expanded when the file is closed and reopened, they will still be expanded. If you want the regions to be collapsed when you next open the file, you have to make sure to collapse each region if you expanded it before closing the file. It will even remember the region's last state if you close and reopen the solution and file, even if you close and reopen Visual Studio. Deleting the ".VS" folder will make it work correctly the next time, though. Of course, the issue comes right back once you expand the regions.
This is annoying. Please fix.
---
### Original Comments
#### Feedback Bot on 2/24/2026, 07:11 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
#### Teh Xian Yoong (Centific Technologies Inc) [MSFT] on 3/13/2026, 08:47 AM:
Thanks for your sharing the detail steps, I can reproduce this issue through your shared steps and this issue has been escalated for further investigation, if there is any process, I will inform you immediately.
Contributor guide
Research direction
Reproduce the issue in Visual Studio using a file with #regions: expand a region, close and reopen the file, then repeat after deleting the .VS folder. Trace where the region state and the "Collapse #regions on file open" option are persisted; done means the option collapses regions on every file open, regardless of the previously saved state.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100