Nicolas Cellier uploaded a new version of Collections to project The Inbox: http://source.squeak.org/inbox/Collections-nice.867.mcz
==================== Summary ====================
Name: Collections-nice.867 Author: nice Time: 27 December 2019, 10:29:53.018596 pm UUID: d3b5ceb3-62ab-4f61-a9a3-dd757041b47f Ancestors: Collections-mt.866
Fix sendersOfIt for searching senders of an expression including a literal (byte) array
If you select following text
preference: 'Send Mouse Wheel Events to Keyboard Focus' categoryList: #(Morphic keyboard mouse) description: 'If enabled, follow the behavior known from Microsoft Windows, where the mouse wheel works for the widget that has the keyboard focus. If disabled, follow the Mac OS style, where the mouse wheel is send to the widget under the mouse position' type: #Boolean and browse senders, then if search for senders of #preference: instead of the whole keyword
This is because '#(Morphic keyboard mouse)' was replaced with '#aSymbol keyboard mouse)'
=============== Diff against Collections-mt.866 ===============
Item was changed: ----- Method: String>>findSelector (in category 'converting') ----- findSelector "Dan's code for hunting down selectors with keyword parts; while this doesn't give a true parse, in most cases it does what we want, in where it doesn't, we're none the worse for it." | sel possibleParens | sel := self withBlanksTrimmed. (sel includes: $:) ifTrue: [sel := sel copyWithRegex: '''[^'']*''' matchesReplacedWith: '''a string'''. + sel := sel copyWithRegex: '#[^[(\s.$]*' matchesReplacedWith: '#aSymbol'. - sel := sel copyWithRegex: '#[^\s.$]*' matchesReplacedWith: '#aSymbol'. sel := sel copyReplaceAll: ':' with: ': '. "for the style (aa max:bb) with no space" sel := sel copyReplaceAll: '[:' with: '[ :'. "for the style ([:a) with no space" possibleParens := sel substrings. sel := self class streamContents: [:s | | level | level := 0. possibleParens do: [:token | (level = 0 and: [token endsWith: ':']) ifTrue: [s nextPutAll: token] ifFalse: [level := level + (token occurrencesOf: $() - (token occurrencesOf: $)) + (token occurrencesOf: $[) - (token occurrencesOf: $]) + (token occurrencesOf: ${) - (token occurrencesOf: $})]]]] ifFalse: [sel := self substrings ifNotEmpty: [:tokens | tokens last]]. sel ifEmpty: [^ nil]. sel first = $# ifTrue: [sel := sel allButFirst. sel ifEmpty: [^ nil]]. sel isOctetString ifTrue: [sel := sel asOctetString]. ^ Symbol lookup: sel!
That looks fun. Is this a place where we might be able to leverage Shout/refactoringbrowser stuff to do the 'proper' job?
On 2019-12-27, at 1:30 PM, commits@source.squeak.org wrote:
Nicolas Cellier uploaded a new version of Collections to project The Inbox: http://source.squeak.org/inbox/Collections-nice.867.mcz
==================== Summary ====================
Name: Collections-nice.867 Author: nice Time: 27 December 2019, 10:29:53.018596 pm UUID: d3b5ceb3-62ab-4f61-a9a3-dd757041b47f Ancestors: Collections-mt.866
Fix sendersOfIt for searching senders of an expression including a literal (byte) array
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: CLOUT: Call Long-distance On Unused Telephone
Well, selected chunk need not even to be valid Smalltalk, as long as it contains the whole selector... It can be any piece of text in a workspace. VW uses the ast, that's nice, but also restrict the possibilities.
Le sam. 28 déc. 2019 à 00:00, tim Rowledge tim@rowledge.org a écrit :
That looks fun. Is this a place where we might be able to leverage Shout/refactoringbrowser stuff to do the 'proper' job?
On 2019-12-27, at 1:30 PM, commits@source.squeak.org wrote:
Nicolas Cellier uploaded a new version of Collections to project The
Inbox:
http://source.squeak.org/inbox/Collections-nice.867.mcz
==================== Summary ====================
Name: Collections-nice.867 Author: nice Time: 27 December 2019, 10:29:53.018596 pm UUID: d3b5ceb3-62ab-4f61-a9a3-dd757041b47f Ancestors: Collections-mt.866
Fix sendersOfIt for searching senders of an expression including a
literal (byte) array
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: CLOUT: Call Long-distance On Unused Telephone
+1
Could you also update StringTest >> #testFindSelector?
Best, Marcel Am 27.12.2019 22:30:08 schrieb commits@source.squeak.org commits@source.squeak.org: Nicolas Cellier uploaded a new version of Collections to project The Inbox: http://source.squeak.org/inbox/Collections-nice.867.mcz
==================== Summary ====================
Name: Collections-nice.867 Author: nice Time: 27 December 2019, 10:29:53.018596 pm UUID: d3b5ceb3-62ab-4f61-a9a3-dd757041b47f Ancestors: Collections-mt.866
Fix sendersOfIt for searching senders of an expression including a literal (byte) array
If you select following text
preference: 'Send Mouse Wheel Events to Keyboard Focus' categoryList: #(Morphic keyboard mouse) description: 'If enabled, follow the behavior known from Microsoft Windows, where the mouse wheel works for the widget that has the keyboard focus. If disabled, follow the Mac OS style, where the mouse wheel is send to the widget under the mouse position' type: #Boolean
and browse senders, then if search for senders of #preference: instead of the whole keyword
This is because '#(Morphic keyboard mouse)' was replaced with '#aSymbol keyboard mouse)'
=============== Diff against Collections-mt.866 ===============
Item was changed: ----- Method: String>>findSelector (in category 'converting') ----- findSelector "Dan's code for hunting down selectors with keyword parts; while this doesn't give a true parse, in most cases it does what we want, in where it doesn't, we're none the worse for it." | sel possibleParens | sel := self withBlanksTrimmed. (sel includes: $:) ifTrue: [sel := sel copyWithRegex: '''[^'']*''' matchesReplacedWith: '''a string'''. + sel := sel copyWithRegex: '#[^[(\s.$]*' matchesReplacedWith: '#aSymbol'. - sel := sel copyWithRegex: '#[^\s.$]*' matchesReplacedWith: '#aSymbol'. sel := sel copyReplaceAll: ':' with: ': '. "for the style (aa max:bb) with no space" sel := sel copyReplaceAll: '[:' with: '[ :'. "for the style ([:a) with no space" possibleParens := sel substrings. sel := self class streamContents: [:s | | level | level := 0. possibleParens do: [:token | (level = 0 and: [token endsWith: ':']) ifTrue: [s nextPutAll: token] ifFalse: [level := level + (token occurrencesOf: $() - (token occurrencesOf: $)) + (token occurrencesOf: $[) - (token occurrencesOf: $]) + (token occurrencesOf: ${) - (token occurrencesOf: $})]]]] ifFalse: [sel := self substrings ifNotEmpty: [:tokens | tokens last]]. sel ifEmpty: [^ nil]. sel first = $# ifTrue: [sel := sel allButFirst. sel ifEmpty: [^ nil]]. sel isOctetString ifTrue: [sel := sel asOctetString]. ^ Symbol lookup: sel!
squeak-dev@lists.squeakfoundation.org