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

Fix goto types to include records #52523

Merged
merged 2 commits into from
Apr 13, 2021
Merged

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
@@ -13,7 +13,6 @@ internal static class FSharpNavigateToItemKind
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.

@@ -288,8 +288,6 @@ private static string GetItemKind(DeclaredSymbolInfo declaredSymbolInfo)
{
case DeclaredSymbolInfoKind.Class:
return NavigateToItemKind.Class;
case DeclaredSymbolInfoKind.Record:
return NavigateToItemKind.Record;
Copy link
Member

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?

@@ -179,7 +179,7 @@ public override bool TryGetDeclaredSymbolInfo(StringTable stringTable, SyntaxNod
node.Kind() switch
{
SyntaxKind.ClassDeclaration => DeclaredSymbolInfoKind.Class,
SyntaxKind.RecordDeclaration => DeclaredSymbolInfoKind.Record,
SyntaxKind.RecordDeclaration => DeclaredSymbolInfoKind.Class,
Copy link
Member

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
Member

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
Member

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