do-it or inspect-it in the spotter search bar?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

do-it or inspect-it in the spotter search bar?

Paul DeBruicker
I was feeling lazy was wondered if it would be possible to hit Cmd-D or Cmd-I in the spotter input field rather than opening a playground and typing something in then hitting it.  E.g.


1 + 1  Cmd-I

would open an inspector on the number 2


After looking at GTSpotter>>#spotterFor... methods I couldn't figure out how to make it happen in the half hour I had to spend on it.  


I recognize opening the playground is Cmd-O Cmd-W but I just open the spotter ~50x as often as a new playground so the muscle memory isn't there.  If I could do quick one-liners in the spotter then the playground would get opened even less often.  










Reply | Threaded
Open this post in threaded view
|

Re: do-it or inspect-it in the spotter search bar?

Richard Sargent
Administrator
Paul, 

That's an excellent suggestion. Wherever one can type text, one should be able to do text operations on it. And wherever one can type code, one should be able to do code operations on it.

(And, for completeness, one should be able to do a subset of each wherever text and code are displayed.)



On Sat, Jun 30, 2018, 16:28 PAUL DEBRUICKER <[hidden email]> wrote:
I was feeling lazy was wondered if it would be possible to hit Cmd-D or Cmd-I in the spotter input field rather than opening a playground and typing something in then hitting it.  E.g.


1 + 1  Cmd-I

would open an inspector on the number 2


After looking at GTSpotter>>#spotterFor... methods I couldn't figure out how to make it happen in the half hour I had to spend on it.   


I recognize opening the playground is Cmd-O Cmd-W but I just open the spotter ~50x as often as a new playground so the muscle memory isn't there.  If I could do quick one-liners in the spotter then the playground would get opened even less often. 










Reply | Threaded
Open this post in threaded view
|

Re: do-it or inspect-it in the spotter search bar?

Sven Van Caekenberghe-2
In reply to this post by Paul DeBruicker


> On 1 Jul 2018, at 01:28, PAUL DEBRUICKER <[hidden email]> wrote:
>
> I was feeling lazy was wondered if it would be possible to hit Cmd-D or Cmd-I in the spotter input field rather than opening a playground and typing something in then hitting it.  E.g.
>
>
> 1 + 1  Cmd-I
>
> would open an inspector on the number 2
>
>
> After looking at GTSpotter>>#spotterFor... methods I couldn't figure out how to make it happen in the half hour I had to spend on it.  
>
>
> I recognize opening the playground is Cmd-O Cmd-W but I just open the spotter ~50x as often as a new playground so the muscle memory isn't there.  If I could do quick one-liners in the spotter then the playground would get opened even less often.  

In Pharo 7 you can actually use Spotter for calculations:

  Cmd-Enter 1 + 2

gives you #Calculator 3

Even 42 factorial works.

It does not seem to work for general evaluation though ...

The tools that we had before Spotter did actually allow that.
Reply | Threaded
Open this post in threaded view
|

Re: do-it or inspect-it in the spotter search bar?

Paul DeBruicker
In reply to this post by Paul DeBruicker
I had time today to implement this.  The attached mczs, in pharo 6.1, allow
you to hit Cmd-i to inspect or cmd-d to do it.


You can test by loading the test package and typing in the spotter search
bar,


GTCounter increaseValue


then hitting Cmd-d several times then Cmd-i to see what value you ended on.



To implement I edited the GTSpotterMorph>>bindingDictionnary to look for and
act cmd-i and cmd-d



GT-Spotter-PaulDeBruicker.mcz
<http://forum.world.st/file/t94460/GT-Spotter-PaulDeBruicker.mcz>  
GT-Tests-Spotter-PaulDeBruicker.mcz
<http://forum.world.st/file/t94460/GT-Tests-Spotter-PaulDeBruicker.mcz>  


Paul DeBruicker wrote

> I was feeling lazy was wondered if it would be possible to hit Cmd-D or
> Cmd-I in the spotter input field rather than opening a playground and
> typing something in then hitting it.  E.g.
>
>
> 1 + 1  Cmd-I
>
> would open an inspector on the number 2
>
>
> After looking at GTSpotter>>#spotterFor... methods I couldn't figure out
> how to make it happen in the half hour I had to spend on it.  
>
>
> I recognize opening the playground is Cmd-O Cmd-W but I just open the
> spotter ~50x as often as a new playground so the muscle memory isn't
> there.  If I could do quick one-liners in the spotter then the playground
> would get opened even less often.





--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html