-
Notifications
You must be signed in to change notification settings - Fork 469
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
RS0046 code fix introduces compilation errors when names are aliased #3813
Comments
Dupe of #3707. @Evangelink actually tried to implement it but couldn't figure out the right API usage - LookupSymbols seems to not provide existing symbols in scope. |
💭 I'm not sure this is a duplicate. It seems related but not exactly the same. |
I did some debugging to try and understand why I don't get the right results and I have noticed that even when called from a method parameter location the Now the question is, shall I pass the method body/expression body as a diagnostic argument to avoid the "complex" logic in the code-fix or shall I do the detection from the code-fix. Note that there is at least one more rule that will have to reuse the logic so depending on how we implement it we might be better off with a helper method. |
The first thing I would look at is how Roslyn's name suggestion completion provider avoids conflicts when suggesting names. |
@sharwell Do you have some usage example? I don't know this api/feature. |
Ping @sharwell |
Analyzer package
Unknown
Package Version
3.3.0-beta1.20262.5
Diagnostic ID
RS0046
Repro steps
Apply the code fix for RS0046.
Expected behavior
The resulting code compiles without errors.
Actual behavior
The code does not compile due to a conflict with the name
selection
.The text was updated successfully, but these errors were encountered: