rsaz / csharp-snippet-productivity

The complete snippet toolbox for C#"
MIT License
19 stars 6 forks source link

Suggestion: Valid default names #6

Closed mikael-bergstrom-ntisthlm closed 2 years ago

mikael-bergstrom-ntisthlm commented 2 years ago

Another one of my students pointed out something: The default names for classes, interfaces etc aren't valid. I mean, of course you always rename them; nobody wants a class named "New Class" anyways, but I just thought he had kind of a point that the default name might benefit from being valid C# names.

So basically NewClass.cs rather than New Class.cs, NewInterface.cs rather than New Interface, etc.

rsaz commented 2 years ago

Another one of my students pointed out something: The default names for classes, interfaces etc aren't valid. I mean, of course you always rename them; nobody wants a class named "New Class" anyways, but I just thought he had kind of a point that the default name might benefit from being valid C# names.

So basically NewClass.cs rather than New Class.cs, NewInterface.cs rather than New Interface, etc.

That's a small change and I will include in the next release for sure, thank you

rsaz commented 2 years ago

Problem fixed in many different ways: (Solution is valid for all types, class, interface, record and so on) 1 - if user create a class then just hit enter the class will be created correctly NewClass 2 - If the user create a class with a incorrect name such as: My New Class, this will be corrected to MyNewClass 3 - If the user press ESC after click to create a type the type will be created as NewClass, or NewInterface etc.

With this, there's no way user can commit a mistake on creating a type. That's my hope :) lol

Solution will be available in the release 1.2.7