Skip to content

Commit cbf1571

Browse files
Florian KroenertFlorian Kroenert
authored andcommitted
Deprecate FormatString for now, escaping of curly braces clashes with token matcher and leads to bad user experience
1 parent 29ae77c commit cbf1571

3 files changed

Lines changed: 1 addition & 28 deletions

File tree

build.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ let sha = Git.Information.getCurrentHash()
3535
// version info
3636
let major = "3"
3737
let minor = "9"
38-
let patch = "14"
38+
let patch = "15"
3939

4040
// Follow SemVer scheme: http://semver.org/
4141
let asmVersion = major + "." + minor + "." + patch

src/lib/Xrm.Oss.XTL.Interpreter/FunctionHandlers.cs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,32 +1095,6 @@ private static T CheckedCast<T>(object input, string errorMessage, bool failOnEr
10951095
}
10961096
};
10971097

1098-
/// <summary>
1099-
/// Composes multiple values into a format string (like string.Format)
1100-
/// </summary>
1101-
public static FunctionHandler FormatString = (primary, service, tracing, interpreterConfig, parameters) =>
1102-
{
1103-
if (parameters.Count < 1)
1104-
{
1105-
throw new InvalidPluginExecutionException("FormatString needs at least a format string");
1106-
}
1107-
1108-
var format = CheckedCast<string>(parameters[0].Value, "First parameter must be a format string");
1109-
1110-
// Positional parameters only - exactly like C# string.Format
1111-
var args = parameters.Skip(1).Select(p => p.Value).ToArray();
1112-
1113-
try
1114-
{
1115-
var result = string.Format(CultureInfo.InvariantCulture, format, args);
1116-
return new ValueExpression(result, result);
1117-
}
1118-
catch (FormatException ex)
1119-
{
1120-
throw new InvalidPluginExecutionException($"Invalid format string: {ex.Message}");
1121-
}
1122-
};
1123-
11241098
private static Entity FetchSnippetByUniqueName(string uniqueName, InterpreterConfig interpreterConfig, IOrganizationService service)
11251099
{
11261100
var tableLogicalName = "oss_xtlsnippet";

src/lib/Xrm.Oss.XTL.Interpreter/XTLInterpreter.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class XTLInterpreter
3636
{ "Filter", FunctionHandlers.Filter },
3737
{ "First", FunctionHandlers.First },
3838
{ "Format", FunctionHandlers.Format },
39-
{ "FormatString", FunctionHandlers.FormatString },
4039
{ "GptPrompt", FunctionHandlers.GptPrompt },
4140
{ "If", FunctionHandlers.If },
4241
{ "IndexOf", FunctionHandlers.IndexOf },

0 commit comments

Comments
 (0)