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]]! |
If we want this in Trunk, I would also add support to all UI themes. Best, Marcel
|
+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 <[hidden email]> 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 [hidden email] <[hidden email]>: 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]]! |
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 <[hidden email]> schrieb am Mi., 24. Juli 2019, 17:00: +1, thanks for adding this Marcel! |
Yeah, CompiledMethod >> #isDeprecated would fit nicely. :-) Do you have an idea for extending #messageList with text attributes other than just changing it? Best, Marcel
|
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 <[hidden email]>:
|
In reply to this post by marcel.taeumel
Pretty cool enhancement to the IDE, and a useful indicator. +1 PS -- Marcel, is there possibility of indicating an /overridden method/ using some style too? I'm thinking "bold" (e.g. blacker (would require making other entries slightly lighter in the theme)) -- ? On Wed, Jul 24, 2019 at 6:22 AM Marcel Taeumel <[hidden email]> wrote:
|
Hi Chris, Am Mo., 29. Juli 2019 um 22:38 Uhr schrieb Chris Muller <[hidden email]>:
Don't the arrows suffice? Kind regards, Jakob image.png (85K) Download Attachment |
> On 2019-07-29, at 2:08 PM, Jakob Reschke <[hidden email]> wrote: > > > Don't the arrows suffice? Y'know, I'd never looked at those before... good stuff. tim -- tim Rowledge; [hidden email]; http://www.rowledge.org/tim Disclaimer: Any errors in spelling, tact, or fact are transmission errors. |
In reply to this post by Jakob Reschke
Oh! Yes, I forgot all about those. Please ignore that PS. :) On Mon, Jul 29, 2019 at 4:09 PM Jakob Reschke <[hidden email]> wrote:
|
Hi, great idea! Two thoughts:
1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even detected as deprecated :) 2. Would it be worth a thought to also style classes and all their methods as deprecated, which are in *Deprecated* categories? For example, when browsing through a MessageTrace, I think it could be helpful to see which methods are no longer relevant - for the same reason as Patrick mentioned. Best, Christoph -- Sent from: http://forum.world.st/Squeak-Dev-f45488.html
Carpe Squeak!
|
Hi Christoph. > 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even > detected as deprecated :) Well, for a single case, I did not want to add an extra check that is usually false anyway. Want it to be as fast as possible. > 2. Would it be worth a thought to also style classes and all their methods > as deprecated, which are in *Deprecated* categories? For example, when > browsing through a MessageTrace, I think it could be helpful to see which > methods are no longer relevant - for the same reason as Patrick mentioned. Well, no. If those methods are missing their #deprcated explanation, take it as a chance to really deprecate those methods: (1) double-check that there are no senders (2) add "self deprecated:" (3) maybe rewrite them to use the new interface There is so much clean-up to do. ;-) Best, Marcel
|
Hi Marcel,
> > 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even
> > detected as deprecated :) > > Well, for a single case, I did not want to add an extra check that is usually false anyway. Want it to be as fast as possible. Good point :)
> Well, no. If those methods are missing their #deprcated explanation, take it as a chance to really deprecate those methods:
>
> (1) double-check that there are no senders
> (2) add "self deprecated:"
> (3) maybe rewrite them to use the new interface
>
> There is so much clean-up to do. ;-)
Christoph
Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel
Gesendet: Montag, 12. August 2019 19:19:23 An: John Pfersich via Squeak-dev Betreff: Re: [squeak-dev] The Inbox: Tools-mt.856.mcz
Hi Christoph.
> 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even
> detected as deprecated :)
Well, for a single case, I did not want to add an extra check that is usually false anyway. Want it to be as fast as possible.
> 2. Would it be worth a thought to also style classes and all their methods
> as deprecated, which are in *Deprecated* categories? For example, when > browsing through a MessageTrace, I think it could be helpful to see which > methods are no longer relevant - for the same reason as Patrick mentioned. Well, no. If those methods are missing their #deprcated explanation, take it as a chance to really deprecate those methods:
(1) double-check that there are no senders
(2) add "self deprecated:"
(3) maybe rewrite them to use the new interface
There is so much clean-up to do. ;-)
Best,
Marcel
Carpe Squeak!
|
Hi Christoph. > Just to be sure: You would like to decorate each single method of a class such as HtmlFileStream with the deprecated attribute? That's not what I meant. Just those selected deprecations in non-deprecated classes. You are referring to deprecated classes as such? That's right. We should change CodeHolder >> #formattedLabel:forSelector:inClass: to always treat methods in deprecated classes as deprecated. Not just if the selector is #Definition. :-) Best, Marcel
|
Okay, I addad that in Tools-mt.871. With the speed-up from Kernel-mt.1255, we get those results:
| msgs | msgs := Morph selectors. [msgs do: [:sel | (Morph compiledMethodAt: sel ifAbsent: [#booh]) isDeprecated]] bench '2,180 per second. 458 microseconds per run.' [msgs do: [:sel | Morph isDeprecated or: [(Morph compiledMethodAt: sel ifAbsent: [#booh]) isDeprecated]]] bench '1,670 per second. 597 microseconds per run.' Morph has 1353 selectors and that formatting is cached in tools. I think we're good. Tim, what about RasPi performance? :-) Bert, what about SqueakJS performance? ;-) Best, Marcel
|
Hi Marcel,
The current implementation of CodeHolder >> #formattedLabel:forSelector:inClass: breaks TimeProfileBrowser, which passes nil as the class argument. On Tue, 13 Aug 2019, Marcel Taeumel wrote: > Okay, I addad that in Tools-mt.871. With the speed-up from Kernel-mt.1255, we get those results: > > | msgs | > msgs := Morph selectors. > > [msgs do: [:sel | (Morph compiledMethodAt: sel ifAbsent: [#booh]) isDeprecated]] bench > '2,180 per second. 458 microseconds per run.' With some inlining, block elimination, and the use of the unicity property, the performance can be doubled by rewriting CompiledMethod >> #isDeprecated to | literal | 1 to: self numLiterals do: [:index | ((literal := self literalAt: index) == #deprecated: or: [ literal == #deprecated ]) ifTrue: [ ^true ] ]. ^ false > > [msgs do: [:sel | Morph isDeprecated or: [(Morph compiledMethodAt: sel ifAbsent: [#booh]) isDeprecated]]] bench > '1,670 per second. 597 microseconds per run.' > > Morph has 1353 selectors and that formatting is cached in tools. I think we're good. Tim, what about RasPi performance? :-) Bert, what about SqueakJS performance? ;-) I used to think SqueakJS was 2-3 magnitudes slower than Spur, but sometimes it's 4 magnitudes. By implementing the #hashMultiply primitive, and regenerating MiscPrimitivePlugin's primitives from the Spur branch, I'm sure many things would become quicker. Levente > > Best, > Marcel > > Am 13.08.2019 09:10:14 schrieb Marcel Taeumel <[hidden email]>: > > Hi Christoph. > > Just to be sure: You would like to decorate each single method of a class such as HtmlFileStream with the deprecated attribute? > > That's not what I meant. Just those selected deprecations in non-deprecated classes. You are referring to deprecated classes as such? That's right. We should change CodeHolder >> #formattedLabel:forSelector:inClass: to always treat methods in deprecated classes as deprecated. Not just if the selector is > #Definition. :-) > > Best, > Marcel > > Am 12.08.2019 19:35:35 schrieb Thiede, Christoph <[hidden email]>: > > Hi Marcel, > > > > > 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even > > > detected as deprecated :) > > > > Well, for a single case, I did not want to add an extra check that is usually false anyway. Want it to be as fast as possible. > > Good point :) > > > Well, no. If those methods are missing their #deprcated explanation, take it as a chance to really deprecate those methods: > > > > (1) double-check that there are no senders > > (2) add "self deprecated:" > > (3) maybe rewrite them to use the new interface > > > > There is so much clean-up to do. ;-) > > Just to be sure: You would like to decorate each single method of a class such as HtmlFileStream with the deprecated attribute? > > Best, Christoph > > __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ > Von: Squeak-dev <[hidden email]> im Auftrag von Taeumel, Marcel > Gesendet: Montag, 12. August 2019 19:19:23 > An: John Pfersich via Squeak-dev > Betreff: Re: [squeak-dev] The Inbox: Tools-mt.856.mcz > Hi Christoph. > > 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even > > detected as deprecated :) > > Well, for a single case, I did not want to add an extra check that is usually false anyway. Want it to be as fast as possible. > > > 2. Would it be worth a thought to also style classes and all their methods > > as deprecated, which are in *Deprecated* categories? For example, when > > browsing through a MessageTrace, I think it could be helpful to see which > > methods are no longer relevant - for the same reason as Patrick mentioned. > > Well, no. If those methods are missing their #deprcated explanation, take it as a chance to really deprecate those methods: > > (1) double-check that there are no senders > (2) add "self deprecated:" > (3) maybe rewrite them to use the new interface > > There is so much clean-up to do. ;-) > > Best, > Marcel > > Am 09.08.2019 23:24:01 schrieb Christoph Thiede <[hidden email]>: > > Hi, great idea! Two thoughts: > > 1. It's not really nice that CompiledMethod>>#isDeprecated is styled or even > detected as deprecated :) > > 2. Would it be worth a thought to also style classes and all their methods > as deprecated, which are in *Deprecated* categories? For example, when > browsing through a MessageTrace, I think it could be helpful to see which > methods are no longer relevant - for the same reason as Patrick mentioned. > > Best, > Christoph > > > > -- > Sent from: http://forum.world.st/Squeak-Dev-f45488.html > > > |
Free forum by Nabble | Edit this page |