[squeak-dev] The Inbox: Tools-mt.856.mcz

Jakob Reschke forums.jakob at resfarm.de
Mon Jul 29 20:13:42 UTC 2019


I can imagine some overly flexible solutions to plug in formatters there...
but to not over-engineer this I suppose it is best to just separate the
collection of the list items (messageList) from formatting one
(formatSelectorForMessageList: ?). So extract much of that collect block
into its own method. CompiledMethod>>isDeprecated would work towards
keeping that new method easy to read as well.

Kind regards,
Jakob

Am Do., 25. Juli 2019 um 11:03 Uhr schrieb Marcel Taeumel <
marcel.taeumel at hpi.de>:

> Yeah, CompiledMethod >> #isDeprecated would fit nicely. :-)
>
> Do you have an idea for extending #messageList with text attributes other
> than just changing it?
>
> Best,
> Marcel
>
> Am 24.07.2019 18:46:16 schrieb Jakob Reschke <forums.jakob at resfarm.de>:
> I like the addition but would advise not to clutter #messageList. Can we
> open this method for extension without modification? And as an intermediate
> step, extract the deprecated handling into another method.
>
> Kind regards,
> Jakob
>
>
> Rein, Patrick <Patrick.Rein at hpi.de> schrieb am Mi., 24. Juli 2019, 17:00:
>
>> +1, thanks for adding this Marcel!
>>
>> I think this could improve long-term code quality as it becomes clearer
>> which methods are only there for compatibility reasons and should actually
>> not be used actively. :)
>>
>> Bests
>> Patrick
>> ________________________________________
>> From: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> on
>> behalf of Taeumel, Marcel
>> Sent: Wednesday, July 24, 2019 1:21:57 PM
>> To: JOHN SARKELA via Squeak-dev
>> Subject: Re: [squeak-dev] The Inbox: Tools-mt.856.mcz
>>
>> If we want this in Trunk, I would also add support to all UI themes.
>>
>> [cid:4e740fc8-3b77-4069-9304-6385f48d7d00]
>>
>> Best,
>> Marcel
>>
>> Am 24.07.2019 13:18:51 schrieb commits at source.squeak.org <
>> commits at source.squeak.org>:
>>
>> A new version of Tools was added to project The Inbox:
>> http://source.squeak.org/inbox/Tools-mt.856.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Tools-mt.856
>> Author: mt
>> Time: 24 July 2019, 1:18:41.968109 pm
>> UUID: 49d7ca18-63b6-4870-acaf-a44ec7c91b84
>> Ancestors: Tools-mt.855
>>
>> In the system browser's message list, show deprecated methods gray and
>> struck-out when all message are listed.
>>
>> =============== Diff against Tools-mt.855 ===============
>>
>> Item was changed:
>> ----- Method: Browser>>messageList (in category 'message list') -----
>> messageList
>> + "Answer an Array of the message selectors of the currently selected
>> message category. If no category is selected or the '-- all --' category is
>> selected, return all method selectors. Make deprecated messages look gray
>> and struck-out."
>> +
>> - "Answer an Array of the message selectors of the currently selected
>> message category, provided that the messageCategoryListIndex is in proper
>> range. Otherwise, answer an empty Array If messageCategoryListIndex is
>> found to be larger than the number of categories (it happens!!), it is
>> reset to zero."
>> - | sel |
>> - (sel := self messageCategoryListSelection) ifNil:
>> - [
>> - ^ self classOrMetaClassOrganizer
>> - ifNil: [Array new]
>> - ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]
>> - "^ Array new"
>> - ].
>>
>> + ^ (self selectedMessageCategoryName isNil or: [self
>> selectedMessageCategoryName = ClassOrganizer allCategory])
>> + ifTrue: [
>> + self classOrMetaClassOrganizer
>> + ifNil: [Array new]
>> + ifNotNil: [:organizer | organizer allMethodSelectors collect: [:ea |
>> + | method |
>> + ea = #messageList ifTrue: [ea] ifFalse: [
>> + method := self selectedClassOrMetaClass compiledMethodAt: ea.
>> + ((method hasLiteral: #deprecated scanForSpecial: false)
>> + or: [method hasLiteral: #deprecated: scanForSpecial: false])
>> + ifTrue: [ea asText
>> + addAttribute: (TextColor color: Color gray);
>> + addAttribute: TextEmphasis struckOut;
>> + yourself]
>> + ifFalse: [ea]]]]]
>> + ifFalse: [
>> + (self classOrMetaClassOrganizer listAtCategoryNamed: self
>> selectedMessageCategoryName)
>> + ifNil: [Array new]]!
>> - ^ sel = ClassOrganizer allCategory
>> - ifTrue:
>> - [self classOrMetaClassOrganizer
>> - ifNil: [Array new]
>> - ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]]
>> - ifFalse:
>> - [(self classOrMetaClassOrganizer listAtCategoryNamed: self
>> selectedMessageCategoryName )
>> - ifNil: [selectedMessageCategoryName := nil. Array new]]!
>>
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190729/0ad9503e/attachment.html>


More information about the Squeak-dev mailing list