pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Package copy class pattern does not handle copy all (.*) well

Open Inao0 opened this issue 1 year ago • 1 comments

Bug description When trying to duplicate all classes in a package with copy package and using (.*) as the source class pattern, the class name generated in target class pattern is wrong : generated

The expected prefix (A) is put both before and after the original class name and the suffix(B) is doubled on each side of the scuffed prefix :

AMyClassBAB
AMyClassTestBAB

To Reproduce

  1. Right-click a package -> copy all packages
  2. Put a new package name.
  3. Use (*.) as the source class pattern and add a prefix and/or a suffix with the target class pattern (see picture above for an example).

Expected behavior With the example above in the screenshot, the target class pattern should generate :

AMyClassB
AMyClassTestB

Version information: OS: MacOS Pharo Version 12 (Pharo-12.0.0+SNAPSHOT.build.1363.sha.a84b1048f904d97b64a03cc1fc6c43d0e3aeb9ce)

Inao0 avatar Feb 12 '24 19:02 Inao0

Hi. I didn't checked throughfully but it seems you forgot to put the "begin of line" matcher before the (.*) ?

If I write like this I get the desired result:

Screenshot 2024-02-18 at 15 19 40

hernanmd avatar Feb 18 '24 14:02 hernanmd

Closing it as it doesn't seem a bug, let us know if there's something else to check regarding this.

hernanmd avatar Mar 26 '24 13:03 hernanmd