Skip to content

Commit 35b1944

Browse files
committed
Address PR review comments
1 parent 7ae947c commit 35b1944

File tree

4 files changed

+6
-3
lines changed

4 files changed

+6
-3
lines changed

Rubberduck.CodeAnalysis/Inspections/Concrete/AssignmentNotUsedInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected override IEnumerable<IInspectionResult> DoGetInspectionResults()
3939
var tree = _walker.GenerateTree(parentScopeDeclaration.Context, variable);
4040

4141
var references = tree.GetIdentifierReferences();
42+
// ignore set-assignments to 'Nothing'
4243
nodes.AddRange(references.Where(r =>
4344
!(r.Context.Parent is VBAParser.SetStmtContext setStmtContext &&
4445
setStmtContext.expression().GetText().Equals(Tokens.Nothing))));

Rubberduck.CodeAnalysis/Inspections/Concrete/FunctionReturnValueNotUsedInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ private bool IsRecursive(Declaration function)
7575

7676
private bool IsReturnValueUsed(Declaration function)
7777
{
78+
// TODO: This is O(MG) at work here. Need to refactor the whole shebang.
7879
return (from usage in function.References
7980
where !IsLet(usage)
8081
where !IsSet(usage)

Rubberduck.VBEditor.VBA/SafeComWrappers/Application/AccessApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public AccessApp(IVBE vbe) : base(vbe, "Access", true)
2828
});
2929
}
3030

31-
public HostDocument GetDocument(QualifiedModuleName moduleName)
31+
public override HostDocument GetDocument(QualifiedModuleName moduleName)
3232
{
3333
try
3434
{
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.Linq;
23
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
34

45
// ReSharper disable once CheckNamespace - Special dispensation due to conflicting file vs namespace priorities
@@ -8,14 +9,14 @@ public sealed class FallbackApp : IHostApplication
89
{
910
public FallbackApp(IVBE vbe) { }
1011
public string ApplicationName => "(unknown)";
11-
public IEnumerable<HostDocument> GetDocuments() => null;
12+
public IEnumerable<HostDocument> GetDocuments() => Enumerable.Empty<HostDocument>();
1213
public HostDocument GetDocument(QualifiedModuleName moduleName)
1314
{
1415
return null;
1516
}
1617
public bool CanOpenDocumentDesigner(QualifiedModuleName moduleName) => false;
1718
public bool TryOpenDocumentDesigner(QualifiedModuleName moduleName) => false;
18-
public IEnumerable<HostAutoMacro> AutoMacroIdentifiers => null;
19+
public IEnumerable<HostAutoMacro> AutoMacroIdentifiers => Enumerable.Empty<HostAutoMacro>();
1920
public void Dispose() { }
2021
}
2122
}

0 commit comments

Comments
 (0)