What is the meaning of a yellow and italic method name in Android Studio, such as in this screenshot:
Asked
Active
Viewed 363 times
2 Answers
1
Yellow and italic is an indication for extension function in Kotlin

Konstantin Raspopov
- 1,565
- 1
- 14
- 20
-
Is `String.isBlank()` an extension function? – xjcl Nov 29 '20 at 13:58
-
This extension is actually defined for `CharSequence`. So, yes, it's an extension function `CharSequence.isBlank()` – Konstantin Raspopov Nov 29 '20 at 20:00
-
(1) So my answer is wrong? (2) Why is this defined as an extension function rather than a method? – xjcl Nov 29 '20 at 21:41
-
You're right, I tried `String.subSequence` which is directly implemented as member method, and it didn't highlight! – xjcl Nov 29 '20 at 21:43
-
Could you cite a source in your answer? – xjcl Nov 29 '20 at 21:44
-
@xjcl This is a part of the color theme `Darcula` and it's configurable. You can find it in the IDE settings: `Editor -> Color Scheme -> Kotlin -> Functions -> Extension function call` – Konstantin Raspopov Nov 29 '20 at 22:25
-
Ah, I see! Thanks a lot! – xjcl Dec 01 '20 at 10:37
0
Kind of guessing here since I can't find the answer online.
Italic: Functions defined in Kotlin, such as unescapeHtml
(which I defined elsewhere in this Kotlin app) and thread
. Not to be confused with Java static methods.
Italic Yellow: Extension functions defined in Kotlin, whereas normal methods have no color (e.g. marker.showInfoWindow()
or other methods of this class). Note that this means String.isBlank()
and .apply/let/run
are actually implemented as extension methods!

xjcl
- 12,848
- 6
- 67
- 89