-
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
Quick info on field
exposes generated member name, unlike on accessors
#75529
Comments
Probably the fix belongs in SymbolDisplay? |
Just be curious: what will be displayed in quick info for such backing field? |
I think |
Doing a quick check for what additional behaviors need to be specified, using property accessors (e.g.
I am not seeing any options or tests which apply customization of how a property accessor name is displayed. I don't think we should offer any option to, for example, omit the I am also thinking that the symbol display behavior should be independent of LangVersion. I do not think that SymbolDisplayVisitor.Members has any existing cases of language version affecting the way symbols are displayed. |
I'd prefer just naming the property. Is there a reason that would not be suitable? |
That would be confusing, because the tracked-null state of |
Agree with @jnm2. The backing field is a distinct symbol, and when using the backing field, it is helpful to be clear that is what you are using and not the containing property. |
Ah ok. |
@RikkiGibson why is this marked as "api-ready-for-review". I don't see any API changes in the comments here. |
It was suggested in offline conversation with @cston that we should run this scenario by API review to decide if we want to introduce any symbol display options related to this feature. |
I think an email discussion with the api review alias, or with the owner of the api (@AlekseyTs and myself) is the appropriate first step here, rather than bringing it to the entire api review meeting. |
We discussed on the internal mailing list and got several folks on board with the suggested design.
|
@RikkiGibson Quick question: is the type in |
For now, I am expecting the field to have, and show, the same type and nullable annotation as the containing property. If we move forward with null-resilient getters, I am not sure yet whether the inferred nullability should surface in the symbol model. Basically, it seems risky to make it so accessing the Though, FWIW, we know that work is already done and being surfaced in the Quick Info case. |
It didn't occur to me that changing this behavior for all backing fields would break a billion test baselines, but I will still do it. |
Version Used: 17.12 Preview 3.0
The metadata name of the backing field is being displayed:
But accessors don't show the metadata name of the generated accessor methods:
Perhaps instead, this could show
int C.P.field
?The text was updated successfully, but these errors were encountered: