diff --git a/src/Mnemonics/CSharp.fs b/src/Mnemonics/CSharp.fs index c94b8d6..80b72cf 100644 --- a/src/Mnemonics/CSharp.fs +++ b/src/Mnemonics/CSharp.fs @@ -83,6 +83,24 @@ let cSharpStructureTemplates = ) ] +let cSharpUntypedMemberTemplates = + [ + ( + "tm", + [ + Text "A test method." + ], + [ + Text "[Test] public void " + Constant ("methodname", "MyMethod") + Text "()" + Scope [ + endConstant + ] + ] + ) + ] + let cSharpMemberTemplates = [ ( @@ -107,7 +125,7 @@ let cSharpMemberTemplates = ], [ Text "private readonly " - Constant ("type", "type") + FixedType Text " " Constant ("fieldname", "fieldname") semiColon @@ -161,20 +179,6 @@ let cSharpMemberTemplates = semiColon ] ) - ( - "t", - [ - Text "A test method." - ], - [ - Text "[Test] public void " - Constant ("methodname", "MyMethod") - Text "()" - Scope [ - endConstant - ] - ] - ) ( "m", [ diff --git a/src/Mnemonics/Program.fs b/src/Mnemonics/Program.fs index c497231..c11d508 100644 --- a/src/Mnemonics/Program.fs +++ b/src/Mnemonics/Program.fs @@ -111,6 +111,19 @@ let renderReSharper() = // now process members if renderCSharp then + for (s,doc,exprs) in cSharpUntypedMemberTemplates do + let t = new TemplatesExportTemplate(shortcut=s) + let vars = new List() + t.description <- printExpressions doc vars String.Empty + t.reformat <- "True" + t.uid <- newGuid() + t.text <- printExpressions exprs vars String.Empty + + t.Context <- new TemplatesExportTemplateContext(CSharpContext = csContext) + t.Variables <- vars.ToArray() + templates.Add t + done + for (s,doc,exprs) in cSharpMemberTemplates do // simple types; methods can be void let types = (if Char.ToLower(s.Chars(0)) ='m' then ("", "void", "") :: csharpTypes else csharpTypes) @@ -166,6 +179,18 @@ let renderReSharper() = done if renderVBNET then + for (s,doc,exprs) in vbUntypedMemberTemplates do + let t = new TemplatesExportTemplate(shortcut=s) + let vars = new List() + t.description <- printExpressions doc vars String.Empty + t.reformat <- "False" // critical difference with C#!!! + t.uid <- newGuid() + t.text <- printExpressions exprs vars String.Empty + t.Context <- new TemplatesExportTemplateContext(VBContext = vbContext) + t.Variables <- vars.ToArray() + templates.Add t + done + for (s,doc,exprs) in vbMemberTemplates do // simple types; methods can be void for (tk,tv,defValue) in vbTypes do diff --git a/src/Mnemonics/VB.NET.fs b/src/Mnemonics/VB.NET.fs index ed29d28..02ba29f 100644 --- a/src/Mnemonics/VB.NET.fs +++ b/src/Mnemonics/VB.NET.fs @@ -71,6 +71,21 @@ let vbStructureTemplates = ) ] +let vbUntypedMemberTemplates = + [ + ( + "tm", + [ + Text "A test method." + ], + [ + Text " Public Sub " + Constant ("methodname", "SomeMethod") + Text "()" + ] + ) + ] + let vbMemberTemplates = [ ( @@ -144,17 +159,6 @@ let vbMemberTemplates = DefaultValue ] ) - ( - "t", - [ - Text "A test method." - ], - [ - Text " Public Sub " - Constant ("methodname", "SomeMethod") - Text "()" - ] - ) ( "m", [