Summary: | bad usability in source formatter settings (.h and .cpp handled differently) | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Jakub Schmidtke <sjakub> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | dmitry.risenberg, lamefun.x0r, sjakub |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 4.3 |
Description
Jakub Schmidtke
2010-03-12 17:57:20 UTC
I need more specific reproduction steps for the first thing. The second sounds like a bug in astyle which you should report to the astyle bugtracker (IIRC its on sourceforge). *** Bug 265004 has been marked as a duplicate of this bug. *** I have recently created a new bug about this, I forgot about this one - sorry! OK, so I managed to reproduce the behavior every time with built-in source formatters. Steps to reproduce: * Open kdevelop * Create a new file. * Enter following: class Abc { public: Abc() {} }; * Save it as /tmp/test.cpp * Open "Settings->Configure Kdevelop", go to "Source formatter", and select "Artistic style" and "GNU" style. * Click OK * From "Edit" select "Reformat source". * It reformats the content. It doesn't look exactly as expected but that is probably a different issue. The important part is that the first '{' is indented. * Save the file. * Close kdevelop * Open kdevelop * If not already opened, open /tmp/test.cpp * Run "Edit->Reformat source" * The source is reformatted. The indentation before '{' and 'public:' is gone now. * Open "Settings->Configure Kdevelop" * Go to "Source Formatter" * Click "OK" (without changing anything - the GNU style is still selected) * Run "Edit->Reformat source" * The file is reformatted again, using the GNU style * After closing again and re-opening kdevelop, reformatter, again, doesn't respect the selected style. "GNU" style is just an example, that is built-in and demonstrates the problem. Using custom formatter instead causes the same problem. The procedure above was done in KDE 4.6.0, with kdevplatform 1.2.0 and kdevelop 4.2.0. will fix that today the problem here is that .h and .cpp files have different mimetypes and you have to configure both I've started discussion on this issue on our developer mailing list, lets see how we improve the situation So maybe the problem is somewhere else. Indeed, when I configured all the types in 'mimetypes' list in Source formatter's settings the problem went away. But, if I had it selected for only one (and the wrong one) of the mimetypes, why going to that settings and simply clicking 'OK' affected the behaviour? If it was simply just the wrong mimetype configured, it should always be the different setting used, right? Also, since I got you interested, would it be possible for you to look at bug 266710 as well? It is really frustrating when you are used to copying and pasting over existing selection... Thanks! Git commit 5388d06d4135853bc2f904252cf3f691f2363a6f by Dmitry Risenberg. Committed on 15/03/2011 at 23:01. Pushed by risenberg into branch 'master'. Set formatter and style per language, not mime type. Make style references from different languages with the same name one style object. BUG: 230472 REVIEW: 100868 M +29 -8 shell/languagecontroller.cpp M +3 -0 shell/languagecontroller.h M +1 -1 shell/settings/CMakeLists.txt M +181 -132 shell/settings/sourceformattersettings.cpp M +17 -10 shell/settings/sourceformattersettings.h M +1 -1 shell/settings/sourceformattersettings.ui http://commits.kde.org/kdevplatform/5388d06d4135853bc2f904252cf3f691f2363a6f *** Bug 256737 has been marked as a duplicate of this bug. *** |