<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Helvetica,sans-serif">
<p>Please note that I removed #<span>implementMissingMethod:inClass: and #<span>askForCategoryIn:default: directly instead of deprecating them (in favor of the new version with an additional #ifCancel: keyword). I think these methods are private enough, would
you agree or should we move them into a deprecation category?</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>And please let me know whether this commit has an appropriate size, I always strive for optimization :-)</span></span></p>
<p><span><span><br>
</span></span></p>
<p><span><span>Best,</span></span></p>
<p><span><span>Christoph</span></span></p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div name="x_divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von commits@source.squeak.org <commits@source.squeak.org><br>
<b>Gesendet:</b> Sonntag, 19. Januar 2020 21:56:42<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> [squeak-dev] The Inbox: Tools-ct.932.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Christoph Thiede uploaded a new version of Tools to project The Inbox:<br>
<a href="http://source.squeak.org/inbox/Tools-ct.932.mcz">http://source.squeak.org/inbox/Tools-ct.932.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Tools-ct.932<br>
Author: ct<br>
Time: 19 January 2020, 9:56:38.355545 pm<br>
UUID: cfb85c45-de2c-e641-af0f-2cec865baf48<br>
Ancestors: Tools-mt.929<br>
<br>
Minor improvements to debugger's notifier support:<br>
<br>
- Allow to cancel method creation when asked for category<br>
- Always offer defaultCategory as first choice<br>
- Fix a bug in #askForSuperclassOf:upTo:toImplement:ifCancel: (superclass was not respected*)<br>
- Improve multilingual support<br>
- Select message to implement after implementing the method (see #removeNotifierContext:)<br>
- Refactoring, deduplication<br>
<br>
*Snippet to reproduce:<br>
c1 := Object newSubclass.<br>
c1 compile: 'foo'.<br>
c2 := c1 newSubclass.<br>
c2 compile: 'foo ^ self subclassResponsibility'.<br>
c3 := c2 newSubclass.<br>
c3 new foo.<br>
<br>
=============== Diff against Tools-mt.929 ===============<br>
<br>
Item was removed:<br>
- ----- Method: Debugger>>askForCategoryIn:default: (in category 'notifier support') -----<br>
- askForCategoryIn: aClass default: aString<br>
- <br>
- ^ (Project uiManager<br>
- chooseFromOrAddTo: (aClass allMethodCategoriesIntegratedThrough: Object)<br>
- lines: #()<br>
- title: 'Please provide a good category for the new method' translated)<br>
- ifNil: [aString]<br>
- ifNotNil: [:newCategory | newCategory ifEmpty: [aString]]!<br>
<br>
Item was added:<br>
+ ----- Method: Debugger>>askForCategoryIn:default:ifCancel: (in category 'notifier support') -----<br>
+ askForCategoryIn: aClass default: defaultCategory ifCancel: aBlock<br>
+ <br>
+ | categories category |<br>
+ categories := (aClass allMethodCategoriesIntegratedThrough: Object) asOrderedCollection.<br>
+ categories<br>
+ remove: defaultCategory ifAbsent: [];<br>
+ addFirst: defaultCategory.<br>
+ category := Project uiManager<br>
+ chooseFromOrAddTo: categories<br>
+ lines: #(2)<br>
+ title: 'Please provide a good category for the new method' translated.<br>
+ category ifNil: [^ aBlock value].<br>
+ ^ category ifEmpty: [defaultCategory]!<br>
<br>
Item was changed:<br>
----- Method: Debugger>>askForSuperclassOf:toImplement:ifCancel: (in category 'notifier support') -----<br>
askForSuperclassOf: aClass toImplement: aSelector ifCancel: cancelBlock<br>
+ <br>
+ ^ self<br>
+ askForSuperclassOf: aClass<br>
+ upTo: nil<br>
+ toImplement: aSelector<br>
+ ifCancel: cancelBlock!<br>
- | classes chosenClassIndex |<br>
- classes := aClass withAllSuperclasses.<br>
- chosenClassIndex := UIManager default <br>
- chooseFrom: (classes collect: [:c | c name])<br>
- title: 'Define #', aSelector, ' in which class?'.<br>
- chosenClassIndex = 0 ifTrue: [^ cancelBlock value].<br>
- ^ classes at: chosenClassIndex!<br>
<br>
Item was changed:<br>
----- Method: Debugger>>askForSuperclassOf:upTo:toImplement:ifCancel: (in category 'notifier support') -----<br>
askForSuperclassOf: aClass upTo: superclass toImplement: aSelector ifCancel: cancelBlock<br>
+ <br>
| classes chosenClassIndex |<br>
+ classes := aClass withAllSuperclasses readStream upTo: superclass.<br>
- classes := aClass withAllSuperclasses reject: [:cls | aClass isKindOf: cls].<br>
chosenClassIndex := UIManager default <br>
chooseFrom: (classes collect: [:c | c name])<br>
+ title: ('Define {1} in which class?' translated<br>
+ format: {aSelector asSymbol printString}).<br>
- title: 'Define #', aSelector, ' in which class?'.<br>
chosenClassIndex = 0 ifTrue: [^ cancelBlock value].<br>
^ classes at: chosenClassIndex!<br>
<br>
Item was changed:<br>
----- Method: Debugger>>createMethod (in category 'notifier buttons') -----<br>
createMethod<br>
+ "Should only be called when this Debugger was created in response to a MessageNotUnderstood exception. Create a stub for the method that was missing and proceed into it."<br>
- "Should only be called when this Debugger was created in response to a<br>
- MessageNotUnderstood exception. Create a stub for the method that was<br>
- missing and proceed into it."<br>
<br>
| msg chosenClass |<br>
self initializeFull.<br>
msg := self contextStackTop exceptionMessage.<br>
chosenClass := self<br>
askForSuperclassOf: self contextStackTop receiver class<br>
toImplement: msg selector<br>
ifCancel: [^self].<br>
+ self<br>
+ implementMissingMethod: msg<br>
+ inClass: chosenClass<br>
+ ifCancel: [^self].!<br>
- self implementMissingMethod: msg inClass: chosenClass.!<br>
<br>
Item was removed:<br>
- ----- Method: Debugger>>implementMissingMethod:inClass: (in category 'notifier support') -----<br>
- implementMissingMethod: aMessage inClass: aClass<br>
- ^ self<br>
- implementMissingMethod: aMessage<br>
- inClass: aClass<br>
- inCategory: (self askForCategoryIn: aClass default: 'as yet unclassified').!<br>
<br>
Item was added:<br>
+ ----- Method: Debugger>>implementMissingMethod:inClass:ifCancel: (in category 'notifier support') -----<br>
+ implementMissingMethod: aMessage inClass: aClass ifCancel: aBlock<br>
+ <br>
+ | category |<br>
+ category := self<br>
+ askForCategoryIn: aClass<br>
+ default: ClassOrganizer default<br>
+ ifCancel: [^ aBlock value].<br>
+ ^ self<br>
+ implementMissingMethod: aMessage<br>
+ inClass: aClass<br>
+ inCategory: category!<br>
<br>
Item was changed:<br>
----- Method: Debugger>>implementMissingMethod:inClass:inCategory: (in category 'notifier support') -----<br>
implementMissingMethod: aMessage inClass: aClass inCategory: aSymbol<br>
"Create a stub implementation of the missing message and sew it onto the top of the stack, ensuring the context's arguments are set correctly. Debug the new context."<br>
+ <br>
+ self<br>
+ pushStubMethodOnStack: aMessage inClass: aClass inCategory: aSymbol;<br>
+ removeNotifierContext: self selectedContext sender.!<br>
- self pushStubMethodOnStack: aMessage inClass: aClass inCategory: aSymbol.<br>
- <br>
- "Cut out the sender context. This is the context that signalled the MessageNotUnderstood."<br>
- self selectedContext privSender: self selectedContext sender.<br>
- self resetContext: self selectedContext.<br>
- self debug.!<br>
<br>
Item was changed:<br>
----- Method: Debugger>>implementOverridingMethod:inClass:inCategory: (in category 'notifier support') -----<br>
implementOverridingMethod: aMessage inClass: aClass inCategory: aSymbol<br>
"Create a stub implementation of the overriding message and sew it onto the top of the stack, ensuring the context's arguments are set correctly. Debug the new context."<br>
+ <br>
+ self<br>
+ pushStubMethodOnStack: aMessage inClass: aClass inCategory: aSymbol;<br>
+ removeNotifierContext: self selectedContext sender sender.!<br>
- self pushStubMethodOnStack: aMessage inClass: aClass inCategory: aSymbol.<br>
- <br>
- "Cut out the sender context. This is the context that signalled the SubclassResponsibility."<br>
- self selectedContext privSender: self selectedContext sender sender.<br>
- self resetContext: self selectedContext.<br>
- self debug.!<br>
<br>
Item was added:<br>
+ ----- Method: Debugger>>removeNotifierContext: (in category 'notifier support') -----<br>
+ removeNotifierContext: aContext<br>
+ "Cut out the sender context. This is the context that signalled a notification that triggered the notifier."<br>
+ <br>
+ self selectedContext privSender: aContext.<br>
+ self resetContext: self selectedContext.<br>
+ self debug; doStep. "for convenient selection"!<br>
<br>
<br>
</div>
</span></font>
</body>
</html>