From 923776841f95254a4781b3b2d044ddbcfd6a8f35 Mon Sep 17 00:00:00 2001 From: jbe2277 Date: Sun, 15 Dec 2024 19:08:33 +0100 Subject: [PATCH] Use StringSyntax for template code string (Roslyn Embedded Languages Support) --- .../CodeAnalysis/TemplateCode.cs | 38 ++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/src/DotNetPad/DotNetPad.Applications/CodeAnalysis/TemplateCode.cs b/src/DotNetPad/DotNetPad.Applications/CodeAnalysis/TemplateCode.cs index cbe7cd5..9ead491 100644 --- a/src/DotNetPad/DotNetPad.Applications/CodeAnalysis/TemplateCode.cs +++ b/src/DotNetPad/DotNetPad.Applications/CodeAnalysis/TemplateCode.cs @@ -3,31 +3,35 @@ internal static class TemplateCode { public static string InitialCSharpCode => -@"namespace Sample; + /*lang=c#-test*/ """ + namespace Sample; -internal static class Program -{ - private static void Main() - { + internal static class Program + { + private static void Main() + { - } -}"; + } + } + """; public static int StartCaretPositionCSharp => 102; public static string InitialVisualBasicCode => -@"Imports System -Imports System.Collections.Generic -Imports System.Linq -Imports System.Threading.Tasks + /*lang=vb.net-test*/ """ + Imports System + Imports System.Collections.Generic + Imports System.Linq + Imports System.Threading.Tasks -Namespace Sample - Module Program - Sub Main() + Namespace Sample + Module Program + Sub Main() - End Sub - End Module -End Namespace"; + End Sub + End Module + End Namespace + """; public static int StartCaretPositionVisualBasic => 177; }