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
Happens when trying to bind to an object with more than one property. See:
Open binding editor
Type binding of {a:1, b:2 }
Observe
This happens because we're using Monaco editor to edit javascript expressions, but it's handling this input as a declaration, hence it see a block scope instead of an object.
The problem can be worked around by adding parentheses around the expression
Possible solution
There doesn't seem to be language services that deal with javascript expressions, but one approach could be to create a variant of the editor that starts with the content:
1 return (
2 // type expression here
3 );
And disables line 1 and 3 from being edited, then strips lines 1 and 3 before firing onChange. (Some inspiration here: microsoft/monaco-editor#953). Another direction could be setHiddenAreas. It seems to be removed from the types, but it's still functional microsoft/monaco-editor#45
The text was updated successfully, but these errors were encountered:
Upvoting, I expected this to work when binding the body with content-type: json. It worked with strings, arrays, so I kind of expected it to work with JSON too.
Steps to reproduce 🕹
Happens when trying to bind to an object with more than one property. See:
{a:1, b:2 }
This happens because we're using Monaco editor to edit javascript expressions, but it's handling this input as a declaration, hence it see a block scope instead of an object.
The runtime side of things is addressed by #1542
The problem can be worked around by adding parentheses around the expression
Possible solution
There doesn't seem to be language services that deal with javascript expressions, but one approach could be to create a variant of the editor that starts with the content:
And disables line 1 and 3 from being edited, then strips lines 1 and 3 before firing
onChange
. (Some inspiration here: microsoft/monaco-editor#953). Another direction could besetHiddenAreas
. It seems to be removed from the types, but it's still functional microsoft/monaco-editor#45The text was updated successfully, but these errors were encountered: