Search code examples
javaintellij-ideamethodsauto-generate

How to paste custom code when I create a method automatically in IntelliJ IDEA?


In the IntelliJ IDEA I can create automatically a method. I write the name of the method and if it doesn't exist, the IDE prompts to create it.

I want IDEA to paste the code //TODO: write method ${nameOfMethod} in the body, when it creates a new method automatically. How can I do that?


Solution

  • I found a solution. The solution:

    1. Open Settings.
    2. Open File and Code Templates.
    3. Open New Method Body.
    4. Paste the code: //TODO: to write the method ${METHOD_NAME}

    enter image description here