You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many cases, quoted strings don't contain JSON. In the previous version of the parser (using System.CommandLine), quoting a value was simply a way to denote a string that intentionally contains whitespace. This is still supported but the heuristic for determining which case to use was insufficient, resulting in errors like the following. Given a submission containing e.g...
...the following error is produced, because the Utf8JsonReader assumes the substring \P is an (invalid) escape sequence.
D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelHost.cs:line 124 System.Text.Json.JsonReaderException: 'p' is an invalid escapable character within a JSON string. The string should be correctly escaped. LineNumber: 0 | BytePositionInLine: 4.
at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
at System.Text.Json.Utf8JsonReader.ConsumeStringAndValidate(ReadOnlySpan`1 data, Int32 idx)
at System.Text.Json.Utf8JsonReader.ConsumeString()
at System.Text.Json.Utf8JsonReader.ConsumeValue(Byte marker)
at System.Text.Json.Utf8JsonReader.ReadFirstToken(Byte first)
at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
at System.Text.Json.Utf8JsonReader.Read()
at System.Text.Json.Utf8JsonWriter.WriteRawValueCore(ReadOnlySpan`1 utf8Json, Boolean skipInputValidation)
at System.Text.Json.Utf8JsonWriter.TranscodeAndWriteRawValue(ReadOnlySpan`1 json, Boolean skipInputValidation)
at System.Text.Json.Utf8JsonWriter.WriteRawValue(String json, Boolean skipInputValidation)
at Microsoft.DotNet.Interactive.Parsing.DirectiveNode.<TryGetJsonAsync>g__WriteProperty|26_0(String propertyName, String value, <>c__DisplayClass26_0&) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\DirectiveNode.cs:line 351
at Microsoft.DotNet.Interactive.Parsing.DirectiveNode.TryGetJsonAsync(DirectiveBindingDelegate bind) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\DirectiveNode.cs:line 319
at Microsoft.DotNet.Interactive.Parsing.DirectiveNode.TryGetJsonAsync(DirectiveBindingDelegate bind) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\DirectiveNode.cs:line 344
at Microsoft.DotNet.Interactive.Parsing.SubmissionParser.<>c__DisplayClass7_0.<<SplitSubmission>g__CreateActionDirectiveCommand|7>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\SubmissionParser.cs:line 378
--- End of stack trace from previous location ---
at Microsoft.DotNet.Interactive.Parsing.SubmissionParser.SplitSubmission(KernelCommand originalCommand, String code, CreateChildCommand createChildCommand) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\SubmissionParser.cs:line 132
at Microsoft.DotNet.Interactive.Parsing.SubmissionParser.SplitSubmission(SubmitCode submitCode) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Parsing\SubmissionParser.cs:line 44
at Microsoft.DotNet.Interactive.Kernel.TrySplitCommand(KernelCommand originalCommand, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 152
at Microsoft.DotNet.Interactive.Kernel.SendAsync(KernelCommand command, CancellationToken cancellationToken) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Kernel.cs:line 397
at Microsoft.DotNet.Interactive.KernelHost.<>c__DisplayClass13_1.<<ConnectAsync>b__4>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelHost.cs:line 124
In many cases, quoted strings don't contain JSON. In the previous version of the parser (using System.CommandLine), quoting a value was simply a way to denote a string that intentionally contains whitespace. This is still supported but the heuristic for determining which case to use was insufficient, resulting in errors like the following. Given a submission containing e.g...
...the following error is produced, because the Utf8JsonReader assumes the substring
\Pis an (invalid) escape sequence.