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

Ensure that the hub client proxy generator correctly processes both explicit and inferred generic type arguments #55862

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

MattyLeslie
Copy link
Contributor

@MattyLeslie MattyLeslie commented May 24, 2024

Fix HubClientProxyGenerator to Handle Inferred Generic Type Arguments

Issue:
The HubClientProxyGenerator was not generating proxy code for methods using inferred generic type arguments. This was because the initial syntax node filter only considered methods with explicit generic types.

Solution:
Updated the syntax node filter to include both explicit and inferred generic type arguments by changing the filter condition to SimpleNameSyntax. This ensures that all relevant methods are processed for proxy generation.

Fixes #43510

github-actions bot and others added 5 commits May 20, 2024 12:38
Update .NET SDK to version 9.0.100-preview.5.24269.5.

---
updated-dependencies:
- dependency-name: Microsoft.NET.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…iew.5.24269.5

Update .NET SDK to 9.0.100-preview.5.24269.5
… class for both GenericNameSyntax and IdentifierNameSyntax
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-signalr Includes: SignalR clients and servers label May 24, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 24, 2024
@MattyLeslie MattyLeslie marked this pull request as ready for review May 28, 2024 10:16
Copy link
Member

@BrennanConroy BrennanConroy left a comment

Choose a reason for hiding this comment

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

MattyLeslie and others added 4 commits May 30, 2024 17:31
…or-correctly-processes-both-explicit-and-inferred-generic-type-arguments
…sses-both-explicit-and-inferred-generic-type-arguments' of https://github.com/mattyleslie/aspnetcore into ensure-that-the-HubClientProxyGenerator-correctly-processes-both-explicit-and-inferred-generic-type-arguments
@MattyLeslie MattyLeslie marked this pull request as draft May 31, 2024 07:19
…or-correctly-processes-both-explicit-and-inferred-generic-type-arguments
@MattyLeslie
Copy link
Contributor Author

image
image

Hey @BrennanConroy, I added tests to HubClientProxyGeneratorTests, however after opening HubClientProxyGeneratorTests & HubServerProxyGeneratorTests when building I get an error with GetHubServer as depicted in the screenshots, when switching to the main branch, I am still presented with the errors. I don't see anything I've changed to attribute this to. I've tried re-setting my local environment to no avail. I just wanted to reach out to you and ensure I'm not missing something. Any direction would be appreciated.

@BrennanConroy
Copy link
Member

I think VS has some weird behavior with source generators being referenced via project reference. Sometimes building via the command line first might help. But the issue in the PR looks like you just need to make MyClient public or internal.

…sses-both-explicit-and-inferred-generic-type-arguments' of https://github.com/mattyleslie/aspnetcore into ensure-that-the-HubClientProxyGenerator-correctly-processes-both-explicit-and-inferred-generic-type-arguments
@MattyLeslie MattyLeslie marked this pull request as ready for review July 5, 2024 07:45
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Jul 12, 2024
…or-correctly-processes-both-explicit-and-inferred-generic-type-arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers community-contribution Indicates that the PR has been added by a community member pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HubClientProxyGenerator doesn't run when using inferred generic type arguments
3 participants