Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5, Page 200 #65

Open
HoshyarKarimi opened this issue May 23, 2022 · 2 comments
Open

Chapter 5, Page 200 #65

HoshyarKarimi opened this issue May 23, 2022 · 2 comments

Comments

@HoshyarKarimi
Copy link

whenever I hover the mouse over the viables, classes, or simply anything, it shows me the reference like:
var thing2 = (bob.Name, bob.Chidren.Count);
if I hover the mouse over var it shows: (string Name, int Count)
but that doesn't happen when I hover mouse over var while deconstruction in:

// deconstructing a person
var (name1, dob1) = bob;

is there a reason for it? it makes me confused.
Thanks in advance

@markjprice
Copy link
Owner

In all cases except deconstruction there is a single object so the tooltip shows the info about that variable. When you use deconstruction, there are multiple variables so hovering over var it does not know which variable info to show. You must hover over the named variables instead. Even though you only type one var, in effect you have multiple. So var (name, age)... is more like var name, var age...

@markjprice
Copy link
Owner

That is my assumption anyway. It all depends on who designed how that feature of Visual Studio should work. You'd need to ask the Microsoft product manager who designed that feature to get a definitive answer. They could have decided to implement it a different way, perhaps showing a tooltip with multiple rows for each variable, but I can imagine that getting messy. I think they made the right decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants