So we can indent a whole project in under a split second. Let's add a setting so that when we run a quickfix or a refactoring or we do - or the user does - anything that modifies the code, we automatically run the indenter for every module we parse (that would be the modified ones) before we process anything.
This should be ...enabled by default? Or disabled but easy to find in the indenter settings tab.
I would vote for an opt-in setting. I would immediately opt-in.
I think Opt-In is best choice. Suppose I have funky indenting I want to keep? Not sure if the smart indenter respect all manners of indenting.
Example of funky indenting I do, usually with Declare that involves a boatload of parameters...
Private Declare PtrSafe SomeSillyAPIFunction Lib "SomeSillyDLL" ( _
ByVal ptReserved As LongPtr, _
ByVal lpcstrSomeText As String, _
ByVal dwWords As SomeSillyAPIEnumeration, _
ByRef xxSOME_BIG_STRUCT As SomeSillyStruct, _
ByVal cchSize As Long _
) As Boolean
Or maybe two-headed procedures....
#If LateBind Then
Public Sub DoSomething(OnThis As Object)
#Else
Public Sub DoSomething(OnThis As SomeSpecificType)
#End If
'Body of procedure....
End Sub
There might be few more cases where indenting is done with more weird syntax. I should be able to review the indenting settings and opt-in once I know it will not do wrong things to those edge cases. If it's on by default, that can cause a lot of inconveniences because it isn't immediately visible until I get to those edge cases and go "Woah, who changed that?"
I agree this needs to be opt-in... Although we do handle some weird edge cases better than the original Smart Indenter did - how about an ask-once prompt at startup, like the "Import Smart Indenter settings from registry" prompt?
'@Ignore SmartIndenter would allow for a procedure by procedure exclusion. Not sure I want to be prompted to load indenter settings every time I launch the IDE.
@daFreeMan it would only prompt once, the first time RD starts. I like the annotation idea.
Most helpful comment
I think Opt-In is best choice. Suppose I have funky indenting I want to keep? Not sure if the smart indenter respect all manners of indenting.
Example of funky indenting I do, usually with
Declarethat involves a boatload of parameters...Or maybe two-headed procedures....
There might be few more cases where indenting is done with more weird syntax. I should be able to review the indenting settings and opt-in once I know it will not do wrong things to those edge cases. If it's on by default, that can cause a lot of inconveniences because it isn't immediately visible until I get to those edge cases and go "Woah, who changed that?"