[squeak-dev] The Inbox: Tools-jr.971.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Jun 5 23:58:56 UTC 2020


A new version of Tools was added to project The Inbox:
http://source.squeak.org/inbox/Tools-jr.971.mcz

==================== Summary ====================

Name: Tools-jr.971
Author: jr
Time: 6 June 2020, 1:58:53.790886 am
UUID: 661323c2-5bca-bb46-8e68-0a14e67db386
Ancestors: Tools-mt.970

Fix some cases of browsing classes in other environments.

When selecting a class that is home to another environment, but does not exist in the default environment, its definition was not shown because hasClassSelected answered false.

Defining new classes from the hierarchy browser did not put that class in the environment of the central class if the latter was not home to the default environment.

"Revert to previous version" affected the method of the class with the same name in the default environment, rather than the currently selected method if it was in another environment.

=============== Diff against Tools-mt.970 ===============

Item was changed:
  ----- Method: Browser>>hasClassSelected (in category 'class list') -----
  hasClassSelected
+ 	^ selectedClassName notNil and: [(self selectedEnvironment classNamed: selectedClassName) notNil]!
- 	^ selectedClassName notNil and: [(Smalltalk classNamed: selectedClassName) notNil]!

Item was added:
+ ----- Method: HierarchyBrowser>>selectedEnvironment (in category 'system category list') -----
+ selectedEnvironment
+ 	"Answer the browsed environment. If this returned a system category dependent
+ 	value and possibly nil (as it did in previous versions), selectedClass would not work in
+ 	a hierarchy browser that has to display classes from different environments
+ 	(because the correct categories might be missing in the browser)"
+ 
+ 	^ environment ifNil: [centralClass environment]!

Item was changed:
  ----- Method: StringHolder>>revertToPreviousVersion (in category '*Tools') -----
  revertToPreviousVersion
  	"Revert to the previous version of the current method"
  	| aClass aSelector  changeRecords |
  	self okToChange ifFalse: [^ self].
  	aClass := self selectedClassOrMetaClass.
  	aClass ifNil: [^ self changed: #flash].
  	aSelector := self selectedMessageName.
  	changeRecords := aClass changeRecordsAt: aSelector.
  	(changeRecords == nil or: [changeRecords size <= 1]) ifTrue: [self changed: #flash.  ^ Beeper beep].
+ 	changeRecords second fileIn: self selectedEnvironment.
- 	changeRecords second fileIn.
  	self contentsChanged
  !



More information about the Squeak-dev mailing list