ModuleScripts and intellisense

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?

No intellisense is a bit of a pain.

Edit; example of problem

errorfound

2 Likes

Studio’s intellisense isn’t very helpful. Although Roblox is interested in improving it.

Similarly, Rojo’s intellisense still isn’t ideal; even with an overwhelming number of extensions.

You’ll find yourself referencing your other scripts (and hopefully their commented documentation) a lot.

5 Likes

You should be a diplomat.
Thanks.

That doesn’t seem right.

1 Like

Correction to my post: Intellisense works with relative paths require(script.Parent.foo).bar() but not absolute paths require(ReplicatedStorage.baz).qux()

Doesn’t seem to be the case for me.

Happens essentially all of the time for me. Try restarting studio*?* or testing in a full game.

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.

1 Like

Thanks for your posts.

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.

1 Like

Here’s the problem caught live on camera (that’s me being facetious).

errorfound

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.

1 Like

You could try changing the order of how the table is created.

function module.Constants()
local newConstants = {}
newConstants.AAA = 1
newConstants.BBB = 2
return newConstants
end

EDIT: Personally this method works for me.