Skip to content

Commit b5fd793

Browse files
committed
Improve info for ObjectWhereProcedureIsRequiresInspection
Updates are based on review comments to PR #5165.
1 parent 6ca5b84 commit b5fd793

File tree

5 files changed

+15
-16
lines changed

5 files changed

+15
-16
lines changed

Rubberduck.CodeAnalysis/Inspections/ObjectWhereProcedureIsRequiredInspection.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
using Rubberduck.Parsing.VBA;
77
using Rubberduck.Inspections.Inspections.Extensions;
88
using Rubberduck.Inspections.Results;
9-
using Rubberduck.Parsing.Grammar;
109
using Rubberduck.Parsing.Inspections;
1110
using Rubberduck.Parsing.Inspections.Abstract;
1211
using Rubberduck.Parsing.VBA.DeclarationCaching;
@@ -22,36 +21,38 @@ namespace Rubberduck.Inspections.Concrete
2221
/// This behavior is not obvious and most likely an error.
2322
/// </why>
2423
/// <example hasResult="true">
24+
/// <module name="Class1" type="Class Module">
2525
/// <![CDATA[
26-
/// Class1:
27-
///
2826
/// Public Function Foo() As Long
2927
/// Attibute VB_UserMemId = 0
3028
/// Foo = 42
3129
/// End Function
32-
///
33-
/// Module:
34-
///
30+
/// ]]>
31+
/// </module>
32+
/// <module name="Module" type="Standard Module">
33+
/// <![CDATA[
3534
/// Public Sub DoSomething(ByVal arg As Class1)
3635
/// arg
3736
/// End Sub
3837
/// ]]>
38+
/// </module>
3939
/// </example>
4040
/// <example hasResult="false">
41+
/// <module name="Class1" type="Class Module">
4142
/// <![CDATA[
42-
/// Class1:
43-
///
4443
/// Public Function Foo() As Long
4544
/// Attibute VB_UserMemId = 0
4645
/// Foo = 42
4746
/// End Function
48-
///
49-
/// Module:
50-
///
47+
/// ]]>
48+
/// </module>
49+
/// <module name="Module" type="Standard Module">
50+
/// <![CDATA[
5151
/// Public Sub DoSomething(ByVal arg As Class1)
5252
/// arg.Foo
5353
/// End Sub
5454
/// ]]>
55+
/// </module>
5556
/// </example>
5657
public sealed class ObjectWhereProcedureIsRequiredInspection : InspectionBase
5758
{

Rubberduck.Resources/Inspections/InspectionInfo.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.Resources/Inspections/InspectionInfo.de.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,6 @@ Falls der Parameter 'null' sein kann, bitte dieses Auftreten ignorieren. 'null'
410410
<value>Die Ausrufezeichennotation erweckt den Eindruck, dass es sich um einen Zugriff handelt, der Typchecks unterliegt. Allerdings handelt es sich lediglich um einen Zugriff auf den Standardmember des Objekts, auf das sie angewendet wird, bei dem das Argument als Zeichenkette übergeben wird. Dies ist besonders verwirrend, wenn der Standardmember nicht zum Zeitpunkt des Kompilierens ermittelt werden kann.</value>
411411
</data>
412412
<data name="ObjectWhereProcedureIsRequiredInspection" xml:space="preserve">
413-
<value>Wenn ein Objekt mit einem Standardmember an einer Stelle verwendet wird, die nach einer Prozedur verlangt, wird der Standardmember aufgerufen. Die ist wahrscheinlich ein Fehler, zu Mindest aber nicht offensichtlich.</value>
413+
<value>Wenn ein Objekt mit einem Standardmember an einer Stelle verwendet wird, die nach einer Prozedur verlangt, wird implizit der Standardmember aufgerufen. Die ist wahrscheinlich nicht beabsichtigt, minder aber zu Mindest die Lesbarkeit des Programms.</value>
414414
</data>
415415
</root>

Rubberduck.Resources/Inspections/InspectionInfo.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,6 @@ If the parameter can be null, ignore this inspection result; passing a null valu
413413
<value>Bang notation, formally known as dictionary access expression, looks like it is strongly typed. However, it is actually a stringly-typed access to the parameterized default member of the object it is used on. This is especially misleading the default member cannot be determined at compile time.</value>
414414
</data>
415415
<data name="ObjectWhereProcedureIsRequiredInspection" xml:space="preserve">
416-
<value>Using an object with a default member in a place that requires a procedure leads to a call to the default member. This is most likely an error, but at least not obvious.</value>
416+
<value>Using an object with a default member in a place that requires a procedure leads to an implicit invocation of the default member. This is most likely unintentional and negatively affects readability.</value>
417417
</data>
418418
</root>

RubberduckTests/Grammar/ResolverTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading;
5-
using System.Windows.Controls;
65
using NUnit.Framework;
76
using Rubberduck.Parsing.Symbols;
87
using Rubberduck.Parsing.VBA;
98
using RubberduckTests.Mocks;
109
using Rubberduck.Parsing.Annotations;
11-
using Rubberduck.Parsing.VBA.Extensions;
1210
using Rubberduck.VBEditor;
1311
using Rubberduck.VBEditor.SafeComWrappers;
1412
using Rubberduck.VBEditor.SafeComWrappers.Abstract;

0 commit comments

Comments
 (0)