[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #9 from Piotr Mierzwinski --- Big thanks for fix. -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #8 from Igor Kushnir --- Git commit 2d8cafaae7ee82ab89507b384f5385f9a21d3f97 by Igor Kushnir. Committed on 15/09/2023 at 11:57. Pushed by igorkushnir into branch 'master'. SourceFormatterSelectionEdit: add usage help and info Configure Source Formatter user interface is unusual. The fact that the Language combobox defines what is being configured and the Formatter combobox actually configures something is not obvious (Bug 358798). The first paragraph of the added usage help should clear this up for new users. The second paragraph of the usage help explains what functionality depends on configured Formatting Styles and why correctly configuring them is very important. The third paragraph of the usage help points out the unobvious fact that all *.h are formatted with formatter and style configured for C language. Piotr Mierzwinski has reported many source formatter bugs, some of which were caused by incompletely or incorrectly configured formatting. Hopefully the added usage help will avoid such user misunderstanding and trouble in the future. Both AStylePlugin and CustomScriptPlugin implement ISourceFormatter::description(). The descriptions must have been translated into many languages long ago, but are not used anywhere. Show these informative descriptions in Configure Source Formatter UI. Show the usage help and formatter descriptions as whatsThis of two added tool buttons. This way, the information is easily discoverable by new users and practically does not take up useful UI space. The whatsThis popup can be displayed in two intuitive ways: 1) common: hover over the button, read the tooltip and press Shift; 2) custom: click the button. Set formatter description whatsThis to an empty string when there are no enabled formatter plugins. QWhatsThis never shows up when the text is empty. Set the tool buttons' iconSize to 22x22. Optimized icons of this size are present in most icon themes. A button with this icon size is a pixel or two higher than a combobox in the same row, so only a few pixels of vertical UI space are lost. The usage help button is positioned as close as possible to the top left corner of the SourceFormatterSelectionEdit widget because it explains the entire interface. The formatter description button is placed to the right of the Formatter combobox because it describes a selected formatter. Unfortunately, the resulting misalignment of the buttons and comboboxes looks weird. On the other hand, the asymmetry might help the user understand that the two comboboxes have vastly different roles. Related: bug 335549 M +11 -0kdevplatform/shell/sourceformatterselectionedit.cpp M +43 -0kdevplatform/shell/sourceformatterselectionedit.ui https://invent.kde.org/kdevelop/kdevelop/-/commit/2d8cafaae7ee82ab89507b384f5385f9a21d3f97 -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #7 from Igor Kushnir --- Git commit 65227a6fe0d5ed14107b5a80561ed8eae618eaf5 by Igor Kushnir. Committed on 06/06/2023 at 14:37. Pushed by igorkushnir into branch 'fix-and-refactor-formatter-selection-edit'. SourceFormatterSelectionEdit: add usage help and info Configure Source Formatter user interface is unusual. The fact that the Language combobox defines what is being configured and the Formatter combobox actually configures something is not obvious (Bug 358798). The first paragraph of the added usage help should clear this up for new users. The second paragraph of the usage help explains what functionality depends on configured Formatting Styles and why correctly configuring them is very important. The third paragraph of the usage help points out the unobvious fact that all *.h are formatted with formatter and style configured for C language. Piotr Mierzwinski has reported many source formatter bugs, some of which were caused by incompletely or incorrectly configured formatting. Hopefully the added usage help will avoid such user misunderstanding and trouble in the future. Both AStylePlugin and CustomScriptPlugin implement ISourceFormatter::description(). The descriptions must have been translated into many languages long ago, but are not used anywhere. Show these informative descriptions in Configure Source Formatter UI. Show the usage help and formatter descriptions as whatsThis of two added tool buttons. This way, the information is easily discoverable by new users and practically does not take up useful UI space. The whatsThis popup can be displayed in two intuitive ways: 1) common: hover over the button, read the tooltip and press Shift; 2) custom: click the button. Set formatter description whatsThis to an empty string when there are no enabled formatter plugins. QWhatsThis never shows up when the text is empty. Set the tool buttons' iconSize to 22x22. Optimized icons of this size are present in most icon themes. A button with this icon size is a pixel or two higher than a combobox in the same row, so only a few pixels of vertical UI space are lost. The usage help button is positioned as close as possible to the top left corner of the SourceFormatterSelectionEdit widget because it explains the entire interface. The formatter description button is placed to the right of the Formatter combobox because it describes a selected formatter. Unfortunately, the resulting misalignment of the buttons and comboboxes looks weird. On the other hand, the asymmetry might help the user understand that the two comboboxes have vastly different roles. Related: bug 335549 M +11 -0kdevplatform/shell/sourceformatterselectionedit.cpp M +43 -0kdevplatform/shell/sourceformatterselectionedit.ui https://invent.kde.org/kdevelop/kdevelop/-/commit/65227a6fe0d5ed14107b5a80561ed8eae618eaf5 -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 Piotr Mierzwinski changed: What|Removed |Added Resolution|--- |NOT A BUG Status|REPORTED|RESOLVED --- Comment #6 from Piotr Mierzwinski --- Reported as bug because of incorrect understanding the settings.. -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #5 from Piotr Mierzwinski --- (In reply to Igor Kushnir from comment #4) > Piotr, I think you are misunderstanding the configuration page. By picking a > formatter for each language in the Language combobox you can use different > formatters for different languages. The Language combobox does not show the > currently configured language, but lets you pick the language you want to > select a formatter for. > > Here is what I have in my > ~/.local/share/kdevelop/sessions/{session-id}/sessionrc: > > [SourceFormatter] > ModelinesEnabled=false > OverrideKateIndentation=false > text/x-c++hdr=kdevastyle||Qt > text/x-c++src=kdevastyle||Qt > text/x-chdr=kdevastyle||KDELibs > text/x-csharp=kdevastyle||1TBS > text/x-csrc=kdevastyle||KDELibs > text/x-java=kdevastyle||1TBS > text/x-objcsrc=kdevastyle||1TBS > > This is after I picked Qt as the style for the C++ Language and KDELibs as > the style for the C Language, while leaving the default 1TBS style for other > languages that I don't use. > > So if you only use C++, configure the source formatter for this language in > KDevelop settings. However note Bug 335549: if your headers have the *.h > extension, configure the formatter for the C language as well. You could > even use different formatters for headers and source files in this case. > > As for your project configuration idea, it's already implemented. There is a > Source Formatter section on the Configure Project page. > > To summarize: > - custom formatting styles that a user creates are stored in > ~/.config/kdeveloprc. So a user can create a custom style "My style" once, > then select it for any other session or project. > - Source formatters ("Artistic Style" or "Custom Script Formatter") and > styles (1TBS, ANSI, ... or "Gnu Indent : GNU", "Clang Format", ...) > selections for each language on the Source Formatter page of the Configure > KDevelop window are stored separately for each session (as I showed above). > - Source formatters can also be configured on a per-project basis. > > In conclusion, I think there is no bug here, so this issue can be closed as > not a bug. Yes. You are right. I misunderstood this configuration. Now I get it that I can just set Formatter for given language and my recent setting (made couple days ago) just reflects this. I mean I had one Formatter for C and for C++ different. Today I checked and all was fine. And about Artistic Style->Qt what you mentioned that you set in your side and KDevelop thanks that stopped insert spaces next to brackets, I found it also. Before seems I just overlooked this entry in Formatter combobox list. Anyway I have set it for both (C and C++). Thank you for explanation. I'm going to change status this ticket. -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 Igor Kushnir changed: What|Removed |Added CC||igor...@meta.ua --- Comment #4 from Igor Kushnir --- Piotr, I think you are misunderstanding the configuration page. By picking a formatter for each language in the Language combobox you can use different formatters for different languages. The Language combobox does not show the currently configured language, but lets you pick the language you want to select a formatter for. Here is what I have in my ~/.local/share/kdevelop/sessions/{session-id}/sessionrc: [SourceFormatter] ModelinesEnabled=false OverrideKateIndentation=false text/x-c++hdr=kdevastyle||Qt text/x-c++src=kdevastyle||Qt text/x-chdr=kdevastyle||KDELibs text/x-csharp=kdevastyle||1TBS text/x-csrc=kdevastyle||KDELibs text/x-java=kdevastyle||1TBS text/x-objcsrc=kdevastyle||1TBS This is after I picked Qt as the style for the C++ Language and KDELibs as the style for the C Language, while leaving the default 1TBS style for other languages that I don't use. So if you only use C++, configure the source formatter for this language in KDevelop settings. However note Bug 335549: if your headers have the *.h extension, configure the formatter for the C language as well. You could even use different formatters for headers and source files in this case. As for your project configuration idea, it's already implemented. There is a Source Formatter section on the Configure Project page. To summarize: - custom formatting styles that a user creates are stored in ~/.config/kdeveloprc. So a user can create a custom style "My style" once, then select it for any other session or project. - Source formatters ("Artistic Style" or "Custom Script Formatter") and styles (1TBS, ANSI, ... or "Gnu Indent : GNU", "Clang Format", ...) selections for each language on the Source Formatter page of the Configure KDevelop window are stored separately for each session (as I showed above). - Source formatters can also be configured on a per-project basis. In conclusion, I think there is no bug here, so this issue can be closed as not a bug. -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 Piotr Mierzwinskichanged: What|Removed |Added CC||piotr.mierzwin...@gmail.com --- Comment #3 from Piotr Mierzwinski --- @Kevin. This is just regular bug report. Fixing the problem is not urgent for me. I didn't mark it anywhere as important/urgent. Milian (in one of bug report) told me, if I find any in sourceformatter then I might to report it. I understand that release blockers are more important, and this bug doesn't block release. Would be nice if someone mark it as confirmed. I know that any patches are highly appreciated. You told me about it earlier (bug related with "crash in debugger"). Unfortunately I don't have so much time to dive in not known source code, analyze how does it work, fix, test and prepare patch. Sorry. Anyway. I can report bugs. I hope this is helpful. -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #1 from Kevin Funk--- Piotr: Thanks a lot for your comprehensive bug reports! If you got time to work on any of these issues yourself, patches would be highly appreciated! Unfortunately we're all pretty busy with fixing release blockers. Thanks! -- You are receiving this mail because: You are watching all bug changes.
[kdevplatform] [Bug 358798] Source formatter every time selects language as "C"
https://bugs.kde.org/show_bug.cgi?id=358798 --- Comment #2 from Kevin Funk--- Piotr: Thanks a lot for your comprehensive bug reports! If you got time to work on any of these issues yourself, patches would be highly appreciated! Unfortunately we're all pretty busy with fixing release blockers. Thanks! -- You are receiving this mail because: You are watching all bug changes.