Auto complete/import Modules & Services

Hey, optimizing the plugin could take me a while since I have to reread the entire code and understand how the plugin works again, but when I do I will make sure to let you know!

1 Like

Gotcha, again great plugin. It keeps me from moving to vscode

1 Like

Update

plugin will now start ignoring modules that are deeply nested (having 3 ancestors that are modulescripts) if there are too many
I figured that not alot of people even use auto import for modules so it shouldnt cause too much problem

anyway, here’s how it works:

  • ModuleScript0
    • ModuleScript1
      • ModuleScript2
      • ModuleScript3
        • ModuleScript4 – Ignored
        • ModuleScript41 – Ignored
        • ModuleScript42 – Ignored
        • Folder
          • ModuleScript5
            • ModuleScript6
              • ModuleScript7
                • ModuleScript6 – Ignored
                • ModuleScript7 – Ignored
                • ModuleScript8 – Ignored
                  • ModuleScript9 – Ignored

again, this only happens when there are too many modules for the plugin to handle.
if it still takes more than 0.25 seconds to loop through the modules after ignoring the nested ones, the plugin will just start ignoring random modules to become faster.

how many modules are counted as too many?

when it takes the plugin more than 0.25 seconds to loop through all of the modules, it means that there are too many.

I’ve also optimized some other stuff inside the plugin so overall the performance should be a bit better.


@0MRob

what did that say im actually curious lmao

What do you mean by that picture

I mean he can just as easily get the source code for this plugin since it is not paid, so he can just download the plugin.

where can i find the code? i would like to analyze it and would also like to do this for other plugins or is this an option from the creator?

hey, sorry for the late reply, when I made this plugin I wasn’t using rojo so I never setup a github repo for it, so you’d have to install the plugin in studio and then find it in your file system, I don’t remember where plugins are stored but you should be able to figure that out with a quick google search

also just a warning, this plugin doesn’t do anything crazy like parsing your code into an ast, it just uses string matching to naively figure out if certain variables are declared and how many scopes are in your code to figure which one your cursor is in

1 Like