Script tabs

ShotScript Editor opens each script in a tab of Studio's own script row, with typing help and checks as you type.

A ShotScript tab sits with Studio's script tabs, uses Studio's settings, starts from Studio's colours and writes straight into the place.

Opening a script

Every way into a script ends in a ShotScript tab.

Double-click a script in ShotScript Explorer, or press Enter on it, and it opens in a ShotScript tab in the middle of Studio, with Studio's own script tabs.

The Shop module open in a ShotScript tab in the middle of Studio, from its system script and use Inventory lines down to its Pay and Buy functions, beside ShotScript Explorer with Shop selected.
  • The Open button, on the Shot tab of Studio's ribbon, opens the script selected in Studio in ShotScript Editor. Bind it to a key in Studio's Customize Shortcuts.
  • Ctrl+P lists the place's scripts by name.
  • A problem, a search hit, a declaration or a usage opens its script at that line.
  • A ShotScript tab is Studio's own script tab: a double-click on a script in Studio's Explorer opens exactly one, and it stays in front.
  • Opening a ShotScript script from Studio's Explorer never shows its made Luau, even with many tabs open.
  • Scripts inside an Actor, a Model or a Tool open like any other.
  • A tab is named after its script, with its parent in brackets when two open scripts share a name, and shows the script's class icon.
  • A tab always shows its own script's name and icon, and a script you rename gets its new name on its tab too.
  • With a ShotScript tab docked at a side of Studio, Studio's title bar names the script in the middle, unless the tab at the side has the keyboard.
  • A disabled script's tab reads [Disabled] before its name, as Studio's does, and a Script that runs on the client shows LocalScript's icon on its tab and in ShotScript Explorer.
  • A script you open lands as a tab right after the one you last typed in, in front.
  • Right-click another script's tab and pick Open to the Side: your script comes to the front, and that script opens in a second pane, under yours when the tab is narrow. What you type in that pane goes into its own script, and Ctrl+W there closes only the pane.
  • A script you open gets a tab of its own, never the tab of another script you closed.
  • The tabs you had open in a place open again the next time you open it.
  • When ShotScript Editor updates itself, every tab stays open and keeps writing into its own script, even in a place you opened several times.
  • After you close Studio and open it again, the tabs come back in your order, with the same tab in front.
  • A tab you closed and opened again comes back with the others.
  • A tab you close by its x stays closed: it doesn't come back the next time ShotScript Editor starts.
  • While those tabs come back, Ctrl+P's Quick Open stays open until you pick a script, and the tabs come back behind the one you picked.
  • None comes back twice or goes missing.
  • When the tabs come back, a tab whose script is no longer in the place stays open, in front if it was, and says this tab's script isn't in the place any more, until you close it.
  • While they come back, no other tab shows in front of the one that was in front, not even for a moment.
  • A click into Studio's command bar while they come back keeps your keys there.
  • While they come back, Ctrl+P opens Quick Open at once, even on a tab that hasn't come back yet.
  • Keys and editing shortcuts such as Ctrl+V or Ctrl+Z that you type in Studio while they come back never go into a ShotScript tab.
  • A script you open with Quick Open while the tab in front is still coming back stays in front.
  • Open File... in a tab's menu opens a file from disk in a tab of its own.

Studio's look and settings

The editor reads Studio's own settings.

The editor takes Studio's font size, word wrap, tab width, spaces or tabs, auto indent and whether autocomplete is on, as you set them in Studio. Its colours start from Studio's script editor colours. A tab's icons follow Studio's dark or light theme.

When Studio's script font is Fira Mono at 8 pt, a ShotScript tab draws its code in Medium instead of the thinner Regular, so small code stays easy to read, on the same lines and columns. At 10 pt it is Regular.

At 200% display scale, a : or = lined up with tabs sits in one column with the others, as at 100%.

keys of and tags of take the same colours on every set line as on a system set line.

A scope written on one line colours its members as it would on lines of their own.

In a ShotScript tab, ~=, >=, <= and -> draw as ≠, ≥, ≤ and →. The script's text stays as you typed it, and a line you copy pastes them as typed.

A ─ line with a shape at its start or its end, such as ◆──────────, draws as one joined rule that runs into the shape, in the shape's own colour. With the caret in a ─ line, a one-line picker of shapes shows just above it: click a shape to put it on the line, in place of any shape the line had, and one Ctrl+Z takes the click back.

Typing help

Suggestions that know the place.

The completion list knows the place's tree, so it lists real names. It is one list in one order, as in Studio, and it doesn't change under your typing.

  • The strings of GetService, FindService, Instance.new, IsA, the class finders and GetPropertyChangedSignal list what Studio would list.
  • Inside FindFirstChild(" and WaitForChild(" it lists the object's children.
  • After a system's path it lists that system's members, and a name set from one completes too.
  • After a module's name and a dot, such as Wallet., the list offers its own members and no global names. Between two dots, as in Wallet..new(, it offers the same members, to fill in the name that goes there.
Inventory typed with a dot on line 20 of Shop: the list shows Inventory's members Add, Bags, Count and Remove, with Add picked and its parameters beside the list.
  • After use script.Parent. and after import it lists the real names there. On a use line it lists the script's sibling folders and their modules, and writes the full path.
  • In ShotScript, after server or client it suggests by position. At a script's top it offers class and module, and a shared script also gets do, local, function, use and start. Inside code it offers do, local and function, and in a class or module body it offers do.
  • After a class name it suggests extends and implements.
  • After implements, the list puts the matching interface first: implements Run lists RunLook at the top. In a module body, pub offers public.
  • The completion list answers your newest typing.
  • The completion list stays where it opened while you type the word. On the last row in view, the code stays still and the list opens under your line, even over a dock below the tab, such as Problems.
  • After Tab completes a method's name, typing its ( and ) yourself writes them once.
  • After the : on a field's line, the completion list offers type names.
  • Press Enter after a member's head in a class, such as Fill as FillNumber(v : number), and the next line is indented and its end is written.
  • ShotScript's ! lists what is selected in Studio and the ModuleScripts near the script, and follows the selection while it is open.
  • In a class's constructor, on a line of its own, type !in and press Tab: it writes local self : <Class> = init() with the class's name. One Ctrl+Z takes the line back, with the padding of the lines around it.
  • In a class that extends another, it writes local self : <Class> = init(super.new()). When the parent is in the same script and its constructor takes parameters, the caret goes inside super.new(). One Ctrl+Z takes it back.
  • Signature help shows a function's parameters as you type its arguments. Esc hides it for that call. Inside a braced call, as make{ }, it shows the call's keys as it does after a paren, and the key you are typing is bold. In an overloaded braced call, the card shows the overload's keys and its doc, with a pager across the overloads. Typing a key that only another overload has turns the card to that overload's keys and doc, drawn first, and the pager stays. After local t = { it shows none.
  • Inside an overloaded braced call, the completion list offers the keys not yet written.
  • With the completion list up, Esc closes the list first, and the next Esc hides the signature card.
  • Ctrl+Shift+Space shows the signature card inside a call, ( and { calls alike. A second press keeps it, and outside a call nothing shows.
The signature card inside the call Inventory.Add on line 20: Add over its parameters, one per line, with player : Player in bold, then item : string and count : number.
  • The card shows the doc of the key the caret is on. That doc is written after the key, as in color : Color3 «The colour it paints.», or alone on the line above it.
  • The signature card shows a call's fields the way the hover card shows a record: one field per line with its icon, the colons lined up, each field's doc beside it, and the field at the caret marked.
  • Hovering a call of an overloaded method shows the doc of the overload the call picks.
  • A method's doc shows while you type a call to it: beside its row in the completion list as you type its name after self:, and under the signature card's head once you type its (.
  • A class's own name in a type annotation, a generic's bound and a with block's key hover with their card.
  • Format, line up, and an outline of the script.
  • Format Document, under Format in the right-click menu, leaves every code line of a tidy script as it was, async heads included. A line holding only spaces or tabs comes back empty.
  • Paste a class's code from the start of a line and each constructor x as y( body comes back one tab in.
  • With nothing selected, Ctrl+C then Ctrl+V puts a copy of the caret's line below it, and one Ctrl+Z takes the copy back.
  • On a ─ line, the arrow keys move the caret four dashes at a time, Shift with an arrow key selects four, and Backspace takes four; one Ctrl+Z puts them back.
  • A field you type lines up with the fields around it: its : and = fall in their columns, in a scope's local X = { block and among a class's fields with words before their names, such as public read.
  • Close a table with its } and its rows line up with nothing shown over your code. One Ctrl+Z takes the line-up back.
  • Press End, then Enter, at the end of a lined-up field's line, and the rows above keep their : column while you type the new field, which joins that column.
  • Alt+Up and Alt+Down move the caret's line, and it takes the line-up of the block it lands in: moved into lined-up lines, its = joins their column.
  • A method call you type, such as self:Paint(...), is never lined up as a field: its : stays right after self, as you typed it.
  • In a ShotScript tab, the right-click menu and Ctrl+Shift+. list the code actions that fit where the caret is, such as Make a with block and Make it abstract. One Ctrl+Z takes a pick back.
  • In a block of fields, a doc comment at the end of one line lines up where the block's doc comments go. They all start at one column, however long each line is.
  • A doc shows as a small dot on its item's line. Hover the dot to read the doc, and click it to edit it. ShotScript Settings can show docs inline instead, with an arrow that folds each one, or as plain text (see Docks).
  • Picking a function from the list writes its ( ) too: the caret goes between them when it takes arguments, and after them when it takes none. A function called with braces gets { } instead.
  • With the caret in a Color3.new, Color3.fromRGB or Color3.fromHSV call, a row under it shows the colour. Its wheel opens a colour picker, and OK writes the new numbers into the call.
  • Click the line of a curve call, or press Ctrl+Alt+Enter on it, to open a curve editor beside the code. Drag the curve, and its numbers go into the call when you let go. Editors, in ShotScript Settings, sets which calls open it (see Docks).

Finding your way

Declarations, usages and renames across the place.

  • Go to Declaration (Ctrl+F12 or Ctrl+click) opens the line a name is declared on, in any script of the place. On a built-in such as print, game or math, it opens that name's reference page in your browser, as Studio's does.
  • F12 on a field in a typed table, such as FlashTime = 1.2 in a table typed as a record type, opens that field's line in the type, FlashTime : number, in any script. Hovering the field shows its type and doc.
  • When a name has two or more declarations, such as a method that overrides a parent's and meets an interface's promise too, Go to Declaration lists them all for you to pick one.
  • Find Usages (Shift+F12) on such an override lists the promise's line too.
  • On a Roblox class, data type or Enum, such as Player, Vector3 or Enum.Material, Ctrl+F12 and Ctrl+click open its reference page in your browser too. A declaration of that name in your own scripts still comes first, and F12 opens no page.
  • Find Usages (Shift+F12, or the text menu) lists every use of a name across the place in a window of its own. A double-click or Enter opens one.
The Find Usages window for Add beside the code: 2 usages in 2 files, its declaration on line 7 of Inventory and the call on line 20 of Shop.
  • F2 renames a name in every script that uses it, all or nothing.
  • F2 on a table type's field renames it everywhere at once: the field in the type, each table's key and every .Field read, in every script, wherever you press it. The F2 box counts them, and one Ctrl+Z takes it all back.
  • F2 on a class also renames it where a doc writes it in backticks (Coin, Coin.new(), Coin:Collect()), in the docs of the scripts that use it too, and the F2 box counts those as doc mentions. A bare name, or a longer word holding it, stays as written.
  • F2 on a member an extension script adds to a class, such as Context.Catch, renames its uses and its mentions in doc comments. A new name equal to one of the class's run-time names is refused.
  • F2 on a type leaves alone a member of the same name read inside a scope's braces: renaming a type Pt doesn't touch a Pt there that reads the scope's own Pt.
  • F2 on a script's own name renames the script and the places that use it, as one undo step. Ctrl+Z in the tab takes all of it back, the script's name too.
  • When an F2 rename rewrote a require, the note it shows has Undo: one click takes the whole rename back, the name and the require.
  • ShotScript Explorer's rename and move notes sit under the tree, which makes room for them, so a note never covers a row. Moving a script that others require shows a note too, such as Moved Coin to Systems.
  • F2 on a plain script-level type Icon = string in a ShotScript script renames its reads in code too, not only its own line.
  • Find (Ctrl+F) opens the fold or the folded doc that hides its match, and selects the match.
  • Typing at the end of a long line, or Find going to a match far to the right, scrolls the code sideways only as far as it must, and Esc from Find keeps the match in view. Once the caret is back where the line's start shows, the code scrolls back to its first column.
  • A click on the last line that shows whole at the bottom of a tab places the caret there without moving the view.

Find and replace

Search every script at once.

Ctrl+Shift+F in a ShotScript tab searches every script in the place, with match case, whole word and regular expressions. A ShotScript script is searched by its ShotScript text, not the Luau it compiles to.

  • Hits are grouped by script. Click one to open its script in a ShotScript tab at that line.
Find in Place docked at the left of a ShotScript tab after a search for Inventory: 4 results in 2 files, two under each script, beside the code with line 20 current.
  • Replace All changes every hit in the place as one undo step.
  • If a script changed or was deleted meanwhile, Replace All changes nothing.
  • A ShotScript script that the replace would stop compiling keeps its text, and the window says which one.

Checks as you type

Problems show as you type.

The editor underlines problems as you type and lists them in Problems (see Docks). Each edit checks only what changed.

Line 20 of Shop with one letter deleted from Add, so Inventory.Ad is underlined as a problem.
The same mistake listed in Problems below the code: 1 of 1 Errors, a bold row for ReplicatedStorage.Shot.Shop, and the type error Key 'Ad' not found in table 'Inventory' at line 20.
  • A row on a line you are still typing is a warning in the tab, and a refusal when the script compiles.
  • A line you are still typing that ends in a dot, such as local look = RunLooks.Split(). above a class, gets one row at the dot, Expected identifier. No other row comes with it, and the class's fields below stay unmarked.
  • Looking up a child by name, like script.Parent.Nope on a folder, shows no Key not found error, as in Studio.
  • A require cycle that Problems lists is underlined in the tab too, and the line clears when the cycle goes.
  • In a ShotScript tab, underlines settle as you delete and retype, and none is lost when the script compiles.
  • Press Enter in the middle of an underlined line indented with tabs, and the new line's red underline sits under its word, never under the tabs before it. Rest the mouse on the word for its card.
  • Fix a script, and the underlines it caused in another script's open tab clear at once.
  • The type checker, new or old, is picked per place in Problems.
  • In a ShotScript tab with no Problems panel, the hover card's fix Set RunContext to Server writes Server and says "Quick fix applied". One Ctrl+Z takes it back, and Ctrl+Y puts it back.

Every old form is a red row that names its new form, with its fix on the row. Fix all in the place, in Problems, makes those fixes in bulk, only when you press it (see Docks).

Your typing goes in

ShotScript Editor writes your typing into the place by itself.

A ShotScript tab writes your typing into the script in Studio as you go. Undo works in whole steps across scripts, as in Studio.

  • A change made to the script somewhere else while you type is merged into your typing.
  • A tab writes only into its own script.
  • Each tab shows only its own script and writes only into it: after a rename, after you close a tab and open another script, and when Studio opens again with your tabs. A new script made where a renamed one was gets a tab of its own.
  • Edits go straight in, even in a big place.
  • Before a change reaches a script, its old text is kept on your computer.
  • In a Luau script's tab, one Undo takes back one line you typed, even when the line reached the script while you were typing.
  • A ShotScript script compiles as it goes in. One that doesn't compile yet keeps its underline and its row in Problems, and its tab shows no Not compiled line.

After Write async from a row's right-click menu in Problems, one Ctrl+Z in the tab brings the problem back, with its fix on the row.

A script that doesn't compile yet shows no dot on its tab, and keeps its underline.

The underline on text that doesn't compile stays until the script compiles, however the fix gets into the script, and a check of older text never leaves a stale row in Problems.

A ShotScript script also compiles when you click away from its tab: to another dock, the 3D view, another window or another script tab. Compile when leaving a script, in ShotScript Settings, turns that off (see Docks).

When you work on a script from the command line, the open tab shows your name, and someone working on it from the command line shows theirs (see The shot command).

Play

Studio's own test.

Play in the editor runs Studio's own test, with Studio's own Play, Stop and Pause buttons.

Studio's own test buttons during Play: Play greyed out, Pause and the red Stop, above the Home tab's tools and the open tabs, among them Client and Shop.
  • A runtime error's link in Studio's Output opens the ShotScript script in its tab, at the line the error came from.
  • During Play, your typing goes to the script you are editing, and takes effect after you stop.