A.M. Hoornweg 144 Posted December 15, 2023 Hello all, I see that the Delphi 12 source code formatter (Ctrl-D) still mutilates generic class declarations, it inserts inappropriate line feeds between keywords and ruins indentation. Is there a way to set markers in the source code that tell the formatter to skip those areas from formatting? Or can you recommend a better code formatter that handles generics properly? Have a nice day! Arthur Share this post Link to post
Sherlock 663 Posted December 15, 2023 Yeah, the formatter is no longer maintained, marked as deprecated and should be handled with caution. Aside from that, you may highlight a specific code section and format only that. Or you could go a different way and choose to use the GExperts code formatter. It knows source directives to prevent code formatting. Share this post Link to post
Lajos Juhász 293 Posted December 15, 2023 (edited) Do not try the formatter in source where you've multiline string. They should deprecate also the IDE editor it can't cope with the code. I've a section in my code that I cannot edit inside the IDE (a class with inner types). Edited December 15, 2023 by Lajos Juhász Share this post Link to post
dummzeuch 1505 Posted December 15, 2023 19 minutes ago, Sherlock said: Or you could go a different way and choose to use the GExperts code formatter. It knows source directives to prevent code formatting. And also, in the most recent source code (no release yet, maybe this weekend, but no promises), it supports multiline strings. 1 Share this post Link to post
A.M. Hoornweg 144 Posted December 15, 2023 2 hours ago, Sherlock said: Yeah, the formatter is no longer maintained, marked as deprecated and should be handled with caution. Aside from that, you may highlight a specific code section and format only that. Or you could go a different way and choose to use the GExperts code formatter. It knows source directives to prevent code formatting. Eh what, the internal IDE source code formatter is deprecated? Are they just abandoning it without any replacement? I find it rather essential. 3 Share this post Link to post
Uwe Raabe 2057 Posted December 15, 2023 They found - what everyone else claimed for a long time - that it didn't keep up with the latest language enhancements. As it is based on other deprecated parts (i.e. Refactoring), they consequently marked it deprecated, too. Now they are working on or looking for replacements. Communicating that something is deprecated without having an alternative at hand is not necessarily a bad thing. People now know it advance what they can expect and rely on and what not. 1 Share this post Link to post
Sherlock 663 Posted December 15, 2023 I'm sure they're working on it for Delphi 13 codename "Salem". (Edit: Please ignore this, if you are looking for facts!) But for now https://docwiki.embarcadero.com/RADStudio/Athens/en/What's_New#Moving_Deprecated_Features and because the formatter is not explicitly mentioned here, it's deprecated through the modeling support. 1 Share this post Link to post
Remy Lebeau 1394 Posted December 15, 2023 4 hours ago, Sherlock said: I'm sure they're working on it for Delphi 13 codename "Salem". Please don't spread fake news. There is no such version. 4 hours ago, Sherlock said: But for now https://docwiki.embarcadero.com/RADStudio/Athens/en/What's_New#Moving_Deprecated_Features and because the formatter is not explicitly mentioned here, it's deprecated through the modeling support. It is explicitly mentioned, in a roundabout way: Quote In RAD Studio 12.0 Athens, we are moving some old and unsupported tools out of the core product installation, making them available as add-ons: VCL Translation Support. Modeling. Note that you must install this if you want to use Delphi code formatting, and it is available in the Technology section of the installer. Modeling is deprecated, and the current code formatter depends on it, so the formatter is also deprecated. Share this post Link to post
gkobler 38 Posted December 17, 2023 Is there an alternative for the code formatter? Share this post Link to post
PeterBelow 238 Posted December 17, 2023 1 hour ago, gkobler said: Is there an alternative for the code formatter? Write properly formatted code in the first place? (gdr) Share this post Link to post
gkobler 38 Posted December 17, 2023 5 hours ago, PeterBelow said: Write properly formatted code in the first place? I'm just lazy and like to leave the work to the formatter Share this post Link to post
Dmitry Sh. 8 Posted December 18, 2023 On 12/17/2023 at 1:02 PM, gkobler said: Is there an alternative for the code formatter? https://github.com/cnpack/cnwizards Share this post Link to post
Sherlock 663 Posted December 19, 2023 On 12/15/2023 at 7:04 PM, Remy Lebeau said: Please don't spread fake news. There is no such version. Sorry about that, that was just my humorous side getting the better of me, I know there will be no Version 13 - but if there ever was, it would aptly be named after a town with a "witch problem". 1 Share this post Link to post
Remy Lebeau 1394 Posted December 19, 2023 7 hours ago, Sherlock said: Sorry about that, that was just my humorous side getting the better of me, I know there will be no Version 13 - but if there ever was, it would aptly be named after a town with a "witch problem". Ah! Stupid me, that joke went right over my head, I didn't even notice the 13 🤯 1 Share this post Link to post