Skip to content

Commit 74ae2dd

Browse files
committed
Some minor improvements in projects usage
1 parent 6c6791f commit 74ae2dd

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/SheetAccessedUsingStringInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private IVBComponent GetVBComponentMatchingSheetName(IdentifierReferenceInspecti
9696

9797
var sheetArgumentContext = indexExprContext.argumentList().argument(0);
9898
var sheetName = FormatSheetName(sheetArgumentContext.GetText());
99-
var project = State.Projects.First(p => p.ProjectId == reference.QualifiedName.ProjectId);
99+
var project = State.ProjectsProvider.Project(reference.QualifiedName.ProjectId);
100100

101101
using (var components = project.VBComponents)
102102
{

Rubberduck.Core/UI/Inspections/InspectionResultsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ private bool CanExecuteCopyResultsCommand(object parameter)
620620
return !IsBusy && _resultsAll != null && _resultsAll.Any();
621621
}
622622

623-
public Visibility EmptyUIRefreshVisibility => _state.Projects.Count > 0 ? Visibility.Hidden : Visibility.Visible;
623+
public Visibility EmptyUIRefreshVisibility => _state.ProjectsProvider.Projects().Any() ? Visibility.Hidden : Visibility.Visible;
624624

625625
public Visibility EmptyUIRefreshMessageVisibility => IsBusy ? Visibility.Hidden : Visibility.Visible;
626626

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ public void SetModuleState(QualifiedModuleName module, ParserState state, Cancel
423423
if (AllUserDeclarations.Any())
424424
{
425425
var projectId = module.ProjectId;
426-
IVBProject project = GetProject(projectId);
426+
var project = GetProject(projectId);
427427

428428
if (project == null)
429429
{

Rubberduck.Parsing/VBA/StateProjectManagerBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public abstract class StateProjectManagerBase : IProjectManager
1111
private readonly RubberduckParserState _state;
1212
private readonly IVBE _vbe;
1313

14-
public StateProjectManagerBase(
14+
protected StateProjectManagerBase(
1515
RubberduckParserState state,
1616
IVBE vbe)
1717
{

0 commit comments

Comments
 (0)