Stano 143 Posted July 11, 2021 I used Format uses clause. I would like FireDAC.xx.yy to form a separate group as a System.xx, Vcl.xx and etc. That there is them FireDAC.Comp.Client, BasalForm, FireDAC.Stan.Param, FireDAC.Comp.DataSet, FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.DatS, FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt, Share this post Link to post
Uwe Raabe 2064 Posted July 11, 2021 You can define the group names per project in MMX Properties - Project options: A single identifier is treated as a group prefix which has to be followed by a dot (like System, VCL, FireDAC). You can also use wildcards like Rz* for all units from Raize Components (KSVC). Unit names not covered in one of the schemes above can be listet in brackets. This is the setting for MMX itself: (ToolsApi,DesignIntf,DCCStrs,DockForm,TabDock);Winapi;System.Win;System;Xml;Vcl;VirtualTrees*;Rz*;Tb*;Png*;MMX The settings are stored in the dproj file. 5 Share this post Link to post
Stano 143 Posted July 11, 2021 Excellent. I missed it, I didn't notice. He didn't understand. Share this post Link to post
Shrinavat 17 Posted July 13, 2021 @Uwe Raabe What am I doing wrong? Why aren't the units grouped by group prefix? Share this post Link to post
Ian Branch 128 Posted September 5, 2021 Question on a similar frain.. I have the following in the Uses Clause Sorting.. "WinApi;System.Win;System;Data;Vcl;Vcl.ww;LMD*;js*;rz*;pp*;da*;sc*;adv*;edb*;nlh*;id*;esbpcs*" It doesn't seem to respect the Vcl vs Vcl.ww* Should it or is this simply a case of confusion buy the sorter?? Regards & TIA, Ian Share this post Link to post
Uwe Raabe 2064 Posted September 5, 2021 I'm not sure if I understand that right. You might add a sample uses clause showing what you expect and what you get. (That would also make it easier to create a new test case) As I read the value shown, there is no "Vcl.ww*", but "Vcl.ww" which is handled as "Vcl.ww.*". Entries without a trailing star specify a unit scope. Share this post Link to post
Ian Branch 128 Posted September 5, 2021 Hi Uwe, By way of example. This is what I have.. Vcl.Printers, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.DBCtrls, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ExtCtrls, Vcl.Menus, vcl.wwdbgrid, Vcl.wwIDlg, Vcl.wwdbdlg, vcl.wwdblook, vcl.wwdbnavigator, vcl.Wwdbedit, vcl.Wwkeycb, vcl.Wwdbcomb, vcl.Wwfltdlg, Vcl.Mask, Vcl.NumberBox, vcl.Wwmemo, Vcl.ImgList, Vcl.Grids, vcl.wwDialog, vcl.Wwdotdot, vcl.wwdbigrd, vcl.wwspeedbutton, vcl.wwclearpanel, This is what I would like to see.. Vcl.Printers, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.DBCtrls, Vcl.ComCtrls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ExtCtrls, Vcl.Menus, Vcl.Mask, Vcl.NumberBox, Vcl.ImgList, Vcl.Grids, vcl.wwdbgrid, Vcl.wwIDlg, Vcl.wwdbdlg, vcl.wwdblook, vcl.wwdbnavigator, vcl.Wwdbedit, vcl.Wwkeycb, vcl.Wwdbcomb, vcl.Wwfltdlg, vcl.Wwmemo, vcl.wwDialog, vcl.Wwdotdot, vcl.wwdbigrd, vcl.wwspeedbutton, vcl.wwclearpanel, Regards, Ian Share this post Link to post
Uwe Raabe 2064 Posted September 5, 2021 Thanks, now I see what you are after. The Vcl entry collects also the Vcl.ww* ones and the latter somewhat acts as a subgroup. Seems like the algorithm has to be fine tuned a bit. I will add that test case to the suite and see how I can make it green. 1 Share this post Link to post
Ian Branch 128 Posted September 9, 2021 Tested and verified. Thanks Uwe. Share this post Link to post
Ralf Kaiser 2 Posted October 1, 2021 Hi Uwe, Since the grouping setting ist stores per project inside the DPROJ file: Is it possible to define a standard for new projects? We have some self-writte libs we would like to see at the end of the grouping, even in a newly created project. Currently it looks like the grouping is switched to the default when creating a new project. Thanks in advance, Ralf Share this post Link to post
Uwe Raabe 2064 Posted October 1, 2021 1 hour ago, Ralf Kaiser said: Is it possible to define a standard for new projects? Good suggestion! I will note a feature request for it. 1 2 Share this post Link to post
Ian Branch 128 Posted October 10, 2021 I would like to second this and suggest perhaps the option to make whatever is in the groups field persistent. I use the same groups all the time sometimes I pull up an older project that hasn't been 'grouped' so I keep a copy of my MMX groups in a text editor that is persistent between uses. Perhaps add a check box 'Make Groups persistent' so Users can make what they have in there persistent between projects, or not. Share this post Link to post
Uwe Raabe 2064 Posted October 10, 2021 I thought about a global setting, that is taken when the project setting is empty, and omit populating the project settings with the hardcoded default. Share this post Link to post
TheDelphiCoder 2 Posted May 5, 2022 Hi Uwe, any news regarding the global setting already? I recognized that units not belonging in a group get correctly placed after the groups, but are not sorted in alphabetical order. Is this a missing case? Share this post Link to post
Uwe Raabe 2064 Posted May 5, 2022 37 minutes ago, TheDelphiCoder said: I recognized that units not belonging in a group get correctly placed after the groups, but are not sorted in alphabetical order. Is this a missing case? No, that is intended. Sorting is only done on the group level, but keeps the order inside that group intact. That still allows for some control over the unit order - at least inside a group. Share this post Link to post
TheDelphiCoder 2 Posted May 6, 2022 19 hours ago, Uwe Raabe said: No, that is intended. Sorting is only done on the group level, but keeps the order inside that group intact. That still allows for some control over the unit order - at least inside a group. What about making that an option? Share this post Link to post
Uwe Raabe 2064 Posted May 6, 2022 I have my doubts that this will ever be switched on - at least not for a longer time. The option will be all or nothing. It will affect all uses clauses in all units, even in all projects if it were not restricted to the Project options. Especially when the Auto Format option is enabled it will kick in whenever MMX manipulates any of the uses clause. A possible way out of this could be to offer another MMX menu command instead of an always effective option (similar to the Format Uses - Alternate command). As long as the units are already sorted alphabetically, any subsequent format will keep that order. Nevertheless, if the demand for such an option is high enough I can see what can be done. Share this post Link to post
Guest Posted May 6, 2022 (I apologise if I'm missing the context here.) Automatically and unconditionally sorting units alphabetically doesn't seem to be a good idea. If you have multiple units exposing the same identifier then changing the order of units in the uses clause changes how they are resolved, probably leading to unintended changes to runtime behaviour of your code. Share this post Link to post
TheDelphiCoder 2 Posted May 17, 2022 @Uwe Raabe Another issue: While sorting and grouping the uses clause the unit names are expanded to their full name, e.g. SysUtils becomes System.SysUtils This does NOT work for the Forms unit, it should become Vcl.Forms (in a VCL project, of course)! Other VCL units do not have this problem. Share this post Link to post