MoreSnippets
A simple Visual Studio extension that adds more C# snippets for methods and constructors
Why is this?
I found myself constantly frustrated by the lack of method snippets within Visual Studio, so I dug deeper into how the ctor
and prop
snippets work. I realized I could easily create the snippets I was looking for.
So I did. Please enjoy.
Available snippets
Currenlty, there are only snippets for regular methods, static methods, async, methods, extension methods, and constructors. I'm always open to adding more, as long as they're useful.
Regular methods
Shortcut |
Description |
method |
Code snippet for a method |
method1 |
Code snippet for a method with one argument |
method2 |
Code snippet for a method with two arguments |
method3 |
Code snippet for a method with three arguments |
Static methods
Shortcut |
Description |
smethod |
Code snippet for a static method |
smethod1 |
Code snippet for a static method with one argument |
smethod2 |
Code snippet for a static method with two arguments |
smethod3 |
Code snippet for a static method with three arguments |
Async methods
Shortcut |
Description |
amethod |
Code snippet for an async method |
amethod1 |
Code snippet for an async method with one argument |
amethod2 |
Code snippet for an async method with two arguments |
amethod3 |
Code snippet for an async method with three arguments |
Extension methods
Shortcut |
Description |
xmethod |
Code snippet for an extension method |
xmethod1 |
Code snippet for an extension method with one argument |
xmethod2 |
Code snippet for an extension method with two arguments |
xmethod3 |
Code snippet for an extension method with three arguments |
Constructors
Shortcut |
Description |
ctor1 |
Code snippet for constructor with one argument |
ctor2 |
Code snippet for constructor with two arguments |
ctor3 |
Code snippet for constructor with three arguments |
Contributing
Additional contributions are welcome. However, I don't want to bloat this extension with infrequently used snippets. They should be simple and used frequently enough.
Could you see Microsoft implementing this snippet? If so, create an issue to propose it!
If not, is it an extension of a commonly used snippet, or do you think Microsoft could implement it? If so, create an issue to propose it!
If not, the snippet probably doesn't belong in this repository. I'm always open for discussion.