Add Fn to type signature explainer

This commit is contained in:
2022-06-13 22:22:22 +02:00
parent 6efcea643f
commit ee48ec29f0

View File

@@ -70,6 +70,25 @@ CarpTypeSignature >> elementsList [
text: '<StaticLifetime>'; text: '<StaticLifetime>';
padding: (BlInsets all: 5)) ]. padding: (BlInsets all: 5)) ].
(tokens includes: 'Fn')
ifTrue: [ verticalContainer
addChild: (BrLabel new
aptitude: BrGlamorousLabelAptitude new
+ (GtExplainerExplanationAptitude new explanationModel: 'Fn')
+ (BrStyleCommonAptitude new
hovered: [ :aStyle |
aStyle background: BrGlamorousColors textHighlightColor.
aStyle
do: [ tooltipsContainer
text: 'is the function type and is read: ' asRopedText, '(Fn [<arguments>] <return type> <lifetime>).' asRopedText glamorousCodeFont;
visibility: BlVisibility visible ]
after: [ tooltipsContainer
text: '' asRopedText;
visibility: BlVisibility gone ] ]);
geometry: (BlRoundedRectangleGeometry cornerRadius: 4);
text: 'Fn';
padding: (BlInsets all: 5)) ].
^ verticalContainer asScrollableElement ^ verticalContainer asScrollableElement
constraintsDo: [ :c | constraintsDo: [ :c |
c horizontal fitContent. c horizontal fitContent.