cSharpSnippet Extension for VS Code
This extension allows users to quickly generate basic C# template code within Visual Studio Code.
Features
Snippet Shortcut |
Description |
!cs-class |
Generates C# class template |
!cs-interface |
Generates C# interface template |
!cs-struct |
Generates C# struct template |
!cs-enum |
Generates C# enum template |
!cs-console |
Generates C# Console App starting code |
!cs-method |
Generates C# method template |
!cs-prop |
Generates C# property template |
!cs-ctor |
Generates C# constructor template |
!cs-if |
Generates C# if statement template |
!cs-switch |
Generates C# switch statement template |
!cs-while |
Generates C# while loop template |
!cs-for |
Generates C# for loop template |
!cs-foreach |
Generates C# foreach loop template |
!cs-trycatch |
Generates C# try-catch block template |
!cs-using |
Generates C# using statement template |
!cs-lock |
Generates C# lock statement template |
!cs-return |
Generates C# return statement template |
!cs-namespace |
Generates C# namespace template |
!cs-abstract |
Generates C# abstract class template |
!cs-partial |
Generates C# partial class template |
!cs-static |
Generates C# static method template |
!cs-conn |
Generates C# connectionString |
Usage
- Open Visual Studio Code and navigate to the Extensions view (
View > Extensions )
- Search for "cSharpSnippet" and click the "Install" button
- Open a new file or navigate to an existing file in a C# project
- Right-click in the editor and select "Generate C# template code"
- Select the desired template type (class, interface, struct, or enum)
- Enter the name of the template and press enter
- The template code will be generated at the cursor location
Requirements
- Visual Studio Code
- C# extension for Visual Studio Code (Recommended for full C# language support)
Release Notes
0.0.3
- Initial release
- Includes class, interface, struct, enum, console app, method, property, constructor, if statement, switch statement, while loop, for loop, foreach loop, try-catch block, using statement, lock statement, return statement, namespace, abstract class, partial class, static method, and connectionString template generation.
Contributing
If you have any ideas for new features or find any bugs, please open an issue or submit a pull request.
License
This extension is licensed under the MIT license.
Acknowledgements
This extension was created by MD. Jashim Uddin and is not affiliated with Microsoft.
| |