-
Notifications
You must be signed in to change notification settings - Fork 21
[BUG] Encode Selection as M Text Value is missing escapes on complex values #167
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected behavior
I'm expecting the selected value will escaped quotes, converting it to a raw string.
I thought it would simplify adding the Code part of function's metadata ( Documentation.Examples )
For example this
let
x = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcszNr8hMzszJycxT0EgsVjBUcFTQVIrVwSbjjFNGAY8uhEwBskRxfkppLhYpoFkwWaBkLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Raw Name" = _t])
in
x
Expected Output
let
x = "Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(""i45WcszNr8hMzszJycxT0EgsVjBUcFTQVIrVwSbjjFNGAY8uhEwBskRxfkppLhYpoFkwWaBkLAA="", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#""Raw Name"" = _t])"
in
x
Actual behavior
let
x =
Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText(""i45WcszNr8hMzszJycxT0EgsVjBUcFTQVIrVwSbjjFNGAY8uhEwBskRxfkppLhYpoFkwWaBkLAA="", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#(#)""Raw Name"" = _t])
in
x
To Reproduce
VsCode.PowerQuery.-.text.to.M.expression.-.2022-09.-.export.1.mp4
Environment
| Name | Version |
|---|---|
| Extension | PowerQuery.vscode-powerquery@0.1.45 |
| Code | code: 1.71.2, 74b1f979648cc44d385a2286793c226e611f59e7, x64 |
Pwsh>
code.cmd --show-versions --list-extensions | sls 'powerquery'
code.cmd --version | Join-String -sep ', ' -op 'vscode: 'Solution?
A naive replace appears to be working, at least for this sample
- Replace
"with"" - Surround that with
""
Pwsh> $Content -replace '"', '""'
| Join-String -op '"' -os '"'Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working