<div dir="ltr">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.<div><br></div><div>Kind regards,</div><div>Jakob</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Do., 25. Juli 2019 um 11:03 Uhr schrieb Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-3772177100907487292__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Yeah, CompiledMethod >> #isDeprecated would fit nicely. :-)<div><br></div><div>Do you have an idea for extending #messageList with text attributes other than just changing it?<br><div><br></div><div>Best,</div><div>Marcel</div></div><div class="gmail-m_-3772177100907487292mb_sig"></div><blockquote class="gmail-m_-3772177100907487292history_container" type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 24.07.2019 18:46:16 schrieb Jakob Reschke <<a href="mailto:forums.jakob@resfarm.de" target="_blank">forums.jakob@resfarm.de</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="auto"><div>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.</div><div dir="auto"><br></div><div dir="auto">Kind regards,</div><div dir="auto">Jakob</div><div dir="auto"><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Rein, Patrick <<a href="mailto:Patrick.Rein@hpi.de" target="_blank">Patrick.Rein@hpi.de</a>> schrieb am Mi., 24. Juli 2019, 17:00:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">+1, thanks for adding this Marcel!<br>
<br>
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. :)<br>
<br>
Bests<br>
Patrick<br>
________________________________________<br>
From: Squeak-dev <<a href="mailto:squeak-dev-bounces@lists.squeakfoundation.org" rel="noreferrer" target="_blank">squeak-dev-bounces@lists.squeakfoundation.org</a>> on behalf of Taeumel, Marcel<br>
Sent: Wednesday, July 24, 2019 1:21:57 PM<br>
To: JOHN SARKELA via Squeak-dev<br>
Subject: Re: [squeak-dev] The Inbox: Tools-mt.856.mcz<br>
<br>
If we want this in Trunk, I would also add support to all UI themes.<br>
<br>
[cid:4e740fc8-3b77-4069-9304-6385f48d7d00]<br>
<br>
Best,<br>
Marcel<br>
<br>
Am 24.07.2019 13:18:51 schrieb <a href="mailto:commits@source.squeak.org" rel="noreferrer" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" rel="noreferrer" target="_blank">commits@source.squeak.org</a>>:<br>
<br>
A new version of Tools was added to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Tools-mt.856.mcz" rel="noreferrer noreferrer" target="_blank">http://source.squeak.org/inbox/Tools-mt.856.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-mt.856<br>
Author: mt<br>
Time: 24 July 2019, 1:18:41.968109 pm<br>
UUID: 49d7ca18-63b6-4870-acaf-a44ec7c91b84<br>
Ancestors: Tools-mt.855<br>
<br>
In the system browser's message list, show deprecated methods gray and struck-out when all message are listed.<br>
<br>
=============== Diff against Tools-mt.855 ===============<br>
<br>
Item was changed:<br>
----- Method: Browser>>messageList (in category 'message list') -----<br>
messageList<br>
+ "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."<br>
+<br>
- "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."<br>
- | sel |<br>
- (sel := self messageCategoryListSelection) ifNil:<br>
- [<br>
- ^ self classOrMetaClassOrganizer<br>
- ifNil: [Array new]<br>
- ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]<br>
- "^ Array new"<br>
- ].<br>
<br>
+ ^ (self selectedMessageCategoryName isNil or: [self selectedMessageCategoryName = ClassOrganizer allCategory])<br>
+ ifTrue: [<br>
+ self classOrMetaClassOrganizer<br>
+ ifNil: [Array new]<br>
+ ifNotNil: [:organizer | organizer allMethodSelectors collect: [:ea |<br>
+ | method |<br>
+ ea = #messageList ifTrue: [ea] ifFalse: [<br>
+ method := self selectedClassOrMetaClass compiledMethodAt: ea.<br>
+ ((method hasLiteral: #deprecated scanForSpecial: false)<br>
+ or: [method hasLiteral: #deprecated: scanForSpecial: false])<br>
+ ifTrue: [ea asText<br>
+ addAttribute: (TextColor color: Color gray);<br>
+ addAttribute: TextEmphasis struckOut;<br>
+ yourself]<br>
+ ifFalse: [ea]]]]]<br>
+ ifFalse: [<br>
+ (self classOrMetaClassOrganizer listAtCategoryNamed: self selectedMessageCategoryName)<br>
+ ifNil: [Array new]]!<br>
- ^ sel = ClassOrganizer allCategory<br>
- ifTrue:<br>
- [self classOrMetaClassOrganizer<br>
- ifNil: [Array new]<br>
- ifNotNil: [self classOrMetaClassOrganizer allMethodSelectors]]<br>
- ifFalse:<br>
- [(self classOrMetaClassOrganizer listAtCategoryNamed: self selectedMessageCategoryName )<br>
- ifNil: [selectedMessageCategoryName := nil. Array new]]!<br>
<br>
<br>
<br>
</blockquote></div></div></div>
</div></blockquote>
                                        </div></div><br>
</blockquote></div>