Child pages
  • Rename refactoring
Skip to end of metadata
Go to start of metadata

To rename a variable, method, parameter, class etc. position the caret at the symbol you want to rename and press Shift+F6.

An in-place editor opens. IntelliJ IDEA will automatically replace all the occurrences as you type.

Icon

Alternatively you can open the Refactor menu and select Rename.


Icon

If you rename a class in a file with same name, the file is also renamed; the same is true for companion objects---they are renamed as well.

Icon

Renaming of apply methods is not always safe and may break your code.

  • No labels