Skip to content

support @extends in jsdoc #18706

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 6 commits into from
Oct 9, 2017

Conversation

aozgaa
Copy link
Contributor

@aozgaa aozgaa commented Sep 22, 2017

Fixes #18701

@@ -4765,8 +4765,8 @@ namespace ts {
return node.kind === SyntaxKind.JSDocComment;
}

export function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag {
return node.kind === SyntaxKind.JSDocAugmentsTag;
export function isJSDocAugmentsOrExtendsTag(node: Node): node is JSDocAugmentsOrExtendsTag {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is part of the public API now, we should not break that.

@ghost
Copy link

ghost commented Sep 26, 2017

Looks like this will cause merge conflicts in #18775, but I'll handle it once this is in.

Probably fixes #17072.

case SyntaxKind.JSDocAugmentsTag:
return visitNode(cbNode, (<JSDocAugmentsTag>node).typeExpression);
case SyntaxKind.JSDocAugmentsOrExtendsTag:
case SyntaxKind.JSDocExtendsTag:
Copy link
Member

Choose a reason for hiding this comment

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

It seems like SyntaxKind.JSDocExtendsTag is never assigned anywhere?

@@ -363,7 +363,8 @@ namespace ts {
JSDocVariadicType,
JSDocComment,
JSDocTag,
JSDocAugmentsTag,
JSDocAugmentsOrExtendsTag,
Copy link
Member

Choose a reason for hiding this comment

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

I think we should keep JSDocAugmentsTag and just let @extends be a silent synonym for it in the parser. I don't think it's bad, for example, if the roundtrip emit converts @extends to @augment. And that's the worst side-effect I can think of.

@ghost
Copy link

ghost commented Oct 2, 2017

@sandersn mentioned in #18854 (review) that we should have an error if both @extends and @augments tags are present, but continue on using just the type from @extends.

@@ -4247,6 +4247,12 @@ namespace ts {
return find(tags, doc => doc.kind === kind);
}

/** Gets all JSDoc tags of a specified kind, or undefined if not present. */
export function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray<JSDocTag> | undefined {
Copy link
Member

Choose a reason for hiding this comment

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

remove 'All'

@aozgaa aozgaa merged commit 1db7623 into microsoft:master Oct 9, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 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.

6 participants