Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Visual Studio hangs for several minutes when reorganizing/cleaning with Spade open #556
Visual Studio hangs for several minutes when reorganizing/cleaning in bulk with Spade open. I've tested several times with around 20 classes open, app C#. I tried disabling the reorganizing feature and even the Spade code synchronization.
Steps to recreate
Same as Description above.
When I close Spade, it saves and reorganizes/cleans up quickly all files. I'd expect it to be the same with Spade open, as when this process occurs Spade refreshing should be disabled. It should refresh again in the end for the last open file.
Thanks for reporting the issue. I have seen it as well. There isn't currently any logic that "suspends" Spade when bulk operations are beginning. I do expect the Spade window to be significantly more responsive when we move to the Roslyn APIs which can provide us change deltas vs. the current APIs which require a full rebuild (i.e. there's no change state, so every refresh is a full file refresh).
Well, then the current API requiring the full rebuild could be the reason it hangs. When is the new implementation with Roslyn API happening?
added a commit
Jun 9, 2018
I looked into this and what I'm seeing is that while Spade is building the code model, the cleaning (and/or reorganizing) process is waiting for that code model to be built. It currently blocks for up to 30 seconds before giving up. As a short-term fix, I've reduced that maximum block from 30 seconds to 3 seconds so it will at least fail faster when this situation is hit.. reducing the UI impact.
I think a better/longer term fix would be to leverage Roslyn's async libraries (the older APIs are all synchronous).
@codecadwallader I managed to give it a quick try today and this fix worked very well. I'll keep using it from now on again to see how it behaves with larger classes (for now I tested with very small dtos).
Thanks for that and keep up the great work!