-
Notifications
You must be signed in to change notification settings - Fork 4k
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
GetSymbolInfo behaves differently in msbuild from the IDE #5362
Comments
Sorry we're just getting around to this. There are only two items I can think of that MSBuild would influence here which could explain this:
It's hard to determine which is the case based on the bug info. My instinct is to lean towards 1. Are you able to test locally and see which is the case? |
I'm unable to reproduce this locally hence closing. Please comment back if you have additional information that could help me repro this issue. |
I tried it and it still happens. maybe it is easier to repro it like this:
|
After some research I think I have some more information. I think the problem is, that this statement is not true in this case. The BindIdentifier method does not handle the "Color Color" case but it should. I dont have time to look into this further, but I think it might have to call BindLeftOfPotentialColorColorMemberAccess at some point or the caller of BindIdentifier has to do that. |
I think I found the commit that is causing this problem: 92b896ba This would explain why I saw different results before, probably because of different version of roslyn with and without this change |
Thanks for the additional information @pdelvo. |
…yntax An ArrowExpressionClauseSyntax is special because it has an expression as its direct child. Because of that the binder was not correctly caching all nodes of the bound tree and instead was falling back to binding decendand nodes by themself when asked for them. This fails if in the decendant nodes there is a color color case. With this change the binder does cache all of the ArrowExpressionClauseSyntax's children including the correctly resolved symbols for a color color situation. Fixes #5362 Closes #8167
Integrated into future in 7d02e6c . |
Over at StyleCopAnalyzers we got this bug report. When investigating I discovered that the problem only was showing up when the analyzer ran on the command line (or our testing application) but not in the IDE. The problem was that
GetSymbolInfo
was returning two different answers when resolving this symbol:In the IDE it returned the symbol of the enum (which is correct). On the command line however the symbol of the
Lifetime
property was returned. It looks like the bug only shows up when the symbol is on an ArrowExpressionClause. The bug also shows up if the property has a different name and there is different Property with the nameLifetime
:The text was updated successfully, but these errors were encountered: