Automatically detect indentation type in script editor

As a Roblox developer, it is currently too hard to use different scripts which use different indentation styles. Sometimes I use code which has been formatted using spaces, and sometimes with tabs. My default is tabs, but I would like indentation to automatically detect spaces if spaces have been used instead of tabs. If I write something new it should use the default I select (which is currently tabs).

If Roblox is able to address this issue, it would improve my development experience because I wouldn’t have to switch the editor option every time I wanted to make a change to a script with a different indentation style. Open source typically uses spaces, but my preference is tabs, this way I get to use both in a convenient manner.

1 Like

I don’t think having different indentation per-script is good practice. Wouldn’t this just encourage inconsistent scripting practises?

This request is slightly confusing, so my assumption may be wrong.

If you write your own scripts, then all of your indentation per script will stay the same, whether it be spaces or tabs, but should you decide to use someone else’s code (which is good practice), they might use a different indentation style to you. It would be helpful when editing to use the original author’s indentation style rather than the user preferred indentation style, as it keeps indentation consistent per file, which is far more important that consistent indentation formats across files. It’s a feature that VS-Code has, You can have your preferred indentation style, but if you edit someone else’s code with a different indentation style, it uses their style not yours, so the code style stays consistent, it is really simple.

1 Like