Kotlin:为什么Android Studio中的大多数变量都有下划线,如何将其关闭?

时间:2016-01-23 13:20:23

标签: android-studio syntax-highlighting kotlin

我想知道为什么Kotlin中的大多数变量都有下划线。有些文件包含很多下划线,非常烦人。如果我将鼠标悬停在变量上,它在大多数情况下都不会提供任何信息。但有些人说“这个属性有一个支持字段”或“在一个关闭中捕获的值”。有人知道如何禁用这些下划线吗?这是我的意思的屏幕截图: enter image description here

然后在整个文件中强调领域。

2 个答案:

答案 0 :(得分:62)

这只是编辑偏好。

修改

将其移至

Preferences -> Editor -> Colors & Fonts -> Kotlin -> Properties and Variables

enter image description here

感谢rmirabelle的评论

对于旧插件,您可以转到

Preferences -> Editor -> Colors & Fonts -> Kotlin

然后找到Var (mutable variable, parameter or property)并删除Underscored效果。

我猜他们只是试图通过添加恼人的强调来阻止使用var。 :P

old plugin

答案 1 :(得分:0)

在Android Studio 3.1.2中,它已移至-

<ion-card *ngFor="let ts of songs_data.trending_songs" [routerLink]="'/main/home/songs/' + ts.id" routerDirection="forward">

enter image description here