使用IntelliJ IDEA进行快速对象实例化

时间:2018-03-12 03:58:54

标签: java intellij-idea

有时我需要使用以下模式实例化新对象

N @angular/common@4.4.6 requires a peer of @angular/core@4.4.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/compiler@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser-dynamic@^4.0.0 but none is installed. You must install peer dependencies yourself.

IntelliJ IDEA是否有任何快捷方式,实时模板或任何其他方式可以根据 ObjectName objectName = new ObjectName(); 快速完成此类陈述?

1 个答案:

答案 0 :(得分:3)

您可以输入:

new ObjectName().var并按 Tab

让IntelliJ将其扩展为:

ObjectName objectName = new ObjectName();