NRT enable dependent project finder.#43900
Merged
CyrusNajmabadi merged 5 commits intodotnet:masterfrom May 5, 2020
Merged
Conversation
sharwell
reviewed
May 4, 2020
src/Workspaces/Core/Portable/FindSymbols/FindReferences/DependentProjectsFinder.cs
Outdated
Show resolved
Hide resolved
sharwell
reviewed
May 4, 2020
| private struct DependentProject : IEquatable<DependentProject> | ||
| private readonly struct DependentProject : IEquatable<DependentProject> | ||
| { | ||
| public readonly ProjectId ProjectId; |
Contributor
There was a problem hiding this comment.
Suggested change
| public readonly ProjectId ProjectId; | |
| public readonly ProjectId? ProjectId; |
dpoeschl
approved these changes
May 4, 2020
sharwell
reviewed
May 4, 2020
|
|
||
| if (previous != null) | ||
| { | ||
| var referencedProject = solution.GetProject(previous.Assembly, cancellationToken); |
Contributor
There was a problem hiding this comment.
❔ Why not GetRequiredProject here?
Contributor
Author
There was a problem hiding this comment.
tbh, because i don't know if i expect the above to succeed.
sharwell
reviewed
May 4, 2020
Comment on lines
+296
to
+300
| return attrType?.Name == nameof(InternalsVisibleToAttribute) && | ||
| attrType.ContainingNamespace?.Name == nameof(System.Runtime.CompilerServices) && | ||
| attrType.ContainingNamespace.ContainingNamespace?.Name == nameof(System.Runtime) && | ||
| attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace?.Name == nameof(System) && | ||
| attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace.ContainingNamespace?.IsGlobalNamespace == true; |
Contributor
There was a problem hiding this comment.
💭 It would be nice to have a helper IsSameTypeName(Type) that performs this check:
return attrType.IsSameTypeName(typeof(InternalsVisibleToAttribute));
Contributor
Author
There was a problem hiding this comment.
idealy, this would just grab the "GetBestTypeByMetadataName" and hten just compare that type to the attrType. But i was worried that might subtle change semantics.
sharwell
approved these changes
May 4, 2020
Contributor
sharwell
left a comment
There was a problem hiding this comment.
A couple small additional details
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 have a null ref in this code reported here: #43265
The code is extremely brittle and definitely not null safe. So at least doing a first pass of NRTifying it.