Automatic code formatting does not work properly when a function is within curly brackets

Expected Behavior

local foo = 
	{
		bar = function(args)
			if args[1]:IsA("BasePart") then
				print("Hello World!")
			end
		end,
	}


Actual Behavior

local foo = 
	{
		function(args)
			if args[1]:IsA("BasePart") then
			print("Hello World!")
		end
		end,
	}

Where It Happens: Built-In script editor for Roblox Studio
When It Happens: Constantly


Use the file below to follow the reproduction steps.
:file_folder: Baseplate.rbxl (30.1 KB)

Reproduction Steps:

  1. Select the script named Example under ServerScriptService
  2. Double click the now selected script to open the script editor
  3. Navigate to the ribbon bar, click Format Selection, and lastly, click Format Document in the drop-down menu that appears

We’ve filed a ticket to our internal database, and we’ll follow up when we have an update for you.

Thanks for the report!

2 Likes

The issue should be fixed now!

Thank you for your patience!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.