can you do a quick patch to fix command line service usage?
Honestly I don’t think i can fix it for command lines considering the command line is, well, only 1 line, and the auto imports require their line to be completely empty
Tho i mayybe might make a special case for the command bar, higher priority things rn tho
I meant at least disabling imports in the command line and checking if a variable for a service already exists for the shorthands
Is there even a way to detect when the user is using the command line?
Oh yeah i just noticed service shorthands is broken in the command line, i’ll fix that
ScriptDocument:IsCommandBar(), it’s actually pretty easy
A special case for the command line would be appreciated in the future :))
Update 13:
- Readded gaps between import types
- Added the
ImportGsubConfig
setting which you can use to customize import variable names
The first argument is a string and the second argument should return a function, both will be passed to string.gsub with the variable name as the first argument.
NOTE: The second argument is loaded with a sandboxed version ofloadstring
, rest assured you can do anything to your variable names and it’ll still work
NOTE 2: This function applies to both service and module imports, I’ll probably change this in the future
Heres an absolutely absurd example, I wouldn’t recommend this though :V
The perfect update for april fools!!!
I mean i can linebreak if the next line isn’t pure whitespace :V, will be in the next patch along with optimizations
Patch 13.100:
- A linebreak is now added if the end of an import block is not whitespace
- Fixed imports showing up in var declarations when the keyword is at the start of the line using frontier patterns
Also the post just reached 1k views!
Patch 13.101:
- Added single line docstrings
(jk this always existed i just didnt mention it until now)
the plugin might just be perfect now, what else can you even add other than command line support
The only other thing I can think of is making it so that imports are pushed onto the last import behind the cursor pos so you aren’t forced to the [directives → services → modules] flow, but that’s not really a big priority… Honestly i don’t think theres much else to do other than optimizations atp
small issue where if you place an import by an occupied space the variable gets called before it’s defined
--!strict
ReplicatedStorage -- pre autocomplete
-- test comment
--!strict
ReplicatedStorage
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- test comment
again, very minor bug with an easy fix, just wanted to let you know anyway
Wdym by gets called? //30charlimit//
it attempts to use the variable before it’s defined
Ahh yeah that’s just because it follows a strict definition pattern, again this is why i wanted to make imports be defined after the first import/directive behind the cursor
Patch 13.103:
-
ImportGsubConfig
is nowImportVarTransform
, and now you must set it to the affected imports (Module
|Service
|Both
), and a piece of code that returns a function that accepts a string and returns a string.
I also added default values that can be used, for example--sc set: ImportVarTransform; CamelCase
instead of writing out the full code. Here are the ones you can use:
Patch 13.104:
- Fixed imports appearing when doing 2 non-import contexts in the same line (e.g doing “local a = “b” local b = “pl”” means you get import suggestions for b when you shouldn’t), this is possible with my new cool_match and cool_find functions which can match backwards! (ROBLOX PLEASE MAKE THIS A BUILTIN PARAMETER FOR STRING.FIND AND STRING.MATCH IM BEGGING YOU)
Fixed in newest update, sorry accidentally put 2 string.finds inside eachother lol