[Cuis-dev] Bugfix - ExtractToTemporary

Joel Camera joel.camera at 10pines.com
Tue Mar 25 15:33:57 PDT 2025


Hi folks!
Here I bring a bugfix of ExtractToTemporary with its test.
The problem was that if a variable declaration does not have a space at the
end, and someone wants to extract a new temporary, it will add the new
temporary variable in the middle of the last one.
Example: Suppose we want to create a temporary variable with the
highlighted code, and the new variable name will be *newVar*.
m1
  |var|
  var := 1.
  ^ var + 2

After extracting the variable it will end like this
m1
  |va newVarr|
  var := 1.
  *newVar* := var + 2.
  ^ *newVar*

Checking the code, ExtractToTemporary assumes the last space of variable
declaration exists. So the fix is checking if the space exists or not and
return the right index to add the new variable.

Have a nice day!

<https://10pines.com/>Joel CámeraAgile Software Development

Alem 896, Floor 6, Buenos Aires, Argentina

+54 9 011 6091 3125
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250325/76b7788d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnsavedChangesTo-BaseImageTests-JEC.001.cs.st
Type: application/octet-stream
Size: 554 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250325/76b7788d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ExtractToTemporaryBugFix-JEC.001.cs.st
Type: application/octet-stream
Size: 931 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250325/76b7788d/attachment-0001.obj>


More information about the Cuis-dev mailing list