Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/j0rgeserran0/vscode-csharp-snippets

Extension of C# Snippets for Visual Studio Code
https://github.com/j0rgeserran0/vscode-csharp-snippets

asp-net-core csharp ef-core grpc net-5 net-core signalr-core snippets visual-studio-code visual-studio-code-extensions

Last synced: 9 days ago
JSON representation

Extension of C# Snippets for Visual Studio Code

Awesome Lists containing this project

README

        

# C# Snippets for Visual Studio Code

![Downloads](https://img.shields.io/visual-studio-marketplace/d/jorgeserrano.vscode-csharp-snippets)
![Installs](https://img.shields.io/visual-studio-marketplace/i/jorgeserrano.vscode-csharp-snippets)
[![Visual Studio Code Extension](https://img.shields.io/visual-studio-marketplace/v/jorgeserrano.vscode-csharp-snippets?label=Version)](https://marketplace.visualstudio.com/items?itemName=jorgeserrano.vscode-csharp-snippets)
![Issues](https://img.shields.io/github/issues/J0rgeSerran0/vscode-csharp-snippets?color=B22DFF)
![Issues Pull Requests](https://img.shields.io/github/issues-pr/J0rgeSerran0/vscode-csharp-snippets?color=B22DFF)

![alt text](https://github.com/J0rgeSerran0/vscode-csharp-snippets/raw/master/images/vscode-csharp-snippets.png "C# Snippets")

This extension for Visual Studio Code adds snippets for C#.

You can find this extension in the [Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jorgeserrano.vscode-csharp-snippets).

See the [CHANGELOG](CHANGELOG.md) for the latest changes included.

## Usage
Put the cursor on the C# file.

Type part of a snippet, press `tab`, and the snippet unfolds.

If you have problems to see the snippets, press `Ctrl`+`Space` (Windows, Linux) or `Cmd`+`Space` (OSX).

(**see the [TUTORIALS](TUTORIALS.md) to know more**)

### C# general snippets
```csharp
#helloworld
~
cclear
cgo
class
classa
classd
const
cr
crk
csproj_1.0
csproj_1.1
csproj_2.0
csproj_2.1
csproj_3.1
csproj_5
cwl
dowhile
else
enum
exception
for
foreach
guid
guidn
if
ifelse
iif
immutable
interface
linq_distinct
linq_where
lock
main
method
method_async
msgbox
mstest
namespace
prop
propi
propinit
propr
pum
pvm
record
singleton
singletonl
singletonts
struct
switch
tls
todo
try
tryf
using
while
```

### Visual Studio snippets
```csharp
sln_2017
sln_2019
```

### ASP.NET Core C# snippets
```csharp
ac_#helloworld_Startup
ac_#helloworld_WebApp
ac_#helloworld_WebApi
ac_action
ac_comment
ac_conf
ac_conf_file
ac_controller
ac_csproj_2.0
ac_csproj_2.1
ac_csproj_3.1
ac_csproj_5
ac_startupenv
```

### ASP.NET Core Web Api C# snippets
```csharp
api_controller
api_delete
api_get
api_put
api_post
```

### .NET Extensions
```csharp
ex_md5_from_stream
ex_stream_to_string
ex_string_to_stream
```

### gRPC C# snippets (.NET 5)
```csharp
gRPC_client_csproj
gRPC_client_program
gRPC_proto
gRPC_server_csproj
gRPC_server_program
gRPC_server_service
gRPC_server_settings
gRPC_server_startup
```

### ASP.NET Core Razor C# snippets
```csharp
rz_code
rz_comment
rz_directive
rz_dowhile
rz_for
rz_foreach
rz_functions
rz_if
rz_ifelse
rz_implements
rz_inherits
rz_inject
rz_model
rz_namespace
rz_raw
rz_renderbody
rz_switch
rz_try
rz_using
rz_viewbag
rz_viewdata
rz_while
```

### XML Comments snippets
```csharp
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
xml_
```

## Installation

1. Install Visual Studio Code 1.5.0 or higher
2. Launch Visual Studio Code
3. From the command palette `Ctrl`-`Shift`-`P` (Windows, Linux) or `Cmd`-`Shift`-`P` (OSX)
4. Select `Install Extension`
5. Search and choose the extension
6. Reload Visual Studio Code