Hello! I’m looking for a way to fix IntelliSense not showing doc comments for instance methods after using something like module.new()
I searched for any similar issues regarding this, but most of them were a different topic altogether (or I’m just blind)
I’d like to use method chaining on the returned instance and have my comments show up in IntelliSense for each instance method
I want to achieve this
But for the instance methods, the comments don’t appear
Sorry if I won’t be able to answer any questions beforehand, I’m anxious when it comes to asking for help
Is your module typechecked?
like type export? sorry if i wont be able to answer properly ><
oh wait u mean like --!strict?
I’m not on my computer to give proper scripts, but for example,
function module.new(Word:string,Age:number,AnotherWord:string?) : boolean
print(Word,Age)
return true
end
In this case, the function is typechecked. It tells IntelliSense that:
Word is a string
Age is a number
AnotherWord can either be a string or nil (optional argument)
The function returns a boolean
oh, annotations? i’ve added all of them on my methods
In that case it depends on how you’re requiring the module, or how it’s set up. I don’t know how you wrote it, so I can’t help much
1 Like
it’s alright, thank you for replying!!!
1 Like
SkrubDaNub
(ComradeSkrub)
April 30, 2025, 1:09pm
#8
Roblox please consider this feature as it would definitely be a quality of life improvement for us scripters. I find myself writing little comments next to my methods in modules so that I have a sense of understanding about the function when I need to use it later on during development.
However, I’m still required to open the modules to find the specific method so I can read the comments. It would be extremely helpful to display these comments when accessing the methods from other scripts which…
Is a feature request, so not possible yet
wow I should actually read the entire timeline.
I mean the doc comments work when requiring a module, not just when I do an instance method
or am I misunderstanding something?
SkrubDaNub
(ComradeSkrub)
April 30, 2025, 1:20pm
#10
o wait. You might be right…
That’s an unfortunate limitation for how intellisense handles self
.
Did this get resolved? I can’t tell if I’m crazy for having memories of self working correctly during parts of the last two years. The typing on self hasn’t actually worked for me in some time, and luau seems to get lost very easily in very common module patterns when metatables or __index are invlolved.
I’ve been burning ridiculous numbers of hours trying to find reliable patterns that allow Script Analysis and auto completion to work with code unless I explicitly define all the types up front…
I dunno if this is what you were asking, but if you meant the little comment explanations whenever you bring up a function or anything, you just do this:
--comment here will show up when referring to function
--and so will this one, as long as they directly above the function and touching
function example(text:string):never
print(text)
end
I’m assuming thats not what you are talking about, based on how everyone else said it wasn’t possible, and that I have no idea what “intellisense” means, but just incase.
that’s basically what I’m already doing, but the issue is different
I don’t know how to explain IntelliSense myself, sorry!!
in the module:
intellisense(?) would autofill as expected
one of the isnstance methods:
unexpectedly doesnt complete by intellisense: