There is an error in ROBLOX Studio's Comment-Marking Formula

While doing a lot of commenting, I’ve noticed an error with how the formula marks comments. Error summary: The formula is marking code as comments that shouldn’t be comments.

QUICK RUNDOWN of how LONG comment marking should work:
“–[===[” marks comments until “]===]” is shown
“–[==[” marks comments until “]==]” is shown
“–[=[” marks comments until “]=]” is shown
Number of equal signs = what ‘class’ that long comment is in, good way of organizing that system, btw.
source: Documentation - Roblox Creator Hub

REPRODUCING the error I’ve found:

  1. Open ROBLOX Studio and make a new script
  2. In the new script, paste the code (located below)
  3. Make the “2 equals sign” long comment (lines 1-3) into a “1 equals sign” comment (take away 1 equals sign from each bracket)
  4. Everything turns into a comment, that shouldn’t happen. If you run the code, you see that comments are executing, comments shouldn’t execute. Seems like a problem with studio’s Comment-Marking formula.

the code:

--[==[
comment 1
]==]

--hello here is code
for i = 1, 2 do
	print("The editor says I'm a comment, yet I execute... Run: ", i)
end

--[=[
comment 2
]=]

I’m commenting in large quantities, many times to archive my code. Pls fix! Or is it not an error?

2 Likes

It’s okay guys I am exceptional at reporting useless bugs… xD No seriously there have been many times where I post a quiet thread! Maybe I am nitpicky. This is a small bug.

It’s a clear bug that doesn’t need discussion, not a bad thing to have a quiet bug report thread in that case.

Right, okay I am glad it’s clear.

This bug has been around for a long time.
It’s just a visual bug.
Closing the script (not just switching to another tab/Gameview) and reopening fixes it.

Lol how long? I’ve been finding a lot of these… also, cut and pasting the script too fixes it, I’ve noticed

No idea, I remember it for a long time.

Basicly anything that makes the formatter recalculate the colors for the commented part.

1 Like

I wonder if this is part of Lua highlighting or RBX.Lua highlighting. Probably the latter.

1 Like