From 5006f8d97359ae9e2728edc3f8a59f0031734a02 Mon Sep 17 00:00:00 2001 From: kankan11778 Date: Fri, 29 Nov 2019 22:42:09 +0800 Subject: [PATCH] change name to c/c++ snippet pro and switch case --- README.md | 12 ++++++++++-- package.json | 4 ++-- snippets/c.json | 31 ++++++++++++++++--------------- snippets/cpp.json | 44 ++++++++++++++++++++++---------------------- 4 files changed, 50 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index 31ea2c4..dce10d4 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,20 @@ This extension for Visual Studio Code adds snippets for C/C++. ## Installation -1. Install Visual Studio Code 0.10.1 or higher +1. Install Visual Studio Code 2. Launch VS Code 3. From the command palette `Ctrl`+`Shift`+`P` (Windows, Linux) or `Cmd`+`Shift`+`P` (OSX) 4. Type `ext install` or just simply select `Install Extension` 5. Choose the extension - C/C++ Dog Snippets +## Usage +C/C++ Snippets Pro use Tab to change one position to another -*Suggestions for improvement are welcome.* +## Recommendations +In order to give you a perfect plugin experience and avoid conflict with C/C++ Microsoft edition's snippet, +I recommend you turn off C/C++ Microsoft edition's snippet. Details can be find in the below. + +Settings/Extensions/ C or C++/ C_CPP:Suggest Snippets + +## Suggestions for improvement are welcome diff --git a/package.json b/package.json index e28aec1..7816d40 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "Snippets", "publisher": "2211896472", - "displayName": "C/C++ Dog Snippets", + "displayName": "C/C++ Snippets Pro", "description": "Code snippets for C/C++", - "version": "0.1.27", + "version": "0.1.28", "engines": { "vscode": "^0.10.1" }, diff --git a/snippets/c.json b/snippets/c.json index c6f1fe6..572379e 100644 --- a/snippets/c.json +++ b/snippets/c.json @@ -62,7 +62,7 @@ "\t$0", "}" ], - "description": "Code snippet for else-if " + "description": "snippet for else-if " }, "enum": { "prefix": "enum", @@ -72,7 +72,7 @@ "\t$0", "};\n" ], - "description": "Code snippet for enum" + "description": "snippet for enum" }, @@ -84,7 +84,7 @@ "$0", "#endif //!__${TM_FILENAME_BASE}__h__" ], - "description": "Code snippet for #ifndef" + "description": "snippet for #ifndef" }, "#ifdef": { @@ -94,7 +94,7 @@ "$0", "#endif //$1" ], - "description": "Code snippet for #if" + "description": "snippet for #if" }, "struct": { @@ -105,9 +105,9 @@ "\t$0", "};" ], - "description": "Code snippet for struct" + "description": "snippet for struct" }, - "switch": { + "switch": { "prefix": "switch", "body": [ "switch ($1)", @@ -115,23 +115,23 @@ " case $2:", "\t$0", "\tbreak;", - "$3", - + "\n", + "\n", " default:", "\tbreak;", "}" ], - "description": "Code snippet for switch" + "description": "snippet for switch " }, "case":{ "prefix":"case", "body":[ - "case ${1:/*case*/}:", + " case $1:", "\t$0", "\tbreak;" ], - "description": "case (...)" + "description": "snippet for case (...)" }, "union": { @@ -142,7 +142,7 @@ "\t$0", "}\n;" ], - "description": "Code snippet for union" + "description": "snippet for union" }, "#inc": { @@ -157,9 +157,10 @@ "#def": { "prefix": "#def", "body": [ - "#define $1 $2" + "#define $1 $2", + "$0" ], - "description": "Code snippet for #define" + "description": "snippet for #define" }, "main": { "prefix": [ "main" ], @@ -188,6 +189,6 @@ "**********************************************************************************************************************************************************************************************************************************", "**/" ], - "description": "File Header" + "description": "create a file header" } } diff --git a/snippets/cpp.json b/snippets/cpp.json index a7cf18e..40a77c4 100644 --- a/snippets/cpp.json +++ b/snippets/cpp.json @@ -12,7 +12,7 @@ "body":[ "using namespace $0" ], - "description": "Code snippet for using namespace" + "description": "snippet for using namespace" }, "for": { @@ -23,7 +23,7 @@ "\t$0", "}\n" ], - "description": "Code snippet for 'for' loop" + "description": "snippet for 'for' loop" }, @@ -35,7 +35,7 @@ "\t$0", "}\n" ], - "description": "Code snippet for 'for' auto" + "description": "snippet for 'for' auto" }, "do": { @@ -47,7 +47,7 @@ "\t$0", "} while($1);\n" ], - "description": "Code snippet for do...while loop" + "description": "snippet for do...while loop" }, "while": { "prefix": "while", @@ -68,7 +68,7 @@ "\t$0", "}" ], - "description": "Code snippet for if " + "description": "snippet for if " }, "else": { "prefix": "else", @@ -78,7 +78,7 @@ "\t$0", "}\n" ], - "description": "Code snippet for else" + "description": "snippet for else" }, "else if": { "prefix": "else if", @@ -88,7 +88,7 @@ "\t$0", "}" ], - "description": "Code snippet for else-if" + "description": "snippet for else-if" }, "enum": { "prefix": "enum", @@ -98,7 +98,7 @@ "\t$0", "};\n" ], - "description": "Code snippet for enum" + "description": "snippet for enum" }, "class": { @@ -110,7 +110,7 @@ " \t$0", "};\n" ], - "description": "Code snippet for class" + "description": "snippet for class" }, "namespace": { @@ -131,7 +131,7 @@ "$0", "#endif //!__${TM_FILENAME_BASE}__h__" ], - "description": "Code snippet for #ifndef" + "description": "snippet for #ifndef" }, @@ -142,7 +142,7 @@ "$0", "#endif //$1" ], - "description": "Code snippet for #if" + "description": "snippet for #if" }, "struct": { "prefix": "struct", @@ -152,7 +152,7 @@ "\t$0", "};\n" ], - "description": "Code snippet for struct" + "description": "snippet for struct" }, "switch": { "prefix": "switch", @@ -162,23 +162,23 @@ " case $2:", "\t$0", "\tbreak;", - "$3", - + "\n", + "\n", " default:", "\tbreak;", "}" ], - "description": "Code snippet for switch " + "description": "snippet for switch " }, "case":{ "prefix":"case", "body":[ - "case ${1:/*case*/}:", + " case $1:", "\t$0", "\tbreak;" ], - "description": "case (...)" + "description": "snippet for case (...)" }, "try": { "prefix": "try", @@ -192,7 +192,7 @@ "\t$0", "}\n" ], - "description": "Code snippet for try catch" + "description": "snippet for try catch" }, "union": { "prefix": "union", @@ -203,7 +203,7 @@ "\t$0", "};\n" ], - "description": "Code snippet for union" + "description": "snippet for union" }, "cin": { @@ -212,7 +212,7 @@ [ "std::cin << $0" ], - "description": "Code snippet for std::cout" + "description": "snippet for std::cout" }, "cout": @@ -222,7 +222,7 @@ [ "std::cout << $0" ], - "description": "Code snippet for std::coutt" + "description": "snippet for std::coutt" }, "endl": @@ -269,7 +269,7 @@ "**********************************************************************************************************************************************************************************************************************************", "**/" ], - "description": "File Header" + "description": "create a file header" }, "private":{