intellij-idea - Groovy 和 IntelliJ : how to extract variable with explicit type declaration?

标签 intellij-idea groovy refactoring

如何在 IntelliJ 中的 Groovy 中提取变量 (cmd+alt+v) 以获取此信息:

Car car = new Car()

而不是这个?
def car = new Car()

最佳答案

def 上使用 Shift + Tab并选择类型。下次 Intellij 将使用指定的类型。

关于intellij-idea - Groovy 和 IntelliJ : how to extract variable with explicit type declaration?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34767972/

相关文章:

javascript - 过滤一系列控件并操作它们

python - 自动简化/重构 Python 代码(例如 for 循环 -> 列表理解)?

安卓工作室 : no executable code found at line X on every line

java - IntelliJ 可以自动创建装饰器类吗?

grails - 从 Config.groovy 在 resources.xml 中配置 Spring Integration XML

xml - Groovy - 如何退出每个循环?

tomcat - 在 IntelliJ 中运行 Tomcat 时,如何更改控制台中 [INFO] 的颜色?

java - 无法使用intellij在tomcat上启动应用程序

html - 如何在<g:select>或<select>标记中显示也是 map 的 map 的值?

unit-testing - 在测试驱动开发中重构时添加测试