Modify Surround With "if respondsToSelector" behavior?

I love the Surround With if respondsToSelector, particularly since AppCode doesn't do a particularly good job of suggesting selector completions on protocols. However, it's annoying that AppCode insists on extracting the target object into a variable "o" that gets used in both the if statement and the actual call:

 
[self.delegate multipeerConnectionDidOpenConnection:self];


Becomes:

 
id <MultipeerConnectionDelegate> o = self.delegate;
if
([o respondsToSelector:@selector(multipeerConnectionDidOpenConnection:)]) {
    [o multipeerConnectionDidOpenConnection:self];
}


It's unnecessary and somewhat confusing, so I have to take the time to copy "self.delegate" and paste it back in place of the "o" variables, then deleting the first line. I would like the option to disable the variable extraction for this operation. Thanks!

3 comments
Comment actions Permalink

Joshua, may we ask you to file a request in the tracker?

0
Comment actions Permalink

I'd be happy to... what's the URL? Is it just the regular Issue Tracker?

0
Comment actions Permalink

Yes, it's a regular public issue tracker, here you go: https://youtrack.jetbrains.com/issues/OC

0

Please sign in to leave a comment.