[squeak-dev] The Inbox: Tools-ct.1159.mcz

christoph.thiede at student.hpi.uni-potsdam.de christoph.thiede at student.hpi.uni-potsdam.de
Fri May 20 11:55:49 UTC 2022


Could please someone approve this so I can merge it into Squeak 6.0beta? :)

Best,
Christoph

---
Sent from Squeak Inbox Talk

On 2022-05-20T11:41:38+00:00, commits at source.squeak.org wrote:

> A new version of Tools was added to project The Inbox:
> http://source.squeak.org/inbox/Tools-ct.1159.mcz
> 
> ==================== Summary ====================
> 
> Name: Tools-ct.1159
> Author: ct
> Time: 20 May 2022, 1:41:35.47049 pm
> UUID: f2890075-119c-c948-bd42-93a392abcca9
> Ancestors: Tools-mt.1158
> 
> Fixes a tedious #codeChangedElsewhere bug in the class definition view of system browsers.
> 
> The original bug report:
> 
>     1. Open a browser on any method of any class.
>     2. Change the source so that it contains a new - as yet undeclared - instance variable.
>     3. Accept the new method and answer the "unknown variable" dialog with "declare instance variable".
>     4. Click on the instance button of the browser.
>     5. Try to type into the class definition or to reaccept it.
>     
>     The text cursor would jump to beginning of the text field every second until you started to type. After that, a red triangle would appear at the text field, and when you tried to accept the changes, a "may have been changed elsewhere" warning would appear.
> 
> Cause:
> 
>     Declaring the new instance variable converts the class into a new behavior instance, but the browser kept a reference on the prior version of the class. Thus Browser>>#didCodeChangeElsewhere answered true because of the divergent class definitions, but CodeHolder>>#updateCodePaneIfNeeded was unable to fix that divergence.
> 
> Solution:
> 
>     Add override Browser>>#updateCodePaneIfNeeded and send #setClassDefinition if necessary to apply the pending update.
> 
> =============== Diff against Tools-mt.1158 ===============
> 
> Item was added:
> + ----- Method: Browser>>updateCodePaneIfNeeded (in category 'self-updating') -----
> + updateCodePaneIfNeeded
> + 
> +     super updateCodePaneIfNeeded.
> +     
> +     (self didCodeChangeElsewhere and: [self hasUnacceptedEdits not])
> +         ifTrue:
> +             [self setClassDefinition.
> +             self contentsChanged].!
> 
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220520/1927c1d5/attachment.html>


More information about the Squeak-dev mailing list