[OPEN SOURCE] Syntax Error Fixer

Syntax Fixer

Plugin Download | Source Code

About

Syntax Fixer is a Roblox plugin that will fix the syntax errors in a script with the click of a button! As of now it is fully functional with multiple configurations when fixing the syntax. Syntax Fixer does not mess with any part other part of the game so everything will work while having this plugin enabled.

How To Use

1. Open Syntax Formatter.
2.Select the scripts you want. - You can select however many scripts you want the plugin to fix.
3. Configure the options promted by the plugin.
4.Click the Fix Syntax button - If it fails to fix the error, please let me know what error it is(this plugin does not fix identifier errors).

Demonstrations

17 Likes

You literally only encounter syntax errors while you’re in the middle of coding

5 Likes

i dont think this plugin is useful since syntax errors are so easy to spot while coding and it has RED LINES so its super easy to fix them

  1. How does this plugin work when the fix is ambiguous?

Example:

if condition then doSomething() doSomethingElse()

Should it change to this,

if condition then
	doSomething()
end
doSomethingElse()

or this?

if condition then
	doSomething()
	doSomethingElse()
end
  • Should it just ask which one is correct? Maybe it should use the indents as a heuristic, or output an additional warning.

  1. Does this support tables?
local some = {
	key = value

-- becomes
local some = {
	key = value
}
local some = {
key = value

-- becomes
local some = {}
key = value
local some = { key = value

-- becomes
local some = { key = value }
local some = { [key = value }

-- becomes
local some = { [key] = value }
-- same for literal keys

  1. Does this support variable assignments with an improper right-hand side?
globalVar = 
local otherVar = "foo"

-- becomes
globalVar = nil
local otherVar = "foo"
local someVar = 
local otherVar = "foo"

-- becomes
local someVar
local otherVar = "foo"

  1. Should it fix more than syntax errors? Like:
  • Unused variables
  • Numerical for loops with mismatching start/stop/step arguments
  • Duplicate table keys

It would basically be a linter with more forceful/interactive changes than just warnings.

6 Likes
  1. It would change to
if condition then
	doSomething()
	doSomethingElse()
end
  1. Yes this supports tables
  2. Not yet, but i am planning on implementing this.
  3. Thanks for the tips I will most likely be adding these.
1 Like

Sheeeeeesh, Processing power going brrrrrrrrrrrrrrrrrrr
Overall, this is quite the thing, literally rebuilding broken scripts; quite cool, but in reality idk if scripters will use this, mainly because it’s kinda like a cheat to learning, but people who dont know how to script and copy-scripts might use it to try and use oudated scripts lol.

Would be cool if you made an anti-deprecated feature.

1 Like

Thank you. Yeah I knew most people would not use the plugin if they knew how to script. Also can you explain more on the anti-deprecated feature?

so, for example; if someones doing

game.part:Remove() -- deprecated
-- you'd change that keyword to 
game.part:Destroy() -- not-deprecated
1 Like

This is useless because NOBODY should have godamn syntax errors. Literally if you have a problem with those then your either a beginner or you have trash eyesight.

Also read what I said here:

3 Likes

Congrats. You’ve just found the audience, that this plugin is aimed at.

5 Likes

I doubt that you can figure out what syntax errors are after just 2 seconds of scripting. I guess it takes many people at least a couple of hours to understand the basics.

prove it then, this won’t be true for every beginner

How would you prove something like this?

You have syntax errors that seem like they’re literally in a foreign language to new people that have never touched an IDE.
I don’t think beginners would understand that.

Examples:
image
image

You have extremely fast coders that frequently leave out special characters in their code.
An example:

for i v in ipairs(thing:GetChildren()) do
    --rest of your code
end

Even other examples listed in this reply

exactly you can’t prove it, which means his statement is an opinion not a fact

This plugin shouldn’t be used at all. There is far too many edge cases for this to be effective. Plus there isn’t scope checking so using this can lead to even more errors.

And another thing is YOU should figure out and solve any type of errors in your script ESPECIALLY syntax errors and not have a plugin do it for you which could probably mess you up.

Overall using this plugin is bad practice and shouldn’t be used by anyone even beginners. Beginners should LEARN to script and solve problems and not rely on a plugin.

3 Likes

I see it as a source to learn from. Like modifying free models for example.
Let’s say you, as a beginner, have a syntax error and don’t know how to get rid of it → You can just use this plugin to see, what the answer is and most likely learn from it.

1 Like

I don’t think a plugin adding a “}” or a “end” would really help you learn scripting. If anything it would confuse you more since you a beginner and have no idea what they mean.

I’m obviously talking about more complicated scenarios. Anyways, this conversation is bumping the original topic.

The plugin does not edit the script if it causes more errors, thank you. And the main reason I made this is for learning purposes, but its also intended to be used by beginners.