logos-format icon indicating copy to clipboard operation
logos-format copied to clipboard

Issue with %init and objc_getClass()

Open strejda603 opened this issue 2 years ago • 0 comments

Hello!

Thank you for this script, it is VERY useful!

I just found one issue: When I have some objc_getClass() functions inside %init and I format it, the script splits every function on new line and Theos then throws an error "warning: tried to set expression for unknown class or function SomeClass1 in group _ungrouped". If I want to get rid of this error, I need to revert formatting of this %init to one line.

Could you please update your script to prevent new lines for this case?

This is what I get after formatting (gives me an error):

%ctor {
  %init(
      SomeClass1 = objc_getClass("Some.Class1"),
      SomeClass2 = objc_getClass("Some.Class2"),
      SomeClass3 = objc_getClass("Some.Class3"));
};

This is what it should looks like (compiles correctly):

%ctor {
  %init(SomeClass1 = objc_getClass("Some.Class1"), SomeClass2 = objc_getClass("Some.Class2"), SomeClass3 = objc_getClass("Some.Class3"));
};

Thank you!

strejda603 avatar Jul 03 '23 19:07 strejda603