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 graph query for records #48451

Merged
merged 2 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Roslyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -1880,8 +1880,12 @@ Global
{2801F82B-78CE-4BAE-B06F-537574751E2E}.Release|x86.Build.0 = Release|x86
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|x86.ActiveCfg = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Debug|x86.Build.0 = Debug|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Release|Any CPU.Build.0 = Release|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Release|x86.ActiveCfg = Release|Any CPU
{9B25E472-DF94-4E24-9F5D-E487CE5A91FB}.Release|x86.Build.0 = Release|Any CPU
Youssef1313 marked this conversation as resolved.
Show resolved Hide resolved
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public IEnumerable<SyntaxNode> GetTopLevelNodesFromDocument(SyntaxNode root, Can
if (!cancellationToken.IsCancellationRequested)
{
if (node.Kind() == SyntaxKind.ClassDeclaration ||
node.Kind() == SyntaxKind.RecordDeclaration ||
node.Kind() == SyntaxKind.DelegateDeclaration ||
node.Kind() == SyntaxKind.EnumDeclaration ||
node.Kind() == SyntaxKind.InterfaceDeclaration ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression
enum E { }
interface I { }
struct S { }
record R1 { }
record R2;
</Document>
</Project>
</Workspace>)
Expand All @@ -36,12 +38,16 @@ Namespace Microsoft.VisualStudio.LanguageServices.UnitTests.Progression
<Node Id="(@3 Type=C)" Category="CodeSchema_Class" CodeSchemaProperty_IsInternal="True" CommonLabel="C" Icon="Microsoft.VisualStudio.Class.Internal" Label="C"/>
<Node Id="(@3 Type=E)" Category="CodeSchema_Enum" CodeSchemaProperty_IsFinal="True" CodeSchemaProperty_IsInternal="True" CommonLabel="E" Icon="Microsoft.VisualStudio.Enum.Internal" Label="E"/>
<Node Id="(@3 Type=I)" Category="CodeSchema_Interface" CodeSchemaProperty_IsAbstract="True" CodeSchemaProperty_IsInternal="True" CommonLabel="I" Icon="Microsoft.VisualStudio.Interface.Internal" Label="I"/>
<Node Id="(@3 Type=R1)" Category="CodeSchema_Class" CodeSchemaProperty_IsInternal="True" CommonLabel="R1" Icon="Microsoft.VisualStudio.Class.Internal" Label="R1"/>
<Node Id="(@3 Type=R2)" Category="CodeSchema_Class" CodeSchemaProperty_IsInternal="True" CommonLabel="R2" Icon="Microsoft.VisualStudio.Class.Internal" Label="R2"/>
Comment on lines +41 to +42
Copy link
Member Author

Choose a reason for hiding this comment

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

The records are currently classified as classes (i.e. shows with the same icon as classes) (See the following image):

image

This might be related to #48127

The icons seem to be internal (not in Roslyn repo), and I also think part of the implementation is internal too.

<Node Id="(@3 Type=S)" Category="CodeSchema_Struct" CodeSchemaProperty_IsFinal="True" CodeSchemaProperty_IsInternal="True" CommonLabel="S" Icon="Microsoft.VisualStudio.Struct.Internal" Label="S"/>
</Nodes>
<Links>
<Link Source="(@1 @2)" Target="(@3 Type=C)" Category="Contains"/>
<Link Source="(@1 @2)" Target="(@3 Type=E)" Category="Contains"/>
<Link Source="(@1 @2)" Target="(@3 Type=I)" Category="Contains"/>
<Link Source="(@1 @2)" Target="(@3 Type=R1)" Category="Contains"/>
<Link Source="(@1 @2)" Target="(@3 Type=R2)" Category="Contains"/>
<Link Source="(@1 @2)" Target="(@3 Type=S)" Category="Contains"/>
</Links>
<IdentifierAliases>
Expand Down