-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix problematic things on IProjectSnapshot (#9871)
Part of #9519 As per our meeting the other day, there are a few things on `IProjectSnapshot` that are problematic. This PR resolves all of the issues in one of two ways: * For `Configuration`, `GetProjectEngine()` and `ProjectWorkspaceState` the cohost implementations now simply throw * There was some usage of these inside cohosting, because it re-used methods on `DocumentState` to do jobs that the source gen will eventually take over. To make this clearer, I modified the helper methods so they took the underlying data, rather than pulling it from `IProjectSnapshot` directly * Changes the `TagHelpers` property into a `GetTagHelpersAsync(CancellationToken)` method * Because of the virality of async, I recommend reviewing this PR commit-at-a-time, just so this last commit is seen separately, for your sanity. * There were only two places where moving to async would have been very very annoying, so I added a `GetTagHelpersSynchronously()` extension method that validates that its not called from cohosting. It's only called from legacy editor code. Note that this isn't the proposed solution in the aforementioned meeting, that change can still come later. I was hoping to take that idea and use DI to enforce something better than just a runtime check, but it turned out that wasn't possible because some MEF services need these properties in non-cohosting. This PR at least introduces the runtime check, so we can continue moving forward. Integration tests are running and should show up in in the checks list.
- Loading branch information
Showing
41 changed files
with
344 additions
and
275 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.