[squeak-dev] The Trunk: Tools-eem.1168.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Jul 13 23:29:56 UTC 2022


Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1168.mcz

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

Name: Tools-eem.1168
Author: eem
Time: 13 July 2022, 4:29:53.654209 pm
UUID: 3ce13884-de6d-4e9d-8ada-6eca4fd59835
Ancestors: Tools-eem.1167

Refactor selectMethodsForThisClass & selectSuchThat: so that any of selectMethodsForThisClass, selectMethodsForExtantClasses, & selectContentsMatching can extend selections via the shift key.

=============== Diff against Tools-eem.1167 ===============

Item was changed:
  ----- Method: ChangeList>>mainChangeListMenu: (in category 'menu actions') -----
  mainChangeListMenu: aMenu
  	"Fill aMenu up so that it comprises the primary changelist-browser menu"
  	<changeListMenu>
  
  	aMenu addTitle: 'change list' translated.
  	aMenu addStayUpItemSpecial.
  
  	aMenu addTranslatedList: #(
  
  	('fileIn selections'							fileInSelections						'import the selected items into the image')
  	('fileOut selections...'						fileOutSelections						'create a new file containing the selected items')
  	-
  	('compare to current'						compareToCurrentVersion			'open a separate window which shows the text differences between the on-file version and the in-image version.' )
  	('toggle diffing (D)'							toggleDiffing						'start or stop showing diffs in the code pane.')
  	-
  	('select conflicts with any changeset'		selectAllConflicts					'select methods in the file which also occur in any change-set in the system')
  	('select conflicts with current changeset'	selectConflicts						'select methods in the file which also occur in the current change-set')
  	('select conflicts with...'						selectConflictsWith					'allows you to designate a file or change-set against which to check for code conflicts.')
  	-
  	('select unchanged definitions'				selectUnchangedDefinitions			'select class definitions, class comments and methods in the file whose in-image versions are the same as their in-file counterparts' )
  	('select unchanged methods'					selectUnchangedMethods				'select methods in the file whose in-image versions are the same as their in-file counterparts' )
  	('select new methods'						selectNewMethods					'select methods in the file that do not current occur in the image')
+ 	('select methods for this class'				selectMethodsForThisClass			'select all methods in the file that belong to the currently-selected class\(shift to extend selections)')
+ 	('select methods for extant classes'			selectMethodsForExtantClasses		'select all methods in the file that belong to a class that exists in the image\(shift to extend selections)')
+ 	('select changes with contents matching'		selectContentsMatching				'select all changes in the file whose text includes a pattern\(shift to extend selections)')
- 	('select methods for this class'				selectMethodsForThisClass			'select all methods in the file that belong to the currently-selected class')
- 	('select methods for extant classes'			selectMethodsForExtantClasses		'select all methods in the file that belong to a class that exists in the image')
- 	('select changes with contents matching'		selectContentsMatching				'select all changes in the file whose text includes a pattern')
  
  	-
  	('select all (a)'								selectAll								'select all the items in the list')
  	('deselect all'								deselectAll							'deselect all the items in the list')
  	('invert selections'							invertSelections						'select every item that is not currently selected, and deselect every item that *is* currently selected')
  	('select all before'							selectAllBefore							'select every item before the current selection')
  	-
  	('browse all versions of single selection'			browseVersions		'open a version browser showing the versions of the currently selected method')
  	('browse all versions of selections'			browseAllVersionsOfSelections		'open a version browser showing all the versions of all the selected methods')
  	('browse current versions of selections'		browseCurrentVersionsOfSelections	'open a message-list browser showing the current (in-image) counterparts of the selected methods')
  	('destroy current methods of selections'		destroyCurrentCodeOfSelections		'remove (*destroy*) the in-image counterparts of all selected methods')
  	-
  	('remove doIts'								removeDoIts							'remove all items that are doIts rather than methods')
  	('remove older versions'						removeOlderMethodVersions			'remove all but the most recent versions of methods in the list')
  	('remove up-to-date versions'				removeExistingMethodVersions		'remove all items whose code is the same as the counterpart in-image code')
  	('remove selected items'						removeSelections					'remove the selected items from the change-list')
  	('remove unselected items'					removeNonSelections					'remove all the items not currently selected from the change-list')).
  
  	^ aMenu!

Item was changed:
  ----- Method: ChangeList>>selectMethodsForThisClass (in category 'menu actions') -----
  selectMethodsForThisClass
+ 	| name |
  	self currentChange ifNil: [ ^self ].
+ 	name := self currentChange methodClassName.
+ 	name ifNil: [ ^self ].
+ 	^self selectSuchThat: [ :change |
+ 		change methodClassName = name ].!
- 	self currentChange methodClassName ifNotNil:
- 		[:name|
- 		self selectSuchThat:
- 			(Sensor leftShiftDown
- 				ifTrue: [[:change :index| (listSelections at: index) or: [change methodClassName = name]]]
- 				ifFalse: [[:change| change methodClassName = name]])]!

Item was changed:
  ----- Method: ChangeList>>selectSuchThat: (in category 'menu actions') -----
  selectSuchThat: aBlock
+ 	"Select all changes for which block returns true.
+ 	 If the shift key is down then extend the selections with those for which block returns true."
+ 	listSelections := Sensor leftShiftDown
+ 						ifTrue:
+ 							[changeList withIndexCollect: (aBlock numArgs = 2
+ 								ifTrue: [[:change :index| (listSelections at: index) or: [aBlock value: change value: index]]]
+ 								ifFalse: [[:change :index| (listSelections at: index) or: [aBlock value: change]]])]
+ 						ifFalse:
+ 							[aBlock numArgs = 2
+ 								ifTrue: [changeList withIndexCollect: aBlock]
+ 								ifFalse: [changeList collect: aBlock]].
- 	"select all changes for which block returns true"
- 	listSelections := aBlock numArgs = 2
- 						ifTrue: [changeList withIndexCollect: aBlock]
- 						ifFalse: [changeList collect: aBlock].
  	self changed: #allSelections!



More information about the Squeak-dev mailing list