Skip to content

Commit 1d5a7af

Browse files
cominternretailcoder
authored andcommitted
Generalized RD's ignorance of IDispatch and IUnknown members. (#1699)
* Generalized RD's ignorance of IDispatch and IUnknown members. * Quickfix for LONG_PTR => LongPtr
1 parent 8428eb4 commit 1d5a7af

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Rubberduck.Parsing/Symbols/ReferencedDeclarationsCollector.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private string GetTypeName(ITypeInfo info)
144144
string helpFile;
145145
info.GetDocumentation(-1, out typeName, out docString, out helpContext, out helpFile);
146146

147-
return typeName;
147+
return typeName.Equals("LONG_PTR") ? "LongPtr" : typeName; //Quickfix for http://chat.stackexchange.com/transcript/message/30119269#30119269
148148
}
149149

150150
public List<Declaration> GetDeclarationsForReference(Reference reference)
@@ -350,6 +350,12 @@ private Declaration CreateMemberDeclaration(FUNCDESC memberDescriptor, TYPEKIND
350350
var funcValueType = (VarEnum)memberDescriptor.elemdescFunc.tdesc.vt;
351351
var memberDeclarationType = GetDeclarationType(memberName, memberDescriptor, funcValueType, typeKind, parentImplFlags);
352352

353+
if (((FUNCFLAGS)memberDescriptor.wFuncFlags).HasFlag(FUNCFLAGS.FUNCFLAG_FRESTRICTED) &&
354+
IgnoredInterfaceMembers.Contains(memberName)) // Ignore IDispatch and IUnknown members - quick-and-dirty for beta
355+
{
356+
return null;
357+
}
358+
353359
var asTypeName = new ComParameter(string.Empty, false);
354360
if (memberDeclarationType != DeclarationType.Procedure)
355361
{
@@ -587,8 +593,7 @@ private DeclarationType GetDeclarationType(string memberName, FUNCDESC funcDesc,
587593
memberType = DeclarationType.PropertySet;
588594
}
589595
else if ((parentImplTypeFlags.HasFlag(IMPLTYPEFLAGS.IMPLTYPEFLAG_FSOURCE) ||
590-
((FUNCFLAGS)funcDesc.wFuncFlags).HasFlag(FUNCFLAGS.FUNCFLAG_FSOURCE)) &&
591-
!IgnoredInterfaceMembers.Contains(memberName)) // quick-and-dirty for beta
596+
((FUNCFLAGS)funcDesc.wFuncFlags).HasFlag(FUNCFLAGS.FUNCFLAG_FSOURCE)))
592597
{
593598
memberType = DeclarationType.Event;
594599
}

0 commit comments

Comments
 (0)