Skip to content

Fix goto types to include records#52523

Merged
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
Youssef1313:goto-types
Apr 13, 2021
Merged

Fix goto types to include records#52523
CyrusNajmabadi merged 2 commits intodotnet:mainfrom
Youssef1313:goto-types

Conversation

@Youssef1313
Copy link
Member

image

Fixes #51672

@jcouv FYI for record structs work.

@Youssef1313 Youssef1313 requested review from a team as code owners April 9, 2021 17:32
@Youssef1313 Youssef1313 requested a review from a team April 9, 2021 17:32
@ghost ghost added the Area-IDE label Apr 9, 2021
public static string Line => NavigateToItemKind.Line;
public static string File = NavigateToItemKind.File;
public static string Class => NavigateToItemKind.Class;
public static string Record => NavigateToItemKind.Record;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case DeclaredSymbolInfoKind.Class:
return NavigateToItemKind.Class;
case DeclaredSymbolInfoKind.Record:
return NavigateToItemKind.Record;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a little confused how this works. if you remove this entry, and we do run into a record, won't we crash in this switch?

{
SyntaxKind.ClassDeclaration => DeclaredSymbolInfoKind.Class,
SyntaxKind.RecordDeclaration => DeclaredSymbolInfoKind.Record,
SyntaxKind.RecordDeclaration => DeclaredSymbolInfoKind.Class,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so i liek the old way this worked. DeclaredSymbolInfoKind is roslyn specific, so it can represent Record here. What i think we should do though i just map this to Class at the boundaries of NavTo.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CyrusNajmabadi The current approach is more simpler. Just treat records as classes (and later, record structs as structs). Especially that we don't need any special handling for records. But let me know if you still think otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I don't like it. Within roslyn itself, I think we should represent fully. Just at it boundaries would we marshall differently

@jcouv jcouv added the Feature - Records Records label Apr 10, 2021
@Youssef1313
Copy link
Member Author

@CyrusNajmabadi I addressed your feedback.

@CyrusNajmabadi CyrusNajmabadi merged commit e0bfe26 into dotnet:main Apr 13, 2021
@CyrusNajmabadi
Copy link
Contributor

thanks!

@ghost ghost added this to the Next milestone Apr 13, 2021
@Youssef1313 Youssef1313 deleted the goto-types branch April 13, 2021 08:11
@dibarbet dibarbet modified the milestones: Next, 16.10.P3 Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Go to all" and "Go to types" don't work for records

4 participants