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

commits at source.squeak.org commits at source.squeak.org
Mon Jun 13 07:42:43 UTC 2022

Marcel Taeumel uploaded a new version of Tools to project The Trunk:

==================== 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.


	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.


	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].!

More information about the Squeak-dev mailing list