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

JSDoc property and memberof does not work in salsa #7237

Open
Thaina opened this issue Feb 25, 2016 · 2 comments
Open

JSDoc property and memberof does not work in salsa #7237

Thaina opened this issue Feb 25, 2016 · 2 comments
Labels
Domain: JavaScript The issue relates to JavaScript specifically Domain: JSDoc Relates to JSDoc parsing and type generation In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@Thaina
Copy link

Thaina commented Feb 25, 2016

Since we cannot register intellisense by set a value directly. salsa should support @memberof or @property tag

image

It also useful for extension method, set a prototype like this cannot registered in intellisense

image

Which, I think we don't need automatic intellisense in case like this, but please provide some way we could write JSDoc to register custom member on intellisense

@mfulton26
Copy link
Contributor

Will the solution for this also include support for @external (for adding a member to a type that is built-in or is from some other module)?

https://jsdoc.app/tags-external.html

Or perhaps there is already some other open issue for such or we can create one. Thank you.

@donmccurdy
Copy link

Kind of a workaround, maybe...

class Value {
  constructor() {
    Object.defineProperty( this, 'id', { value: _nextId ++ } );
    /** @type {number} id */
    this.id;
  }
}

... but this.id; remains in the production source code, which doesn't feel great. Would be wonderful to be able to write this instead:

/**
 * @property {number} id
 */
class Value {
  constructor() {
    Object.defineProperty( this, 'id', { value: _nextId ++ } );
  }
}

I'm investigating setting up type definitions for a large project (https://threejs.org/) and this issue appears to be a blocker, unfortunately. If this is something for which a PR would be welcome and possible, please let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: JavaScript The issue relates to JavaScript specifically Domain: JSDoc Relates to JSDoc parsing and type generation In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

6 participants