简体   繁体   English

Scala-IDE-如何导航到推断类型

[英]Scala-IDE - how to navigate to inferred type

I'm wondering whether in Scala-IDE is there possibility to jump from inferred value/variable to type of this variable. 我想知道在Scala-IDE中是否有可能从推断的值/变量跳到该变量的类型。 I can only see type information in tooltip while hovering over variable. 将鼠标悬停在变量上时,只能在工具提示中看到类型信息。

您可以使用Ctrl + Shift + T查找在工具提示中看到的类型。

There is a slightly better workaround in the current nightlies of Scala IDE. 当前每夜的Scala IDE中有一个更好的解决方法。 A feature has been added to make inferred types explicit. 添加了功能以使推断的类型明确。

Put the caret on the line declaring the val/var and use Ctrl+1 . 将插入号放在声明val / var的行上,然后使用Ctrl+1 You should see the quick fix Add explicit type ... . 您应该看到快速修复Add explicit type ... Then you can navigate to the type. 然后,您可以导航到类型。

If you have a good idea on how to improve the UI to make this navigation possible, please open a feature request . 如果您对如何改善用户界面以实现导航有个好主意,请打开功能请求

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM