[squeak-dev] The Trunk: System-mt.1381.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 16 14:35:44 UTC 2023


Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1381.mcz

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

Name: System-mt.1381
Author: mt
Time: 16 January 2023, 3:35:43.427631 pm
UUID: 74e40b35-7b6e-464b-a1dc-562379619afc
Ancestors: System-tpr.1380

Adds query to browse all methods that are organized in a category token such as 'accessing' matching also the category 'accessing - ui'. The existing protocol was for exact matches only.

Note that I did not complement ClassDescription >> #methodsInCategory: because I think this is for interactive tooling only. #methodsInCategory:, on the other hand, is also used for things that should be guarded via pragmas, I think.

Feel free to polish this. I did not see a need for "local-to" package or class interfaces. I wanted to browse "tests" or "testing" or "macpal" or "camp smalltalk" in the entire system.

=============== Diff against System-tpr.1380 ===============

Item was changed:
+ ----- Method: SystemNavigation>>allMethodsInCategory: (in category 'query') -----
- ----- Method: SystemNavigation>>allMethodsInCategory: (in category 'browse') -----
  allMethodsInCategory: category 
  	| aCollection |
  	aCollection := OrderedCollection new.
  	Cursor wait showWhile:
  		[self allBehaviorsDo:
  			[:x | (x methodsInCategory: category) do:
  				[:sel | aCollection add: x name , ' ' , sel]]].
  	^aCollection sort!

Item was added:
+ ----- Method: SystemNavigation>>allMethodsInCategoryToken: (in category 'query') -----
+ allMethodsInCategoryToken: aToken
+ 	"Answer all methods whose message category (or protocol) includes aToken. Case sensitive. For example, the token 'accessing' matches also 'accessing - ui'. Includes extension methods. See #allMethodsInCategory: for exact matches." 
+ 
+ 	| aCollection |
+ 	aCollection := OrderedCollection new.
+ 
+ 	SystemNavigation default allBehaviorsDo: [:b |
+ 		b organization categories
+ 			select: [:cat | cat includesSubstring: aToken]
+ 			thenDo: [:cat | (b organization listAtCategoryNamed: cat)
+ 				do: [:sel | aCollection add: b name, ' ', sel ] ] ].
+ 		
+ 	^ aCollection sort!

Item was changed:
+ ----- Method: SystemNavigation>>allMethodsWithString:matchCase: (in category 'query') -----
- ----- Method: SystemNavigation>>allMethodsWithString:matchCase: (in category 'browse') -----
  allMethodsWithString: aString matchCase: caseSensitive
  	"Answer a set of MdethodReferences for all methods that contain string literals with aString as a substring.
  	 Make the search case-sensitive or insensitive as dictated by the caseSensitive boolean parameter."
  
  	^self allMethodsSelect:
  		[ :method | | selector messages |
  		method hasLiteralSuchThat:
  			[ :literal |
  			 literal isString
  			 and: [ (literal includesSubstring: aString caseSensitive: caseSensitive)
  			 and: [ literal isSymbol
  					ifFalse: [ true ]
  					ifTrue:
  						[((selector ifNil: [ selector := method selector ]) == literal 
  						  or: [ (messages ifNil: [ messages := method messages ]) includes: literal ]) not ] ] ] ] ]!

Item was added:
+ ----- Method: SystemNavigation>>browseAllMethodsInCategoryToken: (in category 'browse') -----
+ browseAllMethodsInCategoryToken: aToken
+ 
+ 	^ self	
+ 		browseMessageList: (self allMethodsInCategoryToken: aToken)
+ 		name: '*', aToken, '*'!



More information about the Squeak-dev mailing list