-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snapshot tracks only visible unresolved items #4980
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -438,7 +438,7 @@ private void OnDependenciesSnapshotChanged(object sender, SnapshotChangedEventAr | |
{ | ||
dependenciesNode = await viewProvider.BuildTreeAsync(dependenciesNode, snapshot, cancellationToken); | ||
|
||
await _treeTelemetryService.ObserveTreeUpdateCompletedAsync(snapshot.HasUnresolvedDependency); | ||
await _treeTelemetryService.ObserveTreeUpdateCompletedAsync(snapshot.HasVisibleUnresolvedDependency); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that this change will impact telemetry, in keeping with what's presented on screen. |
||
} | ||
|
||
// TODO We still are getting mismatched data sources and need to figure out better | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ public async Task<IProjectTree> BuildTreeAsync( | |
|
||
dependenciesTree = CleanupOldNodes(dependenciesTree, currentTopLevelNodes); | ||
|
||
ProjectImageMoniker rootIcon = _viewModelFactory.GetDependenciesRootIcon(snapshot.HasUnresolvedDependency).ToProjectSystemType(); | ||
ProjectImageMoniker rootIcon = _viewModelFactory.GetDependenciesRootIcon(snapshot.HasVisibleUnresolvedDependency).ToProjectSystemType(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where the icon is determined at the root level. This PR means only visible and unresolved descendents of the root can cause the root to have a yellow triangle. |
||
|
||
return dependenciesTree.SetProperties(icon: rootIcon, expandedIcon: rootIcon); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,7 +174,7 @@ internal TargetedDependenciesSnapshot( | |
Catalogs = catalogs; | ||
DependenciesWorld = dependenciesWorld; | ||
|
||
bool hasUnresolvedDependency = false; | ||
bool hasVisibleUnresolvedDependency = false; | ||
ImmutableArray<IDependency>.Builder topLevelDependencies = ImmutableArray.CreateBuilder<IDependency>(); | ||
|
||
foreach ((string id, IDependency dependency) in dependenciesWorld) | ||
|
@@ -183,9 +183,9 @@ internal TargetedDependenciesSnapshot( | |
string.Equals(id, dependency.Id), | ||
"dependenciesWorld dictionary entry keys must match their value's ids."); | ||
|
||
if (!dependency.Resolved) | ||
if (!dependency.Resolved && dependency.Visible) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the additional constraint. |
||
{ | ||
hasUnresolvedDependency = true; | ||
hasVisibleUnresolvedDependency = true; | ||
} | ||
|
||
if (dependency.TopLevel) | ||
|
@@ -201,7 +201,7 @@ internal TargetedDependenciesSnapshot( | |
} | ||
} | ||
|
||
HasUnresolvedDependency = hasUnresolvedDependency; | ||
HasVisibleUnresolvedDependency = hasVisibleUnresolvedDependency; | ||
TopLevelDependencies = topLevelDependencies.ToImmutable(); | ||
} | ||
|
||
|
@@ -230,7 +230,7 @@ internal TargetedDependenciesSnapshot( | |
private object SyncLock => _dependenciesChildrenMap; | ||
|
||
/// <inheritdoc /> | ||
public bool HasUnresolvedDependency { get; } | ||
public bool HasVisibleUnresolvedDependency { get; } | ||
|
||
/// <inheritdoc /> | ||
public bool CheckForUnresolvedDependencies(IDependency dependency) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change gets rid of
HasUnresolvedDependency
, which isn't even onIDependency
. For this simple test type I prefer the strongly typed approach.