Fix rename test flakeyness with dynamic types.#43631
Conversation
| // assembly). So we have to keep track of it so we can get back from it to a project in case the | ||
| // underlying compilation is GC'ed. | ||
| if (compilation.Language == LanguageNames.CSharp) | ||
| result.Add(compilation.DynamicType, null); |
There was a problem hiding this comment.
language check is deliberate as VB does not support this and just throws.
| foreach (var (projectId, tracker) in _projectIdToTrackerMap) | ||
| { | ||
| // VB doesn't have DynamicTypes (and throws if you ask for them), so just check C# projects. | ||
| if (tracker.TryGetCompilation(out var compilation) && |
There was a problem hiding this comment.
this was hte failure point from before. it was possible to hold onto a dynamic type, while it's compilation could still get GC'ed underneath it. so later when we walked the solution looking for it, we wouldn't get a compilatino back from any tracker, and so we wouldn't find this symbol.
src/Workspaces/Core/Portable/Workspace/Solution/SolutionState.SymbolToProjectId.cs
Outdated
Show resolved
Hide resolved
sharwell
left a comment
There was a problem hiding this comment.
Would be good to have a second review. I feel like I mostly understand this but it's a new area for me.
…SymbolToProjectId.cs Co-Authored-By: Sam Harwell <sam@tunnelvisionlabs.com>
|
Tagging @jasonmalinowski as well as he reviewed the initial PR introducing the back-references from symbol to projects. |
|
Would like to move forward on this to aid with CI. But happy to make more changes if people want them. |
No description provided.