@@ -177,25 +177,27 @@ public string PanelTitle
177
177
return string . Empty ;
178
178
}
179
179
180
- if ( SelectedItem is CodeExplorerProjectViewModel )
180
+ if ( ! ( SelectedItem is ICodeExplorerDeclarationViewModel ) )
181
181
{
182
- var node = ( CodeExplorerProjectViewModel ) SelectedItem ;
183
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
182
+ return SelectedItem . Name ;
184
183
}
185
184
186
- if ( SelectedItem is CodeExplorerComponentViewModel )
187
- {
188
- var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
189
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
190
- }
185
+ var declaration = SelectedItem . GetSelectedDeclaration ( ) ;
186
+
187
+ var nameWithDeclarationType = declaration . IdentifierName +
188
+ string . Format ( " - ({0})" , RubberduckUI . ResourceManager . GetString (
189
+ "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ) ;
191
190
192
- if ( SelectedItem is CodeExplorerMemberViewModel )
191
+ if ( string . IsNullOrEmpty ( declaration . AsTypeName ) )
193
192
{
194
- var node = ( CodeExplorerMemberViewModel ) SelectedItem ;
195
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
193
+ return nameWithDeclarationType ;
196
194
}
197
195
198
- return SelectedItem . Name ;
196
+ var typeName = declaration . HasTypeHint
197
+ ? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
198
+ : declaration . AsTypeName ;
199
+
200
+ return nameWithDeclarationType + ": " + typeName ;
199
201
}
200
202
}
201
203
0 commit comments