Android Studio/IntelliJ 中的 `^let` 注释是什么? [英] What are the `^let` annotations in Android Studio / IntelliJ?

查看:45
本文介绍了Android Studio/IntelliJ 中的 `^let` 注释是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个 let 块中,我有时会在我的语句之前看到 ^let 注释,我不清楚它们的意思或它们为什么存在.

In a let block, I sometimes see ^let annotations before my statements, and it's not clear to me what they mean or why they are there.

是不是表示会返回一个值作为let调用的值?

Is it to indicate that a value will be returned as the value of the let call?

截图:

推荐答案

这些实际上表明这些值将从 let 表达式返回.如果您将光标移至这些提示之一并打开意图操作(Alt + Enter),您将获得不显示 lambda 返回表达式提示"选项,我想这是这个新功能的名称功能.

These do in fact show you that those values are going to be returned from the let expression. If you move to cursor to one of these hints and open intention actions (Alt + Enter), you get the option "Do not show lambda return expression hints", which I suppose is the name for this new feature.

此更改是在 Kotlin 1.2.20 中引入的,请参阅 这篇文章.

This change was introduced in Kotlin 1.2.20, see IntelliJ IDEA Plugin Improvements in this post.

这篇关于Android Studio/IntelliJ 中的 `^let` 注释是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆