Community
Participate
Working Groups
Build Identifier: 7.0.1 When a product contributes a profile to the Code Styles via the plugin_customization.ini file using org.eclipse.cdt.ui/org.eclipse.cdt.ui.formatterprofiles, the added profile is using the name of the profile as the ID related to the patch in #138668 In org.eclipse.cdt.internal.ui.preferences.formatter.FormatterProfileManager: - profMap.put(p.getID(), new BuiltInProfile(p.getName(), p.getName(), p.getSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind())); + profMap.put(p.getID(), new BuiltInProfile(p.getID(), p.getName(), p.getSettings(), 2, profileVersioner.getCurrentVersion(), profileVersioner.getProfileKind())); Reproducible: Always
(In reply to comment #0) > related to the patch in #138668 This bug seems unrelated.
Looks like he means bug 279607 (#138668 is the attachment ID there...).
Thanks, what is the consequence of using the name as ID?
Just trying to work out what the effect is ;) A quick look shows the loaded Profile is a CustomProfile and #getID() returns ID_PREFIX + fName whereas builtin profile just returns getID. Rudolf can you be more explicit on what's not working right here (other than it just looks incorrect)?
(In reply to comment #4) > returns ID_PREFIX + fName And I think this is the reason why I did this. The CustomProfile doesn't actually have an ID. ID is generated as '_' + fName. It didn't seem to make sense to require integrators to prepend _ when setting the org.eclipse.cdt.ui/formatter_profile key. Rather they use the profile name directly as that's the only attribute they can change. AFAICS it doesn't matter one way or the other, apart from the leading '_'.
Ok, you are right. Sorry for the confusion. I did not check that the getID is actually returning the name. The only problem was that I had to specify org.eclipse.cdt.ui/formatter_profile= profilename where profilename might be localized. But it is not a big deal especially that there is no place to specify the ID inside the profile xml file. I guess we should close this bug. Sorry guys.