@@ -51,7 +51,7 @@ public void SetSelectionText(Declaration declaration)
5151 if ( selection . HasValue ) { SetSelectionText ( selection . Value ) ; }
5252 _selectionButton . TooltipText = _selectionButton . Caption ;
5353 }
54- else if ( declaration != null )
54+ else if ( declaration != null && ! declaration . IsBuiltIn && declaration . DeclarationType != DeclarationType . ClassModule && declaration . DeclarationType != DeclarationType . ProceduralModule )
5555 {
5656 var typeName = declaration . HasTypeHint
5757 ? Declaration . TypeHintToTypeName [ declaration . TypeHint ]
@@ -63,6 +63,28 @@ public void SetSelectionText(Declaration declaration)
6363 declaration . IdentifierName ,
6464 RubberduckUI . ResourceManager . GetString ( "DeclarationType_" + declaration . DeclarationType , UI . Settings . Settings . Culture ) ,
6565 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+ }
6688 _selectionButton . TooltipText = string . IsNullOrEmpty ( declaration . DescriptionString )
6789 ? _selectionButton . Caption
6890 : declaration . DescriptionString ;
0 commit comments