Author Topic: B2: C++ formatting profiles are removed when doing export/import of configuratio  (Read 1171 times)

rowbearto

  • Senior Community Member
  • Posts: 1464
  • Hero Points: 110
For C++ formatting profiles: Tools->Options->Languages->Application Languages->C/C++->Formatting

I have 4 additional profiles in my config: "2_space_indent", "3_space_indent", "4_space_indent", and "tab indent"

If I export my configuration (Tools->Options->Export/Import Options) and then "Export All Options", and save it to "SlickEditOptions22.zip".

Then close SE, and restart SE with -sc option pointing to an empty directory so that have the default configuration. Using an empty directory with default config is critical to reproducing the issue.

Import the configuration that was just exported.

After the import, only "3_space_indent" is in the formatting profiles, the others are gone.

To reproduce, you can get the 22.0.0 directory as a tarball from support.slickedit.com where I uploaded it under "extra_a".

Copy this 22.0.0 directory to an SE config directory and start SE with -sc option pointing to this directory.

Then perform the export, close SE, start SE with -sc option pointing to fresh new directory, import the config. You will see that some of the formatting profiles are missing.

I did this on x64 Linux with CentOS 7. If needed (may not be required), you can reuse the VM that I uploaded in this post: https://community.slickedit.com/index.php/topic,15458.msg58927.html#msg58927
« Last Edit: September 05, 2017, 08:54:49 pm by rowbearto »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
We will look into this. Haven't tried to reproduce yet

Thanks for posting

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
Problem seems to be the export. Only the active beautifier profile is written. I'll see if we can fix this so all profiles for the specific language being exported are written.

rowbearto

  • Senior Community Member
  • Posts: 1464
  • Hero Points: 110
Thanks Clark!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
Fixed for next build

rowbearto

  • Senior Community Member
  • Posts: 1464
  • Hero Points: 110
Excellent! Thanks Clark!

I noticed one other thing. If I imported the config back into the original config directory (did not use -sc pointing to empty directory), the formatting profiles were there. But since you said there was a problem with the export, I would have thought that the other profiles should have disappeared?

So I am wondering if there is also an issue in import, that if the imported config has less profiles than the existing config, then the additional profiles are not removed during the import?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4892
  • Hero Points: 397
If you unzip the exported config file, you'll noticed that there is only one beautifier profile written which is for the active beautifier profile for the language. On import, profiles are never deleted but they can be modified or added.

The new code will export all user modified beautifier profiles and also indicate which profile was active. We already had utility functions for exporting all user modified profiles so this was an easy change. Built-in profiles aren't exported unless they have user modifications. Then only the user changes are exported.