From 540183bc122a72fcec63936203736bcef2cffc00 Mon Sep 17 00:00:00 2001 From: kankan11778 Date: Fri, 27 Dec 2019 13:31:45 +0800 Subject: [PATCH] change #ifndef snippet to upcase --- package.json | 2 +- snippets/c.json | 23 ++++++++++++----------- snippets/cpp.json | 17 ++++++++--------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index 235c333..77c2c43 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "publisher": "2211896472", "displayName": "C/C++ Snippets Pro", "description": "Code snippets for C/C++", - "version": "0.1.34", + "version": "0.1.37", "engines": { "vscode": "^0.10.1" }, diff --git a/snippets/c.json b/snippets/c.json index 572379e..420d96b 100644 --- a/snippets/c.json +++ b/snippets/c.json @@ -1,9 +1,8 @@ { - - "for": { "prefix": "for", - "body": [ + "body": + [ "for (int ${1} = ${2:0}; ${1} < ${3:length}; ${1}++)", "{", "\t$0", @@ -12,8 +11,8 @@ "description": "Code snippet for 'for' loop" }, - "do": { - "prefix": ["do"], + "do": { + "prefix": "do", "body": [ "do", @@ -34,6 +33,7 @@ ], "description": "" }, + "if": { "prefix": "if", "body": [ @@ -44,6 +44,7 @@ ], "description": "Code snippet for if" }, + "else": { "prefix": "else", "body": [ @@ -75,24 +76,24 @@ "description": "snippet for enum" }, - "#ifndef": { "prefix": "#ifndef", "body": [ - "#ifndef __${TM_FILENAME_BASE}__h__", - "#define __${TM_FILENAME_BASE}__h__", + "#ifndef __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__", + "#define __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__", "$0", - "#endif //!__${TM_FILENAME_BASE}__h__" + "#endif //!__${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__" ], "description": "snippet for #ifndef" }, + "#ifdef": { "prefix": "#ifdef", "body": [ - "#ifdef $1", + "#ifdef $1", "$0", - "#endif //$1" + "#endif //$1" ], "description": "snippet for #if" }, diff --git a/snippets/cpp.json b/snippets/cpp.json index ffe33dc..95d524e 100644 --- a/snippets/cpp.json +++ b/snippets/cpp.json @@ -39,7 +39,7 @@ }, "do": { - "prefix": ["do"], + "prefix": "do", "body": [ "do", @@ -117,18 +117,17 @@ }, "class inherit": { - "prefix": "clai", + "prefix": "classi", "body": [ "class $1 :public $0", "{", "", "};\n" ], - "description": "snippet for class" + "description": "snippet for class inherit" }, - "namespace": { "prefix": "namespace", "body": [ @@ -143,10 +142,10 @@ "#ifndef": { "prefix": "#ifndef", "body": [ - "#ifndef __${TM_FILENAME_BASE}__h__", - "#define __${TM_FILENAME_BASE}__h__", + "#ifndef __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__", + "#define __${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__", "$0", - "#endif //!__${TM_FILENAME_BASE}__h__" + "#endif //!__${TM_FILENAME_BASE/(.*)/${1:/upcase}/}__H__" ], "description": "snippet for #ifndef" }, @@ -155,9 +154,9 @@ "#ifdef": { "prefix": "#ifdef", "body": [ - "#ifdef ${1}", + "#ifdef ${1}", "$0", - "#endif //$1" + "#endif //$1" ], "description": "snippet for #if" },