Extract Parameter

Extract code to a parameter.

Highlight the code you want to extract to a field and press ⌥⌘P (macOS) / Ctrl+Alt+P (Windows/Linux), to extract it.

Extracting parameters can be useful in improving the readability of your code.


Related Resources

Extract Method
Extract Method
Extract code to a new method.
Inline Variable
Inline Variable
Sometimes inlining a variable can make your code more readable.
Introduce Variable
Introduce Variable
Refactor your code and introduce a new variable right when you need it.