Merged
Conversation
This is a beginning of work on #37768. Detect used assembly references from: - explicit references to types in source; - explicit references to namespaces in source; - explicit references to fields in source; - explicit method invocations in source; Usings flagged by the compiler as unused shouldn’t contribute to the set of used references.
Merge master into UsedAssemblyReferences
… used assemblies while binding for SemanticModel. (#40178)
…blies (#40560) The basic idea is that dependencies should be tracked along with use-site diagnostics and should be collected together with regular diagnostic messages and bubble up to the top. The final consumer of the combined diagnostics and dependencies is responsible for “registering” dependencies with the compilation or ignore them (due to the context, etc.). I believe this is a very robust approach and would require little maintenance going forward, because every time a symbol is used, a use-site diagnostics should be reported. We just need to keep doing that for every new feature and dependencies will be tracked automatically. Also, the code performing binding no longer needs to be context aware (should dependencies be tracked at this moment or not), they should always be tracked and collected along with the regular diagnostics and it is up to the consumer to decide what to do with them, if anything. For example, when SemanticModel performs binding, dependencies are not registered, etc. Record used assembly references for more scenarios. - Merged extern aliases - Embeddable attributes - Usage of canonical definitions for NoPia embedded types - nameof of a method - Deconstruction - Collection initializers Related to #37768.
Implement GetUsedAssemblyReferences API for VB
…e of a core library.
- Do not track usage of an assembly being built, it is always filtered out at the end. - Do not track dependencies when consumer is not interested in them. This mostly affects binding and lowering of an executable code.
Reduce amount of allocations related to tracking used assemblies: - Do not track usage of an assembly being built, it is always filtered out at the end. - Do not track dependencies when consumer is not interested in them. This mostly affects binding and lowering of an executable code.
Merge 'dotnet/master' into UsedAssemblyReferences
Some clean-up refactorings for UsedAssemblyReferences feature: - Update license comments - Refactorings to address previous PR feedback and prototype comments
Merge 'dotnet/master' into UsedAssemblyReferences
Merge 'dotnet/master' into UsedAssemblyReferences
Record usage of TupleElementNamesAttribute in VB
…atures/UsedAssemblyReferences
…ssemblyReferences Merge master to features/UsedAssemblyReferences
Add Remove Unused References dialog
Make msbuild workspace test conditional on VS16.9 Preview 3
…ssemblyReferences Merge master to features/UsedAssemblyReferences
…ssemblyReferences Merge 'master' into features/UsedAssemblyReferences
…es-suggested-actions Unify EditorFeatures.Cocoa/Wpf suggested actions code
Merge features/UsedAssemblyReferences into 'master'
Merge release/dev16.9 to master
8eb9f24 to
a611e22
Compare
This pull request was closed.
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.
This is an automatically generated pull request from master into master-vs-deps.
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 merges/master-to-master-vs-deps git reset --hard upstream/master-vs-deps git merge upstream/master # Fix merge conflicts git commit git push upstream merges/master-to-master-vs-deps --force