How do I get IntelliJ to generate a new method ?

Answered

In Eclipse I can type something like the following where the method does not exist in the class

  ShipmentDataReader.getShipmentByShipmentId(shipmentId);

and Eclipse gives me the option to create the method with the appropriate arguments.

How do I do this in IntelliJ?  Alt+Enter does nothing.  Generate doesn't give me the option to create this method.  Note that I'm not implementing an interface method or doing an override.  I just need to create the new method in the class.

 

Thanks.

 

0
2 comments

Alt+Enter on the red code should suggest to create a new method.

0

It turns out the problem was that the variable name I was using as an argument was incorrect.  Once I corrected that Alt+Enter worked.

0

Please sign in to leave a comment.