Help

Re: Scripting Block Editor: Set() & Spread Operator

1251 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I’m wondering if this is intentional behavior…

In the Scripting Block’s editor, when I try to use the spread operator [...] to spread a Set() into an array, I get syntax highlighting for an error:

image

Using Array.from() on the same Set() works just fine (no syntax highlighting). But, curiously, the Scripting Block also runs the script just fine with the Spread operator version of that line of code, even though it’s highlighted as an error.

The same code does not produce any error highlighting in a JavaScript environment in VS Code:

image

Not a real issue, and probably an edge case, but I figured I’d report it anyhow, just in case 1) it’s an unintended bug, or 2) I’m unaware that shouldn’t be using the Spread operator on Sets.

Side-note… The built-in editor in the Scripting Block is a surprisingly excellent experience! I’m curious if you guys rolled your own, or if you utilized some open-source editor library?

14 Replies 14

Agree 100%. One of the gems of this new feature.

Shrey_Banga
6 - Interface Innovator
6 - Interface Innovator

Thanks for the report – this is not intentional. Using the spread operator should be fine. We will remove the warning.

Stephen_Suen
Community Manager
Community Manager

The scripting block uses Monaco, which is actually the editor that powers VS Code!

Thank you for letting us know more about the scripting block editor. I am accustomed to a different editor and my transition to this editor has been rough.

By the way, I am having some trouble with the editor. For me, the keyboard shortcuts for select all code and Undo last action do no work as documented on the support website in the screenshot below. (Ctrl+V also has two documented actions, but for me it only does the first.)

image

Which editor?

I also had some issues initially with VS Code, but overall, the transition has produced far greater benefits.

I currently use Atom.

Thanks for flagging this! These appear to be errors in our support documentation — we’ll get those fixed ASAP.

On Windows:

  • Ctrl + A - Select all code
  • Ctrl + Y - Redo last action

On Mac:

  • Cmd + A - Select all code
  • Shift + Cmd + Z - Redo last action

For me, on Windows, these do not work.
Ctrl+A has a different behavior. Ctrl+Y does nothing.
Ctrl+Z also does nothing.

I could go on, but I assume that Airtable has Q/A people testing stuff like this and will get them fixed soon (along with several other quirky things I see in scripting block).

There also appears to be a lot of undocumented keyboard shortcuts. Some of them are really useful. However, I understand if you want to leave some keyboard shortcuts undocumented for now.

Is the editor focused? I am able to successfully use these shortcuts on Windows.

Yes, we intentionally don’t document all the keyboard shortcuts to keep the support article light. You can use the F1 key to pull up the command palette, which can assist in discovering new commands and keyboard shortcuts.