pharo icon indicating copy to clipboard operation
pharo copied to clipboard

BreakPoint MUST NOT refer to UIManager

Open Ducasse opened this issue 7 months ago • 7 comments

requestConditionBlock
	| script |
	script := 'true'.
	script := UIManager default
		request: 'This expression will be evaluated in the context of the position of this breakpoint.
		You can use variables, globals, `thisContext`, `self` and `super`.
		`:=` and Pool variables are not supported`'
		initialAnswer: script
		title: 'Break on what condition?'.
	script isEmptyOrNil ifTrue: [ CmdCommandAborted signal ].
	^ self generateConditionBlockFrom: script

Ducasse avatar Nov 19 '23 09:11 Ducasse

I will have a look at this in the next two weeks

StevenCostiou avatar Dec 11 '23 07:12 StevenCostiou

There is no way of fixing that one right now. That code is called only from Calypso, and until it is not migrated to spec, it remains in its standalone bubble.

From there, what can we do:

  • move the code to Calypso as extension methods (and it belongs there until any other tools requires it)
  • wait that Calypso can use the spec API to request information
  • copy paste the code in UIManager to remove access to the UIManager until Calypso is Spec'd

StevenCostiou avatar Dec 12 '23 10:12 StevenCostiou

I wand to understand more in depth: does it need:

  • not to refer to UIManager ? OR
  • not to use UIManager

If we just don't want to refer to UIManager, we could just use the method #uiManager defined on Object, right?

adri09070 avatar Jan 15 '24 15:01 adri09070

The end goal is to remove UIManager from Pharo. So should not use UIManager

jecisc avatar Jan 15 '24 16:01 jecisc

It should use the application of the presenter. An StApplication has dialogs shortcuts for inform request.... Ask me if you need more information.

Ducasse avatar Jan 16 '24 12:01 Ducasse

The problem is that from Calypso, there is no presenter and thus no application. Calypso is the only place in the system where breakpoints have a dependency to UIManager.

StevenCostiou avatar Jan 16 '24 13:01 StevenCostiou

What we should do is to have all the code using an application and in Calypso we introduce the methods application tyhat return StPharoApplication default

Like that we migrate to Spec then we will just have to remove/use another method.

Ducasse avatar Jan 16 '24 14:01 Ducasse