swiftlang / swift-docc-render

Web renderer for Swift-DocC documentation.
Apache License 2.0
312 stars 52 forks source link

Only indent Objective-C method declarations #860

Closed mportiz08 closed 4 months ago

mportiz08 commented 4 months ago

Bug/issue #, if applicable: 129590639

Summary

This prevents bugs where the indentation formatting code is mistakenly executed with declarations that are not Objective-C methods.

Since this formatting code was designed for only those kinds of method declarations, this added check will enforce this requirement more strictly, preventing bugs where this code may currently execute with other kinds of Objective-C (or other C family) symbols.

Testing

Steps:

  1. Verify that there are no regressions with the way that Objective-C instance/class methods are formatted—the colon character is aligned across multiple lines when methods have multiple parameters.
  2. Verify that there are no unexpected newlines introduced for other kinds of C-family declarations that may have parameters but aren't Objective-C instance/class methods (specific example: C++ functions with namespaced parameters)

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

mportiz08 commented 4 months ago

@swift-ci test