Fix rewriter when the sync method is in the same extensions class#110
Draft
0xced wants to merge 1 commit intozompinc:masterfrom
Draft
Fix rewriter when the sync method is in the same extensions class#1100xced wants to merge 1 commit intozompinc:masterfrom
0xced wants to merge 1 commit intozompinc:masterfrom
Conversation
3a210c4 to
48e1da9
Compare
Contributor
Author
|
@virzak Would love to have your eyes on this when you get some spare time. No rush, I just wanted to make sure it didn’t slip through the cracks. |
Contributor
|
Will look at it this weekend probably |
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.
Pull request #108 made sure that EF Core async extensions (such as
AnyAsyncare properly translated to theSystem.Linq.Queryable.Anyextension method).Unfortunately, this introduced a regression. When async and sync methods are in the same extension class (such as ExecuteDeleteAsync and ExecuteDelete) the generated sync method would be wrong. I.e., generated in
System.Linq.Queryableinstead ofMicrosoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.This pull request tries to address this issue. Unfortunately, I'm again facing discrepancies between the
GenerationSandbox.TestsandGenerator.Testsprojects. This is why this pull request is opened a draft.When used in the
GenerationSandbox.Testsproject, the generated code is correct.When generated in the
Generator.Testsproject, the generated code is incorrect. Note how theAnyandExecuteDeletemethods are not generated with their fully qualified names.I don't understand why the generated code is different. I have identified that var symbol = GetSymbol(node) returns null for
InvocationExpressionSyntax InvocationExpression dbSet.AnyAsync(cancellationToken)inGenerator.Testsand not null inGenerationSandbox.Testsbut I don't understand why.