@@ -45,11 +45,15 @@ private string Format(Declaration declaration)
45
45
46
46
typeName = "(" + declarationType + ( string . IsNullOrEmpty ( typeName ) ? string . Empty : ":" + typeName ) + ")" ;
47
47
48
- if ( declaration . DeclarationType . HasFlag ( DeclarationType . Module ) )
48
+ if ( declaration . DeclarationType . HasFlag ( DeclarationType . Project ) )
49
+ {
50
+ formattedDeclaration = System . IO . Path . GetFileName ( declaration . QualifiedName . QualifiedModuleName . ProjectPath ) + ";" + declaration . IdentifierName ;
51
+ }
52
+ else if ( declaration . DeclarationType . HasFlag ( DeclarationType . Module ) )
49
53
{
50
54
formattedDeclaration = moduleName . ToString ( ) ;
51
55
}
52
-
56
+
53
57
if ( declaration . DeclarationType . HasFlag ( DeclarationType . Member ) )
54
58
{
55
59
formattedDeclaration = declaration . QualifiedName . ToString ( ) ;
@@ -59,7 +63,7 @@ private string Format(Declaration declaration)
59
63
formattedDeclaration += typeName ;
60
64
}
61
65
}
62
-
66
+
63
67
if ( declaration . DeclarationType == DeclarationType . Enumeration
64
68
|| declaration . DeclarationType == DeclarationType . UserDefinedType )
65
69
{
@@ -68,8 +72,7 @@ private string Format(Declaration declaration)
68
72
? System . IO . Path . GetFileName ( moduleName . ProjectPath ) + ";" + moduleName . ProjectName + "." + declaration . IdentifierName
69
73
: moduleName . ToString ( ) ;
70
74
}
71
-
72
- if ( declaration . DeclarationType == DeclarationType . EnumerationMember
75
+ else if ( declaration . DeclarationType == DeclarationType . EnumerationMember
73
76
|| declaration . DeclarationType == DeclarationType . UserDefinedTypeMember )
74
77
{
75
78
formattedDeclaration = string . Format ( "{0}.{1}.{2}" ,
@@ -81,13 +84,13 @@ private string Format(Declaration declaration)
81
84
}
82
85
83
86
var subscripts = declaration . IsArray ? "()" : string . Empty ;
84
- if ( declaration . ParentDeclaration . DeclarationType . HasFlag ( DeclarationType . Member ) )
87
+ if ( declaration . ParentDeclaration != null && declaration . ParentDeclaration . DeclarationType . HasFlag ( DeclarationType . Member ) )
85
88
{
86
89
// locals, parameters
87
90
formattedDeclaration = string . Format ( "{0}:{1}{2} {3}" , declaration . ParentDeclaration . QualifiedName , declaration . IdentifierName , subscripts , typeName ) ;
88
91
}
89
92
90
- if ( declaration . ParentDeclaration . DeclarationType . HasFlag ( DeclarationType . Module ) )
93
+ if ( declaration . ParentDeclaration != null && declaration . ParentDeclaration . DeclarationType . HasFlag ( DeclarationType . Module ) )
91
94
{
92
95
// fields
93
96
var withEvents = declaration . IsWithEvents ? "(WithEvents) " : string . Empty ;
0 commit comments