You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when you declare an variable of type List<Person>, it offers the name persons instead of just list, 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:
structEntityRef<T>{publicintId{get;set;}}
And when declaring a variable of type EntityRef<Person>, the suggestion should be personRef. 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.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
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.)All reactions