SimpleComplete | General scripting plugin

Can we switch the module ancestor tag to fully lowercase for convenience? Or nah.

Also, in cases such as this:

--!strict

local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- test docs
function a(b)
	return ReplicatedStorage[b]
end

If a line is too close to the directive it should probably create a new line in front of the service declaration and the obstructing line.

1 Like

--sc set: ModuleAncestorTag; yourtaghere

Can you clarify further?

1 Like

oh, forgot about that

in the future you should update it to work with selected objects aswell

It’s not really a big issue but if there’s a singular line break (instead of 2+) in between two lines like so

--!strict
(single gap here)
-- test docs

importing something will only add a gap between the import and the directive

--!strict

local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- test docs

also, if a modulescript is imported before a service, it puts the service first which is good, but it doesn’t line break it

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ModuleScript = require(script.ModuleScript)

ModuleScript
ReplicatedStorage

Ahh yeah this is a pretty easy fix

Idk i find having to constantly have stuff selected tedious, maybe some other people may share the same opinion tho

Hmm i’ll investigate this but im gonna focus more on improving performance rn :V

1 Like

The tagging would still work, but selected objects would be used as module ancestors aswell

you have to select them to tag them anyway, if you expect to use multiple modules in different scripts just tag them

and yeah you can focus on optimization, I just wanted to point out some stuff I noticed


if you do this

-- Services
local ServerScriptService = game:GetService("ServerScriptService")

-- Modules
local modA = require(script.modA)

modb -- import

it attempts to define modB in front of the services instead of in front of the other modules (and snaps the modules together possibly due to the sorting), which deletes the – Modules comment fore some reason :thinking:

1 Like

This is gonna take a while :pensive:
image

1 Like

Yeah I changed the module import behaviour to insert in the beginning instead of appending, I’ll make it append

1 Like

Patch 12.1

  • Improved autocomplete resolve time
    (1300 lines file example with a module ancestor with 200 descendants)
    image

  • Imports now append to the end of their type instead of pushing

Regressions

  • No longer any line breaks between import types until i can get it working better
1 Like

Regardless of what your shorthand is set to globally ! still works no matter what.

Setting the global shorthand to : no longer works for some reason.

Also, I noticed you used plugin.Deactivation and checked for the script being deleted to call the same function, unless I’m stupid (which I probably am), you should probably use plugin.Unloading for both cases instead.

1 Like

Hmmm, thats really weird, ill check it out

1 Like

Hi, i can replicate the issue, will be fixed next update along with line breaks + more optimizations

1 Like

Hello, issue fixed in newest update

1 Like

Patch 12.2:

  • Paths with invalid characters are now parsed correctly
1 Like

Hello! I’m wondering if this is the intended behavior. I have the sorting setting turned off, but it seems the snippet was still placed elsewhere.

2 Likes

Hi, the way the plugin is designed it always places the module after all other imports, no matter where you actually imported it, I’ll probably change this behaviour to instead maybe import on the first module import behind the current line, but currently yeah it is intended even with sorting off

2 Likes

Adding onto what he said, all services and modules should probably be required right after each other according to the Roblox Lua Style Guide, it’s all preference but it’s beneficial for organization and consistency, and it’s the way most people do it.

1 Like

Patch 12.3

  • isInNonImportContext changed to loop thru lines instead of characters and utilize more string patterns, this reduced imports resolve time from sub 0.09s to sub 0.01s (for 1500 lines)

Patch 12.4

  • Added the ModuleSearchMode setting which can either be “descendants” or “children”, it is “children” by default but “descendants” may be desirable if you want to see all modules

Path 12.5

  • Removed module and service prefix maps (unecessary)

Patch 12.6:

  • Made sure you get no imports when inside function params list/for loops params list with the new isNonImportContext function
  • No longer defines an import if you autocomplete an existing variable that has the same name as a module
  • Some minor optimizations involving directives
  • Working on the ImportGsubConfig setting, coming soon to allow for custom import casing :shushing_face:
  • Working on readding blank lines between import types
1 Like