Allow extensions to provide custom variable/field/etc. name suggestions #78995
Replies: 1 comment
-
|
Moved to #78996. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when you declare an variable of type
List<Person>, it offers the namepersonsinstead of justlist, which makes sense.However, there are other types, particularly those not in the BCL, where this kind of suggestion would be better than the default. For example, imagine a type like this:
And when declaring a variable of type
EntityRef<Person>, the suggestion should bepersonRef. I'm sure there are other types that people have in their code where this kind of enhancement would make sense.As discussed on Discord, the easiest avenue would be to allow an extension to tap into a new extensibility point - given a
ITypeSymbol, give me a list of suggestions, if non returned, continue with normal logic. (There would probably need to be a basic sanity check on the returned suggestions, like max count, max length of identifiers, allowed characters, etc.)Beta Was this translation helpful? Give feedback.
All reactions