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 symbol-finder crash in mixed C#/TypeScript projects #60173

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

CyrusNajmabadi
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi commented Mar 14, 2022

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 14, 2022 22:48
@@ -358,8 +360,7 @@ private static void AddRange(SymbolSet foundTypes, SymbolSet currentTypes, Func<
// that actually supports compilations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Either this comment is wrong, or your removal of the Where is wrong, but I have no idea which

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. That's fair.

@@ -358,8 +360,7 @@ private static void AddRange(SymbolSet foundTypes, SymbolSet currentTypes, Func<
// that actually supports compilations.
Copy link
Member

Choose a reason for hiding this comment

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

Comment needs update

Copy link
Contributor

@ryzngard ryzngard left a comment

Choose a reason for hiding this comment

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

Would love a short description of what was crashing here :)

Otherwise I think code looks reasonable and test added looks to cover scenario.

@@ -29,7 +29,7 @@ internal static partial class DependentTypeFinder
var client = await RemoteHostClient.TryGetClientAsync(solution.Workspace, cancellationToken).ConfigureAwait(false);
if (client != null)
{
var projectIds = projects?.SelectAsArray(p => p.Id) ?? default;
var projectIds = projects?.Where(p => RemoteSupportedLanguages.IsSupported(p.Language)).SelectAsArray(p => p.Id) ?? default;
Copy link
Member

Choose a reason for hiding this comment

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

Is this required for the fix, or just an optimization?

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 is required. Oop doesn't support other languages and crashes trying to find these projects on the other side.

@CyrusNajmabadi CyrusNajmabadi merged commit ca64a6d into dotnet:main Mar 15, 2022
@ghost ghost added this to the Next milestone Mar 15, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the depTypeCrash branch March 15, 2022 16:02
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 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.

5 participants