-
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
Expose IPropertySymbol.IsAutoProperty as a public API #46682
Comments
We don't typically expose source-only concepts in symbol APIs. For example, symbols do not have a public |
I believe @jnm2 had a good solution here in one of his PRs. SPeciifcally, IPropertySymbol can expose an 'associated symbol' (in this case, the backing field). This would be highly desirable in many scenarios for the IDE. Right now we do the reverse. We go find all fields in teh type and see if they point at the property. Having the reverse already there makes this much simpler and clearer. This would then answer the |
@jnm2 Do you have that PR somewhere? I'd be happy to push it along. |
@CyrusNajmabadi It was basically this commit: 83ecbec which was going to be extracted from #44932 and done on its own. And then the same for event symbols. I'll try to do that sometime soon. Existing issues: |
One thing I noticed that came up a lot internally to Roslyn features was the concept of taking an ISymbol and wanting to obtain an IFieldSymbol, treating the original symbol equally whether it is a field or whether it has an associated field. Some sort of API like that would certainly be nice to enable asking generalized questions about where the state of an object is held. |
@CyrusNajmabadi I finally got it up: #49659 |
Can we file a Roslyn feature request to expose
IPropertySymbol.IsAutoProperty
as a public API?Originally posted by @mavasani in dotnet/roslyn-analyzers#3884
The text was updated successfully, but these errors were encountered: