pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 355 forks source link

Kill tools registry in Smalltalk #15740

Open hernanmd opened 11 months ago

hernanmd commented 11 months ago

The Tool Registry has shortcuts to multiple common tools in the system, such as:

Smalltalk tools browser.
Smalltalk tools workspace.
Smalltalk tools fileList.

However, a shortcut to access the debugger is missing:

Smalltalk tools debugger

This is easy to add and will make accessing the debugger more consistent with other tools.

guillep commented 11 months ago

Ping @Ducasse , maybe you should sync because we should stop using Smalltalk, and thus that registry :)

jecisc commented 11 months ago

A first step could be to add a tool registry to the spec application and make sure the pharo application returns this Smalltalk tools instance

Ducasse commented 11 months ago

@hernanmd Hi hernan Smallltalk tools should be killed. We should not use a global variable. Instead StApplication should be responsible for it (if it does not have it we should introduce it).

StevenCostiou commented 11 months ago

In fact we removed Smalltalk tools debugger because it made debugger access totally inconsistent, as there were many debuggers and some of them could, if accessed through this global, actually decide to open other debuggers that were not the one returned by this global.

The other three should be killed, and instead the logic of deciding which one is the default tool should be the responsibility of the tool infrastructure.

Ducasse commented 11 months ago

Totally in sync with you :)

hernanmd commented 11 months ago

I see multiple options then to access tools:

This one used by IceTipModel, RBInteractionDriver and StPresenter.

StPharoApplication current

StPharoApplication inherits from SpApplication, so it depends of Spec.

This one accessing through Presenter used only in IceTipPresenter:

StPresenter currentApplication. "a StPharoApplication"

This one which for which we should introduce the new class to hold the registry:

StApplication

Which one do you prefer?

Ducasse commented 11 months ago

For RB I will do it.

Ducasse commented 11 months ago

You should ask esteban. In a presenter I always do self application

hernanmd commented 11 months ago

So @estebanlm do you think the tool registry should depend on Spec? If not I will introduce StApplication

estebanlm commented 11 months ago

There is already a StPharoApplication, why you need a StApplication ?

hernanmd commented 11 months ago

We're just discussing here if we should have a tool registry which depends of Spec. As I commented above, StPharoApplication means tool registry will have a Spec dependency.

So a tool registry should depend on Spec?

estebanlm commented 11 months ago

So @estebanlm do you think the tool registry should depend on Spec? If not I will introduce StApplication

And no, it should not depend on spec, it should depend on newtools which is an application of spec.

estebanlm commented 11 months ago

We're just discussing here if we should have a tool registry which depends of Spec. As I commented above, StPharoApplication means tool registry will have a Spec dependency.

So a tool registry should depend on Spec?

nope. StPharoApplication is an application of spec. Not spec itself.

estebanlm commented 11 months ago

if you see StPharoApplication, there is already a method called tools that delegates to Smalltalk tools.
The idea was eventually inverse that relation because the tools are GUI tools, hence part of the IDE, hence part of StPharoApplication

but still newtools ~= spec. So, the new tools will have a tool registry, which is a correct approach. Spec itself will not have a dependency.