What is the best way in IntelliJ to find out the value of an expression?
For example, in the attached image, I’ve highlighted an expression. I’d like to see its printed value, i.e., the value it would be at runtime. Is this possible?

Alternatively, you can invoke any action by pressing Ctrl+Shift+A (Cmd+Shift+A on macOS) and typing in its name, meaning the suggested previously “Type Info”. It’s not as convenient as a shortcut, but should do in cases when there is no key binding for an action.

On the other hand, I encountered several cases when Type Info didn’t work for expressions. That might be a bug and should probably be reported as such.

HI azolotko , is “Type Info” what I really want? I’d rather see the value than the type. I’ve seen this done with worksheets, but I don’t really understand the relation between worksheets and source code files.

Oh, I see – sorry, I had misread what you were looking for. Obviously, it’s not possible to show the value in the general case, since many expressions are parameterized. It would theoretically be possible to do so for an expression composed solely of literals, but I’m not sure I’ve seen that feature in any IDE…

Sorry, I followed jducoeur’s answer and didn’t even bother to read the initial post

I think the one way to evaluate an expression is to start “Scala Console” (Command+Shift+D on macOS) and then “Send Selection to Scala Console” (Control-Shift-X). Another one is to evaluate it in the debugger.