Skip to content

Support JSDoc on class / obj. literal getters #7309

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

Merged
merged 3 commits into from
Mar 3, 2016

Conversation

RyanCavanaugh
Copy link
Member

Fixes #6878

@DanielRosenwasser
Copy link
Member

Can you add a test for setters too?

1 similar comment
@DanielRosenwasser
Copy link
Member

Can you add a test for setters too?

@RyanCavanaugh
Copy link
Member Author

We're not supporting JSDoc on setters

//// } catch (x) { x--; }
//// return 23;
//// let x = {
//// /** This is cool*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you specify the type for getters, same as you can with variables? i.e.

/** This is cool
  * @type {Element}
  */
  get m() { return elementFactory(); }
}

const setter = <AccessorDeclaration>getDeclarationOfKind(symbol, SyntaxKind.SetAccessor);

if (getter.flags & NodeFlags.JavaScriptFile) {
const jsDocType = getTypeForVariableLikeDeclarationFromJSDocComment(getter);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about the param type of the setter function, we do this in TS..

RyanCavanaugh added a commit that referenced this pull request Mar 3, 2016
Support JSDoc on class / obj. literal getters
@RyanCavanaugh RyanCavanaugh merged commit 311f8dd into microsoft:master Mar 3, 2016
@RyanCavanaugh RyanCavanaugh deleted the fix6878 branch March 3, 2016 23:50
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants