I have taken a look at your file. It describes how to add a new checkbox to the options, and how to store that checkbox.
I assume
is for the current order?
And switching it off, would be the new order?
That is ok, but personally I would suggest to make "SortByDeclaration" as now option. That way to change away from the current behaviour people will turn an option on (rather than off).
In any case, one important bit.
XMLConfig.SetDeleteValue('CodeToolsOptions/IdentifierCompletion/SortForAlphaOrder',
FIdentComplSortForAlphaOrder, TRUE);
The "TRUE" means that is the default. If the value is true, then nothing will be written into the xml file.
And the "XMLConfig.GetValue(...., TRUE)" must then have the same default, so if the XML has no value, "true" will be read.
The "FIdentComplSortForAlphaOrder" must also be initialized (that should happen for either true or false anyway). There should be a method where all the options are initialized.
===> The important bit is: If the setting is at its default => the xml should not contain anything.For all else, your suggestions look ok.
Of course you still need the code that do the actual work.
If you have further suggestions, please provide them as patch. Even if you just put comments (or dummy code) in there.
If I apply a patch, I can open the files, and have tools to navigate to the lines that changed.