@@ -51,7 +51,7 @@ 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 )
54
+ else if ( declaration != null && ! declaration . IsBuiltIn && declaration . DeclarationType != DeclarationType . ClassModule && declaration . DeclarationType != DeclarationType . ProceduralModule )
55
55
{
56
56
var typeName = declaration . HasTypeHint
57
57
? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
@@ -63,6 +63,28 @@ public void SetSelectionText(Declaration declaration)
63
63
declaration . IdentifierName ,
64
64
RubberduckUI . ResourceManager . GetString ( "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ,
65
65
string . IsNullOrEmpty ( declaration . AsTypeName ) ? string . Empty : ": " + typeName ) ;
66
+
67
+ _selectionButton . TooltipText = string . IsNullOrEmpty ( declaration . DescriptionString )
68
+ ? _selectionButton . Caption
69
+ : declaration . DescriptionString ;
70
+ }
71
+ else if ( declaration != null )
72
+ {
73
+ // todo: confirm this is what we want, and then refator
74
+ var selection = _vbe . ActiveCodePane . GetQualifiedSelection ( ) ;
75
+ if ( selection . HasValue )
76
+ {
77
+ var typeName = declaration . HasTypeHint
78
+ ? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
79
+ : declaration . AsTypeName ;
80
+
81
+ _selectionButton . Caption = string . Format ( "{0}|{1}: {2} ({3}{4})" ,
82
+ selection . Value . Selection ,
83
+ declaration . QualifiedName . QualifiedModuleName ,
84
+ declaration . IdentifierName ,
85
+ RubberduckUI . ResourceManager . GetString ( "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ,
86
+ string . IsNullOrEmpty ( declaration . AsTypeName ) ? string . Empty : ": " + typeName ) ;
87
+ }
66
88
_selectionButton . TooltipText = string . IsNullOrEmpty ( declaration . DescriptionString )
67
89
? _selectionButton . Caption
68
90
: declaration . DescriptionString ;
0 commit comments