From 8214f420dfe0e47efb2f498df7ab41e8d5008f39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Blizni=C4=8Denko?= Date: Mon, 11 Dec 2023 17:48:31 +0100 Subject: [PATCH] implemented Profile It command --- .../SpCodeProfileItCommand.class.st | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Spec2-Code-Commands/SpCodeProfileItCommand.class.st b/src/Spec2-Code-Commands/SpCodeProfileItCommand.class.st index 9f12893b..cfa261a4 100644 --- a/src/Spec2-Code-Commands/SpCodeProfileItCommand.class.st +++ b/src/Spec2-Code-Commands/SpCodeProfileItCommand.class.st @@ -5,9 +5,9 @@ I will evalute the selection (or line) of the playground using a profiler. Class { #name : 'SpCodeProfileItCommand', #superclass : 'SpCodeSelectionCommand', - #category : 'Spec2-Code-Commands-TODO', + #category : 'Spec2-Code-Commands-Base', #package : 'Spec2-Code-Commands', - #tag : 'TODO' + #tag : 'Base' } { #category : 'defaults' } @@ -25,5 +25,15 @@ SpCodeProfileItCommand class >> defaultName [ { #category : 'execution' } SpCodeProfileItCommand >> execute [ - self flag: 'TODO' + | selection | + selection := self selectedTextOrLine. + selection trimBoth ifEmpty: [ ^ self ]. + + self profilerPresenterClass profileCode: selection +] + +{ #category : 'constants' } +SpCodeProfileItCommand >> profilerPresenterClass [ + + ^ ProfilerPresenter ]