Allow Module autocomplete in StarterPlayerScripts

Currently, requiring a module thats located in Player.PlayerScripts alllows for autocomplete of the path if the module is also located in StarterPlayer.StarterPlayerScripts. Unfortunately, it does not allow for autocomplete of the module contents, and you are met with an unknown require.

Simplest repro:
image

LocalScript:

local module = require(game.Players.LocalPlayer.PlayerScripts.ModuleScript) -- path autocompletes

But the require is unknown:
image

If this were to be implemented, it would greatly improve my workflow, since I currently have to do some ugly hacks, for instance:

  • Renaming StarterPlayerScripts to PlayerScripts and using :FindFirstAncestor("PlayerScripts") (this requires the server to rename it back when the game is running, otherwise you will get warnings in console)
  • Using some ugly typecasting like :: typeof(game.StarterPlayer.StarterPlayerScripts)

I also don’t really know if I should classify this as a bug report or feature request, so please let me know :sweat_smile:

2 Likes

What? Can’t you just do:

local module = require(script.Parent:WaitForChild("ModuleScript")) 

The local script is in the same folder as the module script(PlayerScripts), so I don’t see why you can’t just do this.

And please, cache the player.

I am aware, but if you have a bunch of nested folders, it starts getting pretty ugly with the amount of .Parents.

Yes, I know, that was just the minimal example possible.

Don’t be condescending and mean for no reason. You are not personally affected by this becoming a feature, nor are you personally affected by the specifics of their repro; if all you wanted to do was share a workaround, you can do that without infantilizing the OP.

2 Likes

They weren’t, I read only confusion from their reply. I also am showing confusion on why autocomplete wouldn’t work with StarterPlayerScripts. But, to my knowledge, ModuleScripts being a direct child of the Player doesn’t sound like good organization