File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Rubberduck.Parsing/Symbols Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,15 @@ public Declaration(
156
156
_attributes = attributes ?? new Attributes ( ) ;
157
157
158
158
_projectId = _qualifiedName . QualifiedModuleName . ProjectId ;
159
+ var projectDeclaration = Declaration . GetProjectParent ( parentDeclaration ) ;
160
+ if ( projectDeclaration != null )
161
+ {
162
+ _projectName = projectDeclaration . IdentifierName ;
163
+ }
164
+ else if ( _declarationType == DeclarationType . Project )
165
+ {
166
+ _projectName = _identifierName ;
167
+ }
159
168
160
169
_customFolder = FolderFromAnnotations ( ) ;
161
170
_isArray = isArray ;
@@ -392,17 +401,10 @@ public void AddMemberCall(IdentifierReference reference)
392
401
/// </summary>
393
402
public string ProjectId { get { return _projectId ; } }
394
403
404
+ private readonly string _projectName ;
395
405
public string ProjectName
396
406
{
397
- get
398
- {
399
- if ( Project != null )
400
- {
401
- return Project . Name ;
402
- }
403
- // Referenced projects have their identifier name set as their project name.
404
- return IdentifierName ;
405
- }
407
+ get { return _projectName ; }
406
408
}
407
409
408
410
public object [ ] ToArray ( )
You can’t perform that action at this time.
0 commit comments