Skip to content

fix(1196): extend parameter matching with index fallback when name matching fails #1241

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #1196


ℹ️ This patch extends parameter matching by adding a fallback to index-based resolution when JSDoc parameter tag names do not match function parameter names, and also improves handling of nested array literals.


✅ Verification test - jsdocParamTagTypeLiteral

return xyz.p;
>xyz.p : any
->xyz : any
+>xyz : number
Copy link
Member

Choose a reason for hiding this comment

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

This seems suspect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This should be treated as an error paramTagNestedWithoutTopLevelObject

However, it seems that checkUnmatchedJSDocParameters hasn’t been migrated yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't mean it eliminates type changes, I only meant to point out that certain cases involving qualified names are not yet covered.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. I mean, this all seems like an improvement in any case. But, will leave to @sandersn to double check.

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

Successfully merging this pull request may close these issues.

Missing optional TSDOC param parsing?
2 participants