-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
With the advent of init in C# 9.0, we have an opportunity here to enhance the workflow for developers.
Currently, code-completion for classes leaves you hanging at the end of the completed class name, with no parens or initialization brackets.
For a class which contains init members and a parameterless constructor, I think it is a very safe assumption that the intent of that class is to have all of its properties init'd via property initialization, as opposed to the extreme scenario of an empty constructor doing all of the initialization.
Given that supposition, it would be rather convenient if autocompleting classes of this nature brought your cursor to the beginning of object initialization.
Demonstration
public class Puppy
{
public int Age { get; init; }
public string Name { get; init; }
}Prior behavior
var pup = new Pu // User auto-completes
var pup = new Puppy // Cursor is placed hereProposed Behavior
var pup = new Pu // User auto-completes
var pup = new Puppy
{
// Cursor is placed here
};In my opinion the intent for this is explicitly expressed with parameterless init, and I imagine most code will follow this outcome.
Thanks for your time.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status