Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@instance methods without @memberof are marked as static (jsdoc 3.5.5, plugin 2.2.0) #1

Open
eloquence opened this issue Nov 3, 2017 · 1 comment

Comments

@eloquence
Copy link

eloquence commented Nov 3, 2017

I use an ODM which associates instance methods with a Model like so:

Model.define("someFunction", someFunction)

I therefore have to tell jsdoc via @instance that these are instance methods, since there is no class structure that it can parse. Unfortunately, even with the plugin enabled, if I don't also specify @memberof, jsdoc will classify these methods as static, which negates much of the value of this plugin for my use case. :-( Would it be feasible for the package to enforce the @instance tag for namespace membership that is implicitly assigned?

@Atifba86
Copy link

Hey, It sounds like you're working with a scenario where you're defining functions within a namespace without an explicit class structure, and you're using JsDoc to document these functions. The @instance tag is typically used to indicate that a method is an instance method rather than a static one, and the @memberof tag is used to specify the namespace or object to which the method belongs. While JsDoc is a powerful tool for documenting JavaScript code, the behavior you're describing, where you have to explicitly use @memberof to avoid methods being classified as static even when using @instance could be related to the specific JsDoc plugin or configuration you're using. As of my last knowledge, JsDoc doesn't natively support the concept of instance methods without an associated class. It typically assumes that instance methods are associated with classes. The @instance tag is often used in the context of classes, and if you're using it outside of that context, it might not have the intended effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants