As a relatively new developer, I’ve just started using ModuleScripts.
Roblox Studio doesn’t seem have intellisense for my modules.
By this I mean if I type module name then the dot operator, it doesn’t prompt with the names of the module’s functions.
Is that a bug? Normal? A setting?
Correction to my post: Intellisense works with relative paths require(script.Parent.foo).bar() but not absolute paths require(ReplicatedStorage.baz).qux()
I don’t exactly know what doing either of those would do. Care to flesh that out? A full game wouldn’t yield different results if I’m doing the exact same thing and I don’t know what restarting Studio would do.
My theory is that it’s storing it into memory when the module was created, not too sure; this may have been recently fixed but I viscerally remember intellisense being unhelpful with modules, and GetService.
It might be a cache then. Initially, the only time intellisense didn’t trigger for me is if I directly accessed a member of the ModuleScript after the require statement (no variables) or I used GetService. All other cases triggered intellisense as expected.
Regardless, you’re still right in saying that intellisense currently is unfriendly towards anything that isn’t Roblox-created and even then, it can get janky.
There’s definitely an intermittent problem with my Roblox Studio’s intellisense. After seeing your post I tried it, and this (part of) module;
function module.Constants()
return {
AAA = 1,
BBB = 2}
end
Did result in intellisense working in another script that required the module using absolute paths (eg game.ReplicatedStorage.MyModuleScript).
Excitedly, I tried the bit of code that I actually wanted (same format as sample above), and not only did it not work, now the AAA/BBB sample also doesn’t work (as in no intellisense for it).
real world pause 1;
I’ve just restarted RS, and it didn’t fix the problem.
real world pause 2;
I’ve just created a new place(game?), added the ModuleScript and Script(server) and intellisense works. Exact same ModuleScript code that fails in my “real” game.
pause 3;
I’ve tried relative and absolute paths. IS fails both ways.
I have a large codebase. I wonder if that’s causing problems. Of course, it was my hope that ModuleScripts could help reduce my code by getting rid of some repetitive stuff.
Here’s the problem caught live on camera (that’s me being facetious).
The modulescript is stored in ReplicatedStorage.
Both scripts seen in this are LocalScripts.
I do intend to lodge a bug report later. For now I’m still trying to investigate and/or find a solution. Lack of intellisense is a productivity killer.