You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scope functions are very important to the readability of Kotlin as they can change the context or introduce a variable without much fanfare. I would recommend that we highlight scope functions similar to a when block. This should include all the obvious scope functions (also, apply, let, run, and with). I also think it should include other methods that introduce a scope (e.g. forEach)
foo.apply { // apply should be highlighted
bar().forEach { // forEach should be highlighted// ...
}
addListener("click") { // No special highlight// ...
}
}
It looks like GitHub's highlighter already highlights apply.
The text was updated successfully, but these errors were encountered:
Since I'm not that familiar with Kotlin, I really don't know what the obvious scope functions should be. Also note that a mode like this can only match the property names, without having any clue about the type of the thing that they are a property of, so highlighting run will highlight anyrun property, even when it's not actually the method you are thinking of.
Attached patch adds support for trailing lambda arguments to the mode (I had missed them in the grammar before), and will mark methods and functions called this way with a callee type. Does that help? If you want something different, please be specific.
Scope functions are very important to the readability of Kotlin as they can change the context or introduce a variable without much fanfare. I would recommend that we highlight scope functions similar to a
when
block. This should include all the obvious scope functions (also
,apply
,let
,run
, andwith
). I also think it should include other methods that introduce a scope (e.g.forEach
)It looks like GitHub's highlighter already highlights
apply
.The text was updated successfully, but these errors were encountered: