From e55e172cb7581851da1ad6693947ddbe32e6e7cf Mon Sep 17 00:00:00 2001 From: MRmlik12 Date: Mon, 2 May 2022 00:46:07 +0200 Subject: [PATCH 1/2] Add auto complete name to class, interfaces, enums, structs etc. --- snippets/csharp.json | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/snippets/csharp.json b/snippets/csharp.json index 8767f09d7..fd22f537d 100644 --- a/snippets/csharp.json +++ b/snippets/csharp.json @@ -3,14 +3,14 @@ "prefix": "attribute", "body": [ "[System.AttributeUsage(System.AttributeTargets.${1:All}, Inherited = ${2:false}, AllowMultiple = ${3:true})]", - "sealed class ${4:My}Attribute : System.Attribute", + "sealed class ${$TM_FILENAME_BASE}Attribute : System.Attribute", "{", "\t// See the attribute guidelines at", "\t// http://go.microsoft.com/fwlink/?LinkId=85236", "\treadonly string positionalString;", "\t", "\t// This is a positional argument", - "\tpublic ${4:My}Attribute(string positionalString)", + "\tpublic ${4:$TM_FILENAME_BASE}Attribute(string positionalString)", "\t{", "\t\tthis.positionalString = positionalString;", "\t\t", @@ -51,7 +51,7 @@ "Class": { "prefix": "class", "body": [ - "class ${1:Name}", + "class ${1:$TM_FILENAME_BASE}", "{", "\t$0", "}" @@ -88,7 +88,7 @@ "Enum": { "prefix": "enum", "body": [ - "enum ${1:Name}", + "enum ${1:$TM_FILENAME_BASE}", "{", "\t$0", "}" @@ -132,12 +132,12 @@ "prefix": "exception", "body": [ "[System.Serializable]", - "public class ${1:My}Exception : ${2:System.Exception}", + "public class ${1:$TM_FILENAME_BASE}Exception : ${2:System.Exception}", "{", - "\tpublic ${1:My}Exception() { }", - "\tpublic ${1:My}Exception(string message) : base(message) { }", - "\tpublic ${1:My}Exception(string message, System.Exception inner) : base(message, inner) { }", - "\tprotected ${1:My}Exception(", + "\tpublic ${1:$TM_FILENAME_BASE}Exception() { }", + "\tpublic ${1:$TM_FILENAME_BASE}Exception(string message) : base(message) { }", + "\tpublic ${1:$TM_FILENAME_BASE}Exception(string message, System.Exception inner) : base(message, inner) { }", + "\tprotected ${1:$TM_FILENAME_BASE}Exception(", "\t\tSystem.Runtime.Serialization.SerializationInfo info,", "\t\tSystem.Runtime.Serialization.StreamingContext context) : base(info, context) { }", "}" @@ -198,7 +198,7 @@ "Interface": { "prefix": "interface", "body": [ - "interface I${1:Name}", + "interface I${1:$TM_FILENAME_BASE}", "{", "\t$0", "}" @@ -368,7 +368,7 @@ "Struct": { "prefix": "struct", "body": [ - "struct ${1:Name}", + "struct ${1:$TM_FILENAME_BASE}", "{", "\t$0", "}" From b586334a697813a4613a7ee6619510ab83303d57 Mon Sep 17 00:00:00 2001 From: MRmlik12 Date: Mon, 9 May 2022 22:18:36 +0200 Subject: [PATCH 2/2] Remove I prefix from interface snippet --- snippets/csharp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/csharp.json b/snippets/csharp.json index fd22f537d..c729dc32c 100644 --- a/snippets/csharp.json +++ b/snippets/csharp.json @@ -198,7 +198,7 @@ "Interface": { "prefix": "interface", "body": [ - "interface I${1:$TM_FILENAME_BASE}", + "interface ${1:$TM_FILENAME_BASE}", "{", "\t$0", "}"