Skip to content

Commit 59ad563

Browse files
committed
Address review comments, tracked down the last of the ExplicitCallerInfoArguments and replaced them with nameof.
1 parent 4383ecd commit 59ad563

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ public virtual void Synchronize(List<Declaration> updated)
4141
return;
4242
}
4343

44-
var matching = updated.FirstOrDefault(decl => Declaration.DeclarationType == decl?.DeclarationType && Declaration.QualifiedName.Equals(decl?.QualifiedName));
44+
var matching = updated.FirstOrDefault(decl =>
45+
Declaration.DeclarationType == decl?.DeclarationType &&
46+
Declaration.QualifiedName.Equals(decl.QualifiedName));
4547

4648
if (matching is null)
4749
{

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemViewModelBase.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using System;
22
using System.Collections.Generic;
33
using System.Collections.ObjectModel;
4-
using System.Diagnostics.CodeAnalysis;
54
using System.Globalization;
65
using System.Linq;
76
using System.Windows;
@@ -75,13 +74,12 @@ public virtual string PanelTitle
7574

7675
public virtual string Description => Declaration?.DescriptionString ?? string.Empty;
7776

78-
[SuppressMessage("ReSharper", "ExplicitCallerInfoArgument")]
7977
protected void OnNameChanged()
8078
{
81-
OnPropertyChanged("Name");
82-
OnPropertyChanged("NameWithSignature");
83-
OnPropertyChanged("PanelTitle");
84-
OnPropertyChanged("Description");
79+
OnPropertyChanged(nameof(Name));
80+
OnPropertyChanged(nameof(NameWithSignature));
81+
OnPropertyChanged(nameof(PanelTitle));
82+
OnPropertyChanged(nameof(Description));
8583
}
8684

8785
public virtual QualifiedSelection? QualifiedSelection => Declaration?.QualifiedSelection;
@@ -232,8 +230,7 @@ public string Filter
232230
}
233231

234232
OnPropertyChanged();
235-
// ReSharper disable once ExplicitCallerInfoArgument
236-
OnPropertyChanged("Filtered");
233+
OnPropertyChanged(nameof(Filtered));
237234
}
238235
}
239236

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerMemberViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ protected sealed override void AddNewChildren(List<Declaration> updated)
7676
{
7777
if (updated != null)
7878
{
79-
var updates = updated.Where(item => SubMemberTypes.Contains(item.DeclarationType) && item.ParentDeclaration.Equals(Declaration)).ToList();
79+
var updates = updated.Where(item =>
80+
SubMemberTypes.Contains(item.DeclarationType) && item.ParentDeclaration.Equals(Declaration))
81+
.ToList();
8082

8183
AddChildren(updates.Select(item => new CodeExplorerSubMemberViewModel(this, item)));
8284

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerReferenceViewModel.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ public void Synchronize(Declaration project, List<ReferenceModel> updated)
6060

6161
if (used != Reference.IsUsed)
6262
{
63-
// ReSharper disable once ExplicitCallerInfoArgument
64-
OnPropertyChanged("IsDimmed");
63+
OnPropertyChanged(nameof(IsDimmed));
6564
}
6665
}
6766
}

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,13 @@ private void HandleStateChanged(object sender, ParserStateEventArgs e)
243243
}
244244
}
245245

246+
/// <summary>
247+
/// Updates the ViewModel tree to reflect changes in user declarations after a reparse.
248+
/// </summary>
249+
/// <param name="declarations">
250+
/// The new declarations. This should always be the complete declaration set, and materializing
251+
/// the IEnumerable should be deferred to UI thread.
252+
/// </param>
246253
private void Synchronize(IEnumerable<Declaration> declarations)
247254
{
248255
_uiDispatcher.Invoke(() =>

RubberduckTests/CodeExplorer/CodeExplorerComparerTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace RubberduckTests.CodeExplorer
88
{
9+
// TODO: These tests should probably be refactored to use test cases.
910
[TestFixture]
1011
public class CodeExplorerComparerTests
1112
{

0 commit comments

Comments
 (0)