@@ -189,25 +189,27 @@ public string PanelTitle
189
189
return string . Empty ;
190
190
}
191
191
192
- if ( SelectedItem is CodeExplorerProjectViewModel )
192
+ if ( ! ( SelectedItem is ICodeExplorerDeclarationViewModel ) )
193
193
{
194
- var node = ( CodeExplorerProjectViewModel ) SelectedItem ;
195
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
194
+ return SelectedItem . Name ;
196
195
}
197
196
198
- if ( SelectedItem is CodeExplorerComponentViewModel )
199
- {
200
- var node = ( CodeExplorerComponentViewModel ) SelectedItem ;
201
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
202
- }
197
+ var declaration = SelectedItem . GetSelectedDeclaration ( ) ;
198
+
199
+ var nameWithDeclarationType = declaration . IdentifierName +
200
+ string . Format ( " - ({0})" , RubberduckUI . ResourceManager . GetString (
201
+ "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ) ;
203
202
204
- if ( SelectedItem is CodeExplorerMemberViewModel )
203
+ if ( string . IsNullOrEmpty ( declaration . AsTypeName ) )
205
204
{
206
- var node = ( CodeExplorerMemberViewModel ) SelectedItem ;
207
- return node . Declaration . IdentifierName + string . Format ( " - ({0})" , node . Declaration . DeclarationType ) ;
205
+ return nameWithDeclarationType ;
208
206
}
209
207
210
- return SelectedItem . Name ;
208
+ var typeName = declaration . HasTypeHint
209
+ ? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
210
+ : declaration . AsTypeName ;
211
+
212
+ return nameWithDeclarationType + ": " + typeName ;
211
213
}
212
214
}
213
215
0 commit comments