Skip to content

Fix extract type on JS function params #34745

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 1 commit into from
Oct 28, 2019

Conversation

andrewbranch
Copy link
Member

Fixes #34580

When the JSDoc is on the function param itself, the JSDoc container isn’t a statement. As far as I could tell, though, there’s no reason those nodes have to be the same. Maybe @Kingwl can think of a test case where this would fail?


// @allowJs: true
// @Filename: a.js
////function a(/** @type {/*a*/string/*b*/} */ b) {}
Copy link
Member

Choose a reason for hiding this comment

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

this is my favourite place to write jsdoc

@andrewbranch andrewbranch merged commit 634e0ad into microsoft:master Oct 28, 2019
@andrewbranch
Copy link
Member Author

@typescript-bot cherry-pick this to release-3.7

@typescript-bot
Copy link
Collaborator

Hey @andrewbranch, I've opened #34766 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Oct 28, 2019
Component commits:
07a371b Fix extract type on JS function params
andrewbranch pushed a commit that referenced this pull request Oct 28, 2019
Component commits:
07a371b Fix extract type on JS function params
@andrewbranch andrewbranch deleted the bug/34580 branch October 28, 2019 18:04
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

Successfully merging this pull request may close these issues.

TS 3.7 getApplicableRefactors — Error: Debug Failure. Should find a statement
4 participants