From 84abab0af1dc8d60e7fc5b52a80ed5187218951f Mon Sep 17 00:00:00 2001 From: Ignacio Losiggio Date: Mon, 4 Nov 2024 11:05:55 +0100 Subject: [PATCH] Add CompiledBlock>>#browse and BlockClosure>>#browse --- src/Tools/BlockClosure.extension.st | 7 +++++++ src/Tools/CompiledBlock.extension.st | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/Tools/BlockClosure.extension.st create mode 100644 src/Tools/CompiledBlock.extension.st diff --git a/src/Tools/BlockClosure.extension.st b/src/Tools/BlockClosure.extension.st new file mode 100644 index 00000000000..669708bd600 --- /dev/null +++ b/src/Tools/BlockClosure.extension.st @@ -0,0 +1,7 @@ +Extension { #name : 'BlockClosure' } + +{ #category : '*Tools' } +BlockClosure >> browse [ + + ^ compiledBlock browse +] diff --git a/src/Tools/CompiledBlock.extension.st b/src/Tools/CompiledBlock.extension.st new file mode 100644 index 00000000000..be63b109343 --- /dev/null +++ b/src/Tools/CompiledBlock.extension.st @@ -0,0 +1,20 @@ +Extension { #name : 'CompiledBlock' } + +{ #category : '*Tools' } +CompiledBlock >> browse [ + | method | + + method := self method. + + method isInstalled + ifTrue: [ + ^ Smalltalk tools browser + openOnClass: self methodClass + selector: self selector + highlight: self sourceNode sourceCode ] + ifFalse: [ + ^ Smalltalk tools browser + openOnClass: self methodClass + selector: self selector ] + +]