Tested in Moose-6.1
AST styler needs to be (re)enabled.
MetalinkIconStyler class>>shouldStyle
^true
Debugger code
GTGenericStackDebugger subclass: #MTMetaLinkDebugger
slots: { }
classVariables: { }
category: 'MetaLinkDebugger'
metaLinkCodeIn: composite forContext: aContext
| textPresentation subscription |
textPresentation := self methodCodeIn: composite forContext: aContext.
subscription := textPresentation
when: RubConfigurationChange
do: [ :announcer | announcer configurationBlock value: textPresentation ].
IconStyler styleText: textPresentation withAst: aContext method ast.
textPresentation removeSubscription: subscription
transmitFromStackToCodeIn: browser
browser transmit
from: #stack port: #selection;
to: #code;
andShow: [ :composite :aContext |
" self methodCodeIn: composite forContext: aContext."
aContext ifNotNil: [ self metaLinkCodeIn: composite forContext: aContext ] ]
Small object to test it on
Object subclass: #Person
slots: { #name }
classVariables: { }
category: 'People'
name
^ name
name: anObject
name := anObject
metalink installation & trigger
ml := MetaLink new
arguments: #(object newValue);
control: #after;
metaObject: [ :object :newValue |
1halt.
];
selector: #value:value:.
(Person>>#name:) ast assignmentNodes first link: ml.
"
ml uninstall
"
p := Person new.
p name: 'Me'.
Opening the rubric editor (used in the debugger) by itself
method := Person>>#name:.
(GLMCompositePresentation new with: [ :composite | |textPresentation subscription|
textPresentation := composite pharoMethod
display: [ :aMethod | aMethod sourceCode ];
smalltalkClass: method methodClass.
subscription := textPresentation
when: RubConfigurationChange
do: [ :announcer | announcer configurationBlock value: textPresentation ].
IconStyler styleText: textPresentation withAst: method ast.
textPresentation removeSubscription: subscription
])
openOn: method