File tree Expand file tree Collapse file tree
EssentialCSharp.Web/wwwroot/js Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,25 +114,6 @@ function stripRegionDirectives(code) {
114114 return code . replace ( / ^ \s * # (?: r e g i o n | e n d r e g i o n ) \s + (?: I N C L U D E | E X C L U D E ) .* $ / gm, '' ) . trim ( ) ;
115115}
116116
117- // Common using directives that mirror the SDK's implicit global usings.
118- // These are needed because TryDotNet's 'console' package does not inject them.
119- const COMMON_USINGS = `using System;
120- using System.Collections.Generic;
121- using System.Linq;
122- using System.Text;
123- using System.Globalization;
124- using System.Text.RegularExpressions;` ;
125-
126- /**
127- * Prepends COMMON_USINGS to code that has no using directives of its own.
128- * @param {string } code - Source code
129- * @returns {string }
130- */
131- function prependUsings ( code ) {
132- if ( / ^ \s * u s i n g \s + / m. test ( code ) ) return code ; // already has usings
133- return `${ COMMON_USINGS } \n\n${ code } ` ;
134- }
135-
136117/**
137118 * Creates scaffolding for user code to run in the TryDotNet environment.
138119 * @param {string } userCode - The user's C# code to wrap
@@ -480,7 +461,6 @@ export function useTryDotNet() {
480461 // Top-level statement files get region directives stripped so the
481462 // scaffolding wrapper doesn't contain raw #region lines.
482463 if ( isCompleteProgram ( code ) ) {
483- // return prependUsings(code);
484464 return code ;
485465 }
486466 return stripRegionDirectives ( code ) ;
You can’t perform that action at this time.
0 commit comments