Tony Garnock-Jones uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-tonyg.1032.mcz ==================== Summary ==================== Name: Tools-tonyg.1032 Author: tonyg Time: 24 March 2021, 4:36:27.132139 pm UUID: 1077d608-e946-49dd-99f0-3a55ffe06e81 Ancestors: Tools-mt.1031 Repair Browser to allow selection of classes in non-default Environments. =============== Diff against Tools-mt.1031 =============== Item was changed: ----- Method: Browser>>addTrait (in category 'traits') ----- addTrait | input trait | input := UIManager default request: 'add trait'. input isEmptyOrNil ifFalse: [ + trait := self environment classNamed: input. - trait := Smalltalk classNamed: input. (trait isNil or: [trait isTrait not]) ifTrue: [ ^self inform: 'Input invalid. ' , input , ' does not exist or is not a trait']. self selectedClass setTraitComposition: self selectedClass traitComposition asTraitComposition + trait. self contentsChanged]. ! Item was changed: ----- Method: Browser>>hasClassSelected (in category 'class list') ----- hasClassSelected + ^ selectedClassName notNil and: [(self environment classNamed: selectedClassName) notNil]! - ^ selectedClassName notNil and: [(Smalltalk classNamed: selectedClassName) notNil]! |
Hi all,
I've been experimenting with Environments a little. They look promising, but if I understand correctly we don't have much in the way of tool support for them yet? Would a patch to ToolSet be welcome to add, say, `browseEnvironment:` and a convenience `Environment >> browse` to the various ToolSets? It took a little digging before I found (Browser new selectEnvironment: someEnvironment) buildAndOpenFullBrowser Further than that, there seems not to be many users of Environment's class-side Instances variable yet. Is it intended to be a kind of registry of available in-image Environments? Would some thinking about how to surface those in the tooling be welcome? Tony On 3/24/21 3:36 PM, [hidden email] wrote: > Tony Garnock-Jones uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-tonyg.1032.mcz > > ==================== Summary ==================== > > Name: Tools-tonyg.1032 > Author: tonyg > Time: 24 March 2021, 4:36:27.132139 pm > UUID: 1077d608-e946-49dd-99f0-3a55ffe06e81 > Ancestors: Tools-mt.1031 > > Repair Browser to allow selection of classes in non-default Environments. > > =============== Diff against Tools-mt.1031 =============== > > Item was changed: > ----- Method: Browser>>addTrait (in category 'traits') ----- > addTrait > | input trait | > input := UIManager default request: 'add trait'. > input isEmptyOrNil ifFalse: [ > + trait := self environment classNamed: input. > - trait := Smalltalk classNamed: input. > (trait isNil or: [trait isTrait not]) ifTrue: [ > ^self inform: 'Input invalid. ' , input , ' does not exist or is not a trait']. > self selectedClass setTraitComposition: self selectedClass traitComposition asTraitComposition + trait. > self contentsChanged]. > ! > > Item was changed: > ----- Method: Browser>>hasClassSelected (in category 'class list') ----- > hasClassSelected > + ^ selectedClassName notNil and: [(self environment classNamed: selectedClassName) notNil]! > - ^ selectedClassName notNil and: [(Smalltalk classNamed: selectedClassName) notNil]! > > |
Hi Tony,
> Would a patch to ToolSet be welcome to add, say, `browseEnvironment:` and a convenience `Environment >> browse` to the various ToolSets?
To me, this looks like a useful enhancement!
> Would some thinking about how to surface those in the tooling be welcome? Definitively! Maybe we could add an item to the browser's window menu that
pops up an environment selector (basically UIManager chooseFrom... and an accessor for Environment Instances) to change the currently visible environment in a browser? How would this look like in a PackagePaneBrowser?
An important use case for Environments that I could think of would be to clone a class (hierarchy) to edit a copy of it and replacing the original class in the main environment. For example, when refactoring the Compiler ...
I think we would need much more tooling for this and probably also some tests. I don't know how well environments are being supported right now - but for example, they are not even nestable at the moment, which would be helpful for the use case I have given.
This is an interesting construction site! :-)
Best,
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Tony Garnock-Jones <[hidden email]>
Gesendet: Mittwoch, 24. März 2021 16:40:17 An: The general-purpose Squeak developers list Betreff: [squeak-dev] ToolSet and Environments (was Re: The Trunk: Tools-tonyg.1032.mcz) Hi all,
I've been experimenting with Environments a little. They look promising, but if I understand correctly we don't have much in the way of tool support for them yet? Would a patch to ToolSet be welcome to add, say, `browseEnvironment:` and a convenience `Environment >> browse` to the various ToolSets? It took a little digging before I found (Browser new selectEnvironment: someEnvironment) buildAndOpenFullBrowser Further than that, there seems not to be many users of Environment's class-side Instances variable yet. Is it intended to be a kind of registry of available in-image Environments? Would some thinking about how to surface those in the tooling be welcome? Tony On 3/24/21 3:36 PM, [hidden email] wrote: > Tony Garnock-Jones uploaded a new version of Tools to project The Trunk: > http://source.squeak.org/trunk/Tools-tonyg.1032.mcz > > ==================== Summary ==================== > > Name: Tools-tonyg.1032 > Author: tonyg > Time: 24 March 2021, 4:36:27.132139 pm > UUID: 1077d608-e946-49dd-99f0-3a55ffe06e81 > Ancestors: Tools-mt.1031 > > Repair Browser to allow selection of classes in non-default Environments. > > =============== Diff against Tools-mt.1031 =============== > > Item was changed: > ----- Method: Browser>>addTrait (in category 'traits') ----- > addTrait > | input trait | > input := UIManager default request: 'add trait'. > input isEmptyOrNil ifFalse: [ > + trait := self environment classNamed: input. > - trait := Smalltalk classNamed: input. > (trait isNil or: [trait isTrait not]) ifTrue: [ > ^self inform: 'Input invalid. ' , input , ' does not exist or is not a trait']. > self selectedClass setTraitComposition: self selectedClass traitComposition asTraitComposition + trait. > self contentsChanged]. > ! > > Item was changed: > ----- Method: Browser>>hasClassSelected (in category 'class list') ----- > hasClassSelected > + ^ selectedClassName notNil and: [(self environment classNamed: selectedClassName) notNil]! > - ^ selectedClassName notNil and: [(Smalltalk classNamed: selectedClassName) notNil]! > >
Carpe Squeak!
|
In reply to this post by Tony Garnock-Jones-5
Hi Tony.
> Is it intended to be a kind of registry of available in-image Environments? Yes, looks similar to PackageOrganizer. > Would some thinking about how to surface those in the tooling be welcome? Yes, indeed. :-) I just added ToolSet cass >> #browseEnvironment: and Environment >> #browse to Trunk. And I noticed that something seems to be missing from empty environments since I cannot compile a new class into it through the Browser. Not even "Smalltalk" as a global can be resovled -- even though it is in "declarations". Maybe Environment >> #initializeWithName: is not correct? Have fun! :-) Best, Marcel
|
Free forum by Nabble | Edit this page |