VisualStudio 2017 gray ellipsis below keyword

c#, visual-studio, visual-studio-2017

Solution

There's a code suggestion/refactoring hidden there telling you that what you have written can also be written in some other form while achieving the same functionality.

Till C# 7 i.e. VS 2017, this was the way of writing that but with C#7 inline outs you can reduce it to

return TryGetValue(key, out TValue value) ? value : defaultValue;

You can also declare it `var` which was not possible earlier. So you can write this as

return TryGetValue(key, out var value) ? value : defaultValue;

How to achieve this

Take your cursor to `...` and can see this suggestion in two ways

- Press `Ctrl` + `.` OR

- A roslyn bulb will appear and you can click on it and the drop down will suggest you the same.

Problem

Can anyone tell me what is VisualStudio 2017 trying to tell me with that grey ellipsis below keyword? Neither placing the mouse over it or right-clicking it tells me why is this symbol showing there. (gray ellipsis below "TValue" on the first line of the method)

Original source