tabs ↹ over ␣ ␣ ␣ spaces

by Jiří {x2} Činčura

View captured variables for lambdas and local functions

20 Aug 2018 1 mins Visual Studio

I don’t know how long this feature is in Visual Studio – maybe because I’m more keyboard-focused -, but I just noticed it and it’s a complete game changer. I mean, now I can’t imagine not having it. 😃

If you hover the mouse over a lambda or a local function the hint shows variables captured. This is so useful, especially if you’re in a performance sensitive code and you don’t want to create (or minimize creating) closures.

Captured variables in lambda

Captured variables in local function

This works in my Visual Studio 2017 15.8.0 (latest at the time of writing) and 15.7.something (don’t remember exactly, because I updated that machine to 15.8.0 in the meantime).

Profile Picture Jiří Činčura is .NET, C# and Firebird expert. He focuses on data and business layers, language constructs, parallelism, databases and performance. For almost two decades he contributes to open-source, i.e. FirebirdClient. He works as a senior software engineer for Microsoft. Frequent speaker and blogger at www.tabsoverspaces.com.