Highlighting of arguments to by-name parameters

Pavel Fatin

In Scala it’s not always obvious when some expression is an argument to a by-name parameter. New highlighting helps to easily spot such expression.

Here’s how it works:

You may also gray-out literals if you wish (disabled by default):

Block expressions are supposed to be called by-name, so, by default, there’s no such highlighting for them:

However, you may turn it on:

The highlighting also works with implicit conversions that use by-name parameter:

Here’s the definition of implicit conversion:

Comments below can no longer be edited.

1 Response to Highlighting of arguments to by-name parameters

  1. Carlos Fau says:

    February 20, 2016

    Hi Pavel,

    Do you is there is a possibility to choose the color used to “highlight” the “by-name” used?

    Thanks