Auto-Indent/Auto-Complete intermittently does not work after using certain LUA keywords and constructs

Problem

I was able to duplicate this on a standard baseplate. The script editor’s auto-indent feature is does not work intermittently. I’m finding that I have to hit the <TAB> way more often than necessary. It has gotten to the point where the <TAB> button feels like it’s going to burn out. I should mention that this is the second bug report that I have made about this issue. The first one I wasn’t really able to articulate which keywords was causing the problem.

This seems to occur randomly. However, the following situations will make it fail every time, at least for me:

  • Typing if true then on a blank line will fail to print the matching end and fail to auto-indent.
  • Typing function somefunction() will yield correct auto-indent/auto-complete behavior, but typing local function somefunction2() will not.

I have also experienced the local keyword causing the indent level to reset to column 1 even though I am working with nested if/then/else and for/do loops several levels deep. This seems to occur randomly. Setting the auto-indent mode from relative to absolute does not help matters. Furthermore, when this problem manifests, when cutting/copying and pasting code, the indent level of the pasted code reflects the source code and not the indent level of where it’s pasted at.

I have completely removed Studio from the computer (including the registry) and reinstalled it to no avail. Needless to say, this issue is extremely annoying and needs to be fixed quickly as it disrupts my workflow.


Additional Information

Parameter Value
Problem Area Studio
Problem Component Script Editor
First Noticed Some time ago
Priority Normal
Impact Medium
Annoyance Level Extreme

The beta features that I have enabled are as follows:

  • Assistant Preview
  • Texture Generator

As for plugins, I have a bunch that are installed, but very few are enabled. The ones that are enabled are listed below with links to their details page on the Roblox store website:


Expectations

What I expect to happen is that after I press enter to complete a line, that auto-indent/auto-complete correctly places the cursor at the next line at either the same, next, or previous indent level depending on if I am opening, continuing, or closing a code block.


Visuals

This shows the failure when typing a if/then statement on a blank line (bottom of file).

Here auto-indent/auto-complete refused to function until the third nested if/then statement.


Reproduction

To reproduce the issue, perform the following steps:

  1. Open an empty baseplate.
  2. Create a script.
  3. Open the script.
  4. Start typing as mentioned in the problem section above.

Files

Not really. Fails on a clean baseplate.

4 Likes

Thanks for reaching out again. We haven’t had much luck reproducing this issue on a clean studio install, but we have noticed this behavior becoming flaky while running a test plugin that slows down the datamodel thread. To confirm that it’s the same problem: Are you able to reproduce this with all plugins disabled?

I can try that. I’ll reach back out after I test that scenario. In any case, it shouldn’t be getting flaky at all, so there is an issue.

EDIT:

@swmaniac Ok, with all plugins disabled and all beta features disabled, it’s still doing it on a clean baseplate. It’s pretty consistent now that I know how to make it do it.

Type this into an empty script on a clean baseplate: local function thisorthat(). When you hit enter, it will not place the matching end, and it won’t indent. It does the same thing with if true then as well.

I guess I could try to reinstall it again and see if that clears it up. All the registry settings are in HKCU/SOFTWARE/Roblox/RobloxStudio, right?

1 Like

@swmaniac I completely removed the Roblox folder and deleted all settings in the registry. Redownloaded the installers for both the player and studio and did a clean install. It’s still happening. So at this point, I am going to leave it to you guys.

It may be a snippits problem. VSCode has something called snippets when dealing with auto-complete. When certain patterns are met, VSCode adds the corresponding snippet, so I wonder if it’s something to do with that.

1 Like

Hi @Maelstorm_1973, sorry to hear about this inconvenience. Could you please make a video showing how you reproduce this issue? We want to accurately identify the problem to ensure we fix it the right way.

@swmaniac @yohooyohoo

Here’s the video that you requested.

Thanks, this video helps a lot!

One more thing, could you please provide a screenshot of your studio settings dialog? It looks like the on-type formatting isn’t working at all, so it might have been accidentally disabled.

@yohooyohoo As requested, here’s the screenshot. It’s turned on.

Anything else you might need, let me know. I want this issue resolved by any means necessary.

After 2 weeks of debugging with @Maelstorm_1973 through DM, we discovered that the root cause was something stuck in the keyboard, which was occasionally triggering the right shift key while pressing enter. Since formatting isn’t triggered when pressing enter with the right shift key, the solution was simply to clean the keyboard. :smile:

Thank you for sticking with us and helping improve RobloxStudio. Happy coding!

4 Likes

What a weird resolution :sob: haha

2 Likes

This reminds me the first bug in the world: World’s First Computer Bug

3 Likes

Yeah. It explains a few other problems that I have been having with the system. I was beginning to think a hardware problem with memory or I had somehow picked up a virus or rootkit. So far, it seems to be ok.

1 Like