Explicitly handle the start of a solution open to update state#27159
Merged
jinujoseph merged 1 commit intodotnet:masterfrom May 31, 2018
Merged
Conversation
We update _solutionLoadComplete in various places as a way to approximate a "should we batch this load" flag. We never explicitly listened to a begin solution load event -- we just assumed VS starts this way, and reset it during solution close. Sometimes solutions can be re-opened before a close, and our flag would then be off and cause extra processing when unintended.
Pilchie
approved these changes
May 25, 2018
| { | ||
| int IVsSolutionLoadEvents.OnBeforeOpenSolution(string pszSolutionFilename) | ||
| { | ||
| GetProjectTrackerAndInitializeIfNecessary(ServiceProvider.GlobalProvider).OnBeforeOpenSolution(); |
Member
There was a problem hiding this comment.
Do we want to force create it here, or leave it null if it's the first solution being opened?
Member
Author
There was a problem hiding this comment.
@Pilchie Well, if it's the very first solution being opened, it's possible we haven't even subscribed to that -- we won't have loaded until the first project is being pushed.
PavelUstinovMS
approved these changes
May 25, 2018
Member
Author
|
@dotnet-bot retest this please. |
Member
Author
|
@jinujoseph, this needs a delegated M2 approval. |
Contributor
|
Approved to merge for 15.8.Preview3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We update _solutionLoadComplete in various places as a way to approximate a "should we batch this load" flag. We never explicitly listened to a begin solution load event -- we just assumed VS starts this way, and reset it during solution close. Sometimes solutions can be re-opened before a close, and our flag would then be off and cause extra processing when unintended.
Ask Mode template
Customer scenario
Opens a file for diffing (say from team explorer), and then opens a solution. The solution load will be slower than it should be.
Bugs this fixes
https://devdiv.visualstudio.com/0bdbc590-a062-4c3f-b0f6-9383f67865ee/_workitems/edit/520280
Workarounds, if any
Open a different solution before you open the big solution, or restart Visual Studio.
Risk
Moderate: the change is simple, but this area is subtle.
Performance impact
Improved.
Is this a regression from a previous update?
Nope, seems to have always been there.
Root cause analysis
When files are opened for diff, Roslyn set a flag tracking that as meaning the solution was open, and further projects should be loaded interactively. This happens because the Roslyn's expectations for the events being raised didn't match reality. It's a combination of Roslyn having strange code, and the events being raised aren't quite right anyways. The shell looked into fixing their issues but saw further regressions in other areas.
How was the bug found?
Customer report.