Skip to content

Merge main to features/required-members#60279

Merged
dotnet-bot merged 311 commits intofeatures/required-membersfrom
merges/main-to-features/required-members
Mar 20, 2022
Merged

Merge main to features/required-members#60279
dotnet-bot merged 311 commits intofeatures/required-membersfrom
merges/main-to-features/required-members

Conversation

@dotnet-bot
Copy link
Copy Markdown
Collaborator

This is an automatically generated pull request from main into features/required-members.

Once all conflicts are resolved and all the tests pass, you are free to merge the pull request. 🐯

Troubleshooting conflicts

Identify authors of changes which introduced merge conflicts

Scroll to the bottom, then for each file containing conflicts copy its path into the following searches:

Usually the most recent change to a file between the two branches is considered to have introduced the conflicts, but sometimes it will be necessary to look for the conflicting lines and check the blame in each branch. Generally the author whose change introduced the conflicts should pull down this PR, fix the conflicts locally, then push up a commit resolving the conflicts.

Resolve merge conflicts using your local repo

Sometimes merge conflicts may be present on GitHub but merging locally will work without conflicts. This is due to differences between the merge algorithm used in local git versus the one used by GitHub.

git fetch --all
git checkout -t upstream/merges/main-to-features/required-members
git reset --hard upstream/features/required-members
git merge upstream/main
# Fix merge conflicts
git commit
git push upstream merges/main-to-features/required-members --force

JoeRobich and others added 30 commits March 7, 2022 13:20
Expose ForceExpandedCompletionIndexCreation option to O#
Add build triggers to azure pipeline yaml
SyntaxContext's GlobalStatementContext changes
CSharpImportAdder should be able to add the intended import if the identifier is a var
* Flatten Implementation directory in VS layer

* Correct links
Update integration tests to support both possible Go To Implementation results
This ensures subsequent calls to CreateSolutionAsync will not occur when
a solution is already open. Doing so produces a Save As dialog that
interferes with test execution.
These were added for completeness but then not actually used anywhere;
rather than try to maintain them just delete them.
We convert metadata references to project references if the output paths
match the referenced paths. Thus if we have a solution with a bunch of
metadata references, and then we're told a project has a new output
path, we have to go looking to see if we can convert those metadata
references to project references as well. To do that conversion, we
have to acquire the global workspace lock, since any other projects
that are also adding or removing metadata references at the same
time need to be all coordinated.

We also support the concept of "batching" when updating a project,
which means a project system can make a bunch of changes at once but
we'll raise only a single WorkspaceChanged event once those changes are
all done; we also try to ensure that we aren't acquiring the global
workspace lock until the batch is actually being applied; that ensures
we can do as much in parallel at once. We also recently added the
ability for the batch to be applied with an async API, so if there's
another project applying changes at once we aren't going to starve the
thread pool.

There was one bug, however: when you started a batch, and then changed
the output path of the project, that updating of the output path should
have waited until the batch was applied. We'd update the property in the
workspace correctly, but we immediately acquired the global workspace
lock trying to look for other projects to update with project
references. Functionally this was mostly fine (ignoring there's a small
window in time where we converted to project references even if a
project didn't have the updated output path), but it created a huge
performance issue: we would be acquiring the global workspace lock
synchronously, even if the caller was trying to operate in a batch
that they were going to apply asynchronously. If the user got
particularly unlucky, they might have a bunch of projects all being
loaded or reloaded at once, and they might starve off their thread pool.

The fix, conceptually, is simple: defer the conversion to project
references until the global lock is actually held once we are applying
the batch change. This resulted in a bit of churn; when we apply a batch
we have a little helper type called a SolutionChangeAccumulator that we
pass around that tracks the new Solution object, but also tracks what
the resulting "kind" should be for the solution change. Thus this commit
required this set of changes:

1. Convert the methods that did the conversion to/from project
   references to operate on a SolutionChangeAccumulator instead of
   directly reading CurrentSolution and directly setting the output.
2. Update the ChangeProjectOutputPath and ChangeProjectProperty
   functions to now operate with SolutionChangeAccumulators.
3. Update the project removal path to also now create a
   SolutionChangeAccumulator.
4. General refactorings (extracting/merging) of some of our core
   helpers where we apply changes in the end.

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1473249
There's still a switch happening in CreateAndAddToWorkspaceAsync,
which is where it should be and can be better limited.
JoeRobich and others added 16 commits March 17, 2022 17:00
Update file license header from Apache2 to MIT
Try to provide fine-grained text changes in await-completion to help out other hosts.
A few improvements to common lightbulb cases.
…enerated-files

Fix handling for source generated documents in LSIF
Move CSharpDiagnosticAnalyzerQuickInfoProvider to EditorFeature
[main] Update dependencies from dotnet/arcade
Update ToImmutableArrayAsync to work with all cancellation patterns
@dotnet-bot dotnet-bot requested review from a team, 333fred and JoeRobich as code owners March 20, 2022 00:02
@dotnet-bot dotnet-bot requested a review from a team March 20, 2022 00:02
@dotnet-bot dotnet-bot requested a review from a team as a code owner March 20, 2022 00:02
@dotnet-bot dotnet-bot enabled auto-merge March 20, 2022 00:02
@dotnet-bot dotnet-bot merged commit 9cfe9e1 into features/required-members Mar 20, 2022
Copy link
Copy Markdown

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approval

@333fred 333fred deleted the merges/main-to-features/required-members branch March 24, 2022 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.