custom refactorings, defined by IntelliJ user
I am just curious, if there're ways to define "custom refactorings" without writing a plugin for that.
For example, user would want to hit "record" button, implement some changes on a class, then same changes on another class, and as soon as IDE detects a pattern, it would signalize that to user. Then they could assign a name, menu position and a keyboard shortcut for that sequence of actions, thus creating "custom refactoring" of sorts. Not sure if any other IDE does it already.
Or maybe IntelliJ already has something similar? It's such a huge tool, you never know )
For example, I would like to introduce a couple of "private final" fields *AND* corresponding parameters into constructors. Doing it manually is.. tedious :) there certainly might be yet other use cases for such a functionality.
请先登录再写评论。
You can use structural search and repalce for that: https://www.jetbrains.com/help/idea/structural-search-and-replace.html
See also the thread here: https://youtrack.jetbrains.com/issue/IDEA-168056
thanks for the hint!
would that be possible to define such refactoring using SSR:
replace `someCall(value)` with `value` (have a context action defined that would be available when the caret is placed on "value", whatever it is)
?