Re: [Qt-creator] The state of the clang-format plugin
On 29/06/2022 17:33, Eike Ziller wrote: At the moment you can change the setting globally to “Disable” Where is that setting found? Can't find it anywhere. ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] The state of the clang-format plugin
> On 29 Jun 2022, at 16:09, Nikos Chantziaras wrote: > > On 29/06/2022 09:40, Eike Ziller wrote: >>> On 29 Jun 2022, at 05:26, Nikos Chantziaras wrote: >>> How are you supposed to deal with lines you didn't edit changing and have >>> no place in a git commit? It's impossible to work on code that's under >>> version control. >> The ClangFormat plugin restricts formatting on save to the regions that you >> edited since last saving (the regions that have a green marker on the side. > > This is unsuitable when you don't want to reformat the code. But more > importantly, when you undo, it breaks down. You edit something, then notice > it formatted when saving, you undo it, but it won't work. No matter what you > do, it will format it. I definitely would like to have an easy way to trigger a save without formatting even while “format on save” is generally turned on. At the moment you can change the setting globally to “Disable”, save the file, and turn the option back on, but it is cumbersome. > I noticed it like an hour too late, when my git diff was a complete mess, as > it formatted code I didn't want touched. > > At that point, I had to switch back to Creator 7. > > This makes it virtually impossible to use Creator. Sure, if you only ever > work on your own code, it's fine. But I work on a ton of projects, most of > them don't even have a clang-format file. > > ___ > Qt-creator mailing list > Qt-creator@qt-project.org > https://lists.qt-project.org/listinfo/qt-creator -- Eike Ziller Principal Software Engineer The Qt Company GmbH Erich-Thilo-Straße 10 D-12489 Berlin eike.zil...@qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] The state of the clang-format plugin
On 29/06/2022 09:40, Eike Ziller wrote: On 29 Jun 2022, at 05:26, Nikos Chantziaras wrote: How are you supposed to deal with lines you didn't edit changing and have no place in a git commit? It's impossible to work on code that's under version control. The ClangFormat plugin restricts formatting on save to the regions that you edited since last saving (the regions that have a green marker on the side. This is unsuitable when you don't want to reformat the code. But more importantly, when you undo, it breaks down. You edit something, then notice it formatted when saving, you undo it, but it won't work. No matter what you do, it will format it. I noticed it like an hour too late, when my git diff was a complete mess, as it formatted code I didn't want touched. At that point, I had to switch back to Creator 7. This makes it virtually impossible to use Creator. Sure, if you only ever work on your own code, it's fine. But I work on a ton of projects, most of them don't even have a clang-format file. ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] The state of the clang-format plugin
> > I'm confused now. What is that special shortcut? > Ctrl + ; is the default shortcut for Auto-format Selection ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] The state of the clang-format plugin
> On 29 Jun 2022, at 08:40, Eike Ziller wrote: > > > >> On 29 Jun 2022, at 05:26, Nikos Chantziaras wrote: >> >> On 28/06/2022 12:06, Christian Kandeler wrote: >>> On 6/25/22 10:58, Björn Schäpers wrote: in the days of yore you had 3 check marks for clang-format (still visible here https://doc.qt.io/qtcreator/images/qtcreator-code-style-clang-format.png). * Format instead of indenting * Format while typing * Format edited code on file save Nowadays the UI is gone, and at least option 2 is gone (https://codereview.qt-project.org/c/qt-creator/qt-creator/+/411513) I asked on why, but no answer yet. >>> I suppose the assumption was that this was not needed. If it turns out >>> there are actually people using that, it can be brought back. >> >> How are you supposed to deal with lines you didn't edit changing and have no >> place in a git commit? It's impossible to work on code that's under version >> control. > > The ClangFormat plugin restricts formatting on save to the regions that you > edited since last saving (the regions that have a green marker on the side. With a red marker, of course, not green. > > Br, Eike -- Eike Ziller Principal Software Engineer The Qt Company GmbH Erich-Thilo-Straße 10 D-12489 Berlin eike.zil...@qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator
Re: [Qt-creator] The state of the clang-format plugin
> On 29 Jun 2022, at 05:26, Nikos Chantziaras wrote: > > On 28/06/2022 12:06, Christian Kandeler wrote: >> On 6/25/22 10:58, Björn Schäpers wrote: >>> in the days of yore you had 3 check marks for clang-format (still visible >>> here >>> https://doc.qt.io/qtcreator/images/qtcreator-code-style-clang-format.png). >>> * Format instead of indenting >>> * Format while typing >>> * Format edited code on file save >>> >>> Nowadays the UI is gone, and at least option 2 is gone >>> (https://codereview.qt-project.org/c/qt-creator/qt-creator/+/411513) I >>> asked on why, but no answer yet. >> I suppose the assumption was that this was not needed. If it turns out there >> are actually people using that, it can be brought back. > > How are you supposed to deal with lines you didn't edit changing and have no > place in a git commit? It's impossible to work on code that's under version > control. The ClangFormat plugin restricts formatting on save to the regions that you edited since last saving (the regions that have a green marker on the side. Br, Eike -- Eike Ziller Principal Software Engineer The Qt Company GmbH Erich-Thilo-Straße 10 D-12489 Berlin eike.zil...@qt.io http://qt.io Geschäftsführer: Mika Pälsi, Juha Varelius, Jouni Lintunen Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B ___ Qt-creator mailing list Qt-creator@qt-project.org https://lists.qt-project.org/listinfo/qt-creator