@@ -51,31 +51,18 @@ public void SetSelectionText(Declaration declaration)
51
51
if ( selection . HasValue ) { SetSelectionText ( selection . Value ) ; }
52
52
_selectionButton . TooltipText = _selectionButton . Caption ;
53
53
}
54
- else if ( declaration != null && ! declaration . IsBuiltIn && declaration . DeclarationType != DeclarationType . ClassModule && declaration . DeclarationType != DeclarationType . ProceduralModule )
54
+ else if ( declaration != null )
55
55
{
56
+ var typeName = declaration . HasTypeHint
57
+ ? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
58
+ : declaration . AsTypeName ;
59
+
56
60
_selectionButton . Caption = string . Format ( "{0}|{1}: {2} ({3}{4})" ,
57
61
declaration . QualifiedSelection . Selection ,
58
62
declaration . QualifiedName . QualifiedModuleName ,
59
63
declaration . IdentifierName ,
60
64
RubberduckUI . ResourceManager . GetString ( "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ,
61
- string . IsNullOrEmpty ( declaration . AsTypeName ) ? string . Empty : ": " + declaration . AsTypeName ) ;
62
- _selectionButton . TooltipText = string . IsNullOrEmpty ( declaration . DescriptionString )
63
- ? _selectionButton . Caption
64
- : declaration . DescriptionString ;
65
- }
66
- else if ( declaration != null )
67
- {
68
- // todo: confirm this is what we want, and then refator
69
- var selection = _vbe . ActiveCodePane . GetQualifiedSelection ( ) ;
70
- if ( selection . HasValue )
71
- {
72
- _selectionButton . Caption = string . Format ( "{0}|{1}: {2} ({3}{4})" ,
73
- selection . Value . Selection ,
74
- declaration . QualifiedName . QualifiedModuleName ,
75
- declaration . IdentifierName ,
76
- RubberduckUI . ResourceManager . GetString ( "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ,
77
- string . IsNullOrEmpty ( declaration . AsTypeName ) ? string . Empty : ": " + declaration . AsTypeName ) ;
78
- }
65
+ string . IsNullOrEmpty ( declaration . AsTypeName ) ? string . Empty : ": " + typeName ) ;
79
66
_selectionButton . TooltipText = string . IsNullOrEmpty ( declaration . DescriptionString )
80
67
? _selectionButton . Caption
81
68
: declaration . DescriptionString ;
0 commit comments