Do not realize member-symbols when producing the symbol-tree index.#64767
Merged
CyrusNajmabadi merged 8 commits intodotnet:mainfrom Oct 17, 2022
Merged
Do not realize member-symbols when producing the symbol-tree index.#64767CyrusNajmabadi merged 8 commits intodotnet:mainfrom
CyrusNajmabadi merged 8 commits intodotnet:mainfrom
Conversation
CyrusNajmabadi
commented
Oct 16, 2022
| if (symbol is INamespaceOrTypeSymbol nt) | ||
| if (symbol is INamespaceSymbol namespaceSymbol) | ||
| { | ||
| foreach (var member in nt.GetMembers()) |
Contributor
Author
There was a problem hiding this comment.
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.
CyrusNajmabadi
commented
Oct 16, 2022
| End Function | ||
|
|
||
| <WpfFact> | ||
| Public Async Function AddProjectReference_CSharpToCSharp_ExtensionMethod() As Task |
Contributor
Author
There was a problem hiding this comment.
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.
CyrusNajmabadi
commented
Oct 16, 2022
| return CreateEmpty(checksum); | ||
|
|
||
| var unsortedNodes = ArrayBuilder<BuilderNode>.GetInstance(); | ||
| unsortedNodes.Add(new BuilderNode(assembly.GlobalNamespace.Name, RootNodeParentIndex)); |
Contributor
Author
There was a problem hiding this comment.
moved this into GenerateSourceNodes so no need for two helpers.
Contributor
Author
93e88d3 to
c7fd590
Compare
Contributor
Author
|
/azp run |
|
Azure Pipelines successfully started running 4 pipeline(s). |
akhera99
approved these changes
Oct 17, 2022
genlu
approved these changes
Oct 17, 2022
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous approach would recurse arbitrarily into types, producing all child symbols, just to get their names. The new approach just uses the simpler
.MemberNamesproperty to read out the names, without realizing the member symbols.