IntelliSense not showing doc comments for instance methods after using module.new()

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
image

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!!! :heart:

1 Like

Is a feature request, so not possible yet :frowning:
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?

o wait. You might be right…

That’s an unfortunate limitation for how intellisense handles self.

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:
image

unexpectedly doesnt complete by intellisense:
image