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

Go To Definition should go to Deconstruct() in deconstructing assignments #16529

Closed
SLaks opened this issue Jan 16, 2017 · 5 comments
Closed
Assignees
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Milestone

Comments

@SLaks
Copy link
Contributor

SLaks commented Jan 16, 2017

When I press F12 on the = token in (a, b) = blah (where blah has a Deconstruct()), can you open the Deconstruct() method?

Just like F12 already opens operator overloads.

This would help people understand how tuples work in general, and would be quite helpful when navigating an unfamiliar codebase that uses custom deconstructable types.

@CyrusNajmabadi
Copy link
Member

I might broaden this to include any sort of explicit conversion. It's a nice idea.

@CyrusNajmabadi CyrusNajmabadi added the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Jan 16, 2017
@SLaks
Copy link
Contributor Author

SLaks commented Jan 16, 2017

Conversions are less obvious, because they aren't associated with the = token (they can also happen at any other conversion site, such as passing a parameter.

@gafter
Copy link
Member

gafter commented Jan 16, 2017

@SLaks Deconstruction doesn't always happen at the =.

foreach (var (x, y) in e) // deconstruct on each element
var (x, (y, z)) = e; // nested deconstruction

@SLaks
Copy link
Contributor Author

SLaks commented Jan 16, 2017

Good point.
For nested deconstructions, pressing F12 on = could show a FindSymbolResults window with every Deconstruct method being called (which may include duplicates). The TODO in my PR will do that.

For foreach, I'm not sure; maybe link to the in?
Or give up and not support foreach.

SLaks added a commit to SLaks/roslyn that referenced this issue Jan 18, 2017
@Pilchie Pilchie added the Bug label Jan 20, 2017
@Pilchie Pilchie added this to the Unknown milestone Jan 20, 2017
@jcouv
Copy link
Member

jcouv commented May 28, 2017

Relates to #18963 (Find All References on Deconstruct method).

@jcouv jcouv modified the milestones: Unknown, 16.0 Nov 6, 2017
@jcouv jcouv modified the milestones: 16.0, 15.8 Apr 6, 2018
@jcouv jcouv self-assigned this Apr 6, 2018
@jcouv jcouv added the 4 - In Review A fix for the issue is submitted for review. label Apr 6, 2018
@jinujoseph jinujoseph removed the help wanted The issue is "up for grabs" - add a comment if you are interested in working on it label Apr 6, 2018
@jinujoseph jinujoseph added Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented and removed 4 - In Review A fix for the issue is submitted for review. labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Bug Resolution-Fixed The bug has been fixed and/or the requested behavior has been implemented
Projects
None yet
Development

No branches or pull requests

6 participants