Skip to content

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

Merged
CyrusNajmabadi merged 8 commits intodotnet:mainfrom
CyrusNajmabadi:cheaperIndex
Oct 17, 2022
Merged

Do not realize member-symbols when producing the symbol-tree index.#64767
CyrusNajmabadi merged 8 commits intodotnet:mainfrom
CyrusNajmabadi:cheaperIndex

Conversation

@CyrusNajmabadi
Copy link
Contributor

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.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner October 16, 2022 20:48
@ghost ghost added the Area-IDE label Oct 16, 2022
if (symbol is INamespaceOrTypeSymbol nt)
if (symbol is INamespaceSymbol namespaceSymbol)
{
foreach (var member in nt.GetMembers())
Copy link
Contributor 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

End Function

<WpfFact>
Public Async Function AddProjectReference_CSharpToCSharp_ExtensionMethod() As Task
Copy link
Contributor 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.

return CreateEmpty(checksum);

var unsortedNodes = ArrayBuilder<BuilderNode>.GetInstance();
unsortedNodes.Add(new BuilderNode(assembly.GlobalNamespace.Name, RootNodeParentIndex));
Copy link
Contributor 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
Contributor Author

@akhera99 @genlu ptal

@CyrusNajmabadi
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@CyrusNajmabadi CyrusNajmabadi merged commit a1c6606 into dotnet:main Oct 17, 2022
@ghost ghost added this to the Next milestone Oct 17, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the cheaperIndex branch October 17, 2022 18:45
@RikkiGibson RikkiGibson modified the milestones: Next, 17.5 P1 Oct 24, 2022
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