java - IntelliJ shortcut refactor object to list of objects -
lets have method signature:
public string get(){}; is there shortcut in intellij highlight string , surround list<> can following:
public list<string> get(){};
you can make own surround live template:
- go
settings/preferences > ide settings > live templates > surround. - add new template.
- fill in form
- the abbreviation used select
surround withcontext menu. - the description appear in
surround withcontext menu. - the
$selection$variable predefined as, guessed it, selected text. - you can add own variables, such
$coll$make template more generic. - set
applicable in...of java (or can more exact if want).
- the abbreviation used select

to use it:
- select text.
- press ctrl+alt+t on windows or ⌥⌘t on mac
- the
surround withcontext menu appear new template.
- the
- press c (since that's first letter of template's abbreviation) select template.

- intellij blog post feature: "surround with..."
Comments
Post a Comment