Can Uncrustify align colons in Objective-C method calls?

后端 未结 2 1287
自闭症患者
自闭症患者 2020-12-08 16:42

I am using uncrustify 0.52. When I run it against Objective-C files, it wants to convert method invocations like this:

[NSApp beginSheet:startTimerDialog
           


        
相关标签:
2条回答
  • 2020-12-08 17:10

    Did you try:

    align_var_def_colon=true
    
    0 讨论(0)
  • 2020-12-08 17:11

    I played around with this for some time last night, and (although I don't think that this deserves the bounty) the answer to both your questions is "no, current versions (.53) of Uncrustify do not do this."

    I even investigated writing a patch to do exactly this (because I really want it, too) and after looking at the Uncrustify source, and concluded it would take far more time than I had available to figure out where to insert the patch to accomplish "multi-line message parameter colon alignment" rather than "multi-line message left alignment" It does seem that there has been some improvements to Objective-C parsing in recent patches.

    I was so hoping someone would answer this question. I really wanted to know, too.

    NOTE: For people who find this answer in the future: The name of the preference in the .cfg file has been changed. It is now align_oc_msg_colon_span = 1 to get the behavior described above. There is also now a align_oc_decl_colon that will do the name thing for multi-line declarations.

    0 讨论(0)
提交回复
热议问题