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

Do not realize member-symbols when producing the symbol-tree index. #64767

Merged
merged 8 commits into from
Oct 17, 2022

Conversation

CyrusNajmabadi
Copy link
Member

The previous approach would recurse arbitrarily into types, producing all child symbols, just to get their names. The new approach just uses the simpler .MemberNames property to read out the names, without realizing the member symbols.

{
foreach (var member in nt.GetMembers())
Copy link
Member Author

Choose a reason for hiding this comment

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

this was hte problem before. GetMembers() would realize all symbols both for namespaces and for types. now we only realize all children for namespaces (which is just other namespaces and types), but for types we only realize child types.

Copy link
Member

Choose a reason for hiding this comment

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

makes sense

@@ -302,6 +302,60 @@ namespace CSAssembly2
Await TestMissing(input)
End Function

<WpfFact>
Public Async Function AddProjectReference_CSharpToCSharp_ExtensionMethod() As Task
Copy link
Member Author

Choose a reason for hiding this comment

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

Was missing a test for this scenario. i found this because i originally changed recursion to only hit types, and not see members at all. that didn't break anything, which i knew must be wrong. added this, showed that it did indeed break.

@@ -122,87 +123,102 @@ private static async Task<Checksum> ComputeSourceSymbolsChecksumAsync(ProjectSta
if (assembly == null)
return CreateEmpty(checksum);

var unsortedNodes = ArrayBuilder<BuilderNode>.GetInstance();
unsortedNodes.Add(new BuilderNode(assembly.GlobalNamespace.Name, RootNodeParentIndex));
Copy link
Member Author

Choose a reason for hiding this comment

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

moved this into GenerateSourceNodes so no need for two helpers.

@CyrusNajmabadi
Copy link
Member Author

@akhera99 @genlu ptal

@CyrusNajmabadi
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

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

Successfully merging this pull request may close these issues.

4 participants