createMethod functionality doesn't work inside if/when/do statements.

Issue #1808 resolved
Justin Julicher created an issue

if you have a simple statement like

if(true && myNonExistantMethod()){
}

it won’t suggest the create method. works with

if(myNonExistantMethod()){

}

Let me know if you can’t replicate.

Comments (11)

  1. Justin Julicher reporter

    Hi Scott,

    This doesn’t seem to be fully resolved yet.

    It seems if you have the first criteria being a method it’s not allowing you to createMethod from it.

  2. Justin Julicher reporter

    As a workaround I put the method I wanted created as a first criteria but got this:

    Main thing being it returned SiteStatusManager?

    Also - if possible it would be good if the parameter names stayed the same or perhaps create a dialog like with the extract method functionality?

    thanks

  3. Scott Wells repo owner

    Let me take a look at the remaining issues. As for not showing a dialog any longer, I know there were updates to the extract method refactoring in 2020.3, and I think they were to make it immediate if possible. I would think I would have had to opt into that, but I'll also see what's going on there. It won't likely happen until next week as I'm currently taking care of Spring '21-related updates with that release coming up this weekend.

    UPDATE: I was confusing two things...creating the new method from an inferred signature--at least in Apex--has never displayed a dialog. The extract method refactoring does.

  4. Scott Wells repo owner

    Okay, I just fixed a number of issues in this area including the ones you've identified here and a few others I discovered during testing. Hopefully that will put this into really good shape, but certainly let me know if you find other issues after taking the next update (shooting for tomorrow morning).

  5. Scott Wells repo owner

    Delivered in 2.1.6.1. As always, let me know if there's something that's not working quite right. And thanks for the feedback!

  6. Log in to comment