Skip to content

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

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 10 commits into from
Jun 24, 2025

Conversation

a-tarasyuk
Copy link
Contributor

@a-tarasyuk a-tarasyuk commented Jun 19, 2025

Fixes #1196
Fixes #1225


ℹ️ 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

@jakebailey jakebailey requested a review from sandersn June 24, 2025 13:36
@jakebailey
Copy link
Member

This PR needs a merge from main after other PRs were merged.

->opts5[0].what : { a: string; bad: { idea: string; oh: boolean;}; }
->opts5[0] : { help: string; what: { a: string; bad: { idea: string; oh: boolean; };}; unnest: number; }
->opts5 : { help: string; what: { a: string; bad: { idea: string; oh: boolean; };}; unnest: number; }[]
->0 : 0
+>opts5[0].what : { a: string; bad: { idea: string; oh: boolean; }[]; }
Copy link
Member

Choose a reason for hiding this comment

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

bad being an array looks correct; I just can't figure out how Strada thought it wasn't

@sandersn
Copy link
Member

Since there's a merge needed, could you also delete the unused host parameter from reparseJSDocTypeLiteral?

@jakebailey jakebailey added this pull request to the merge queue Jun 24, 2025
Merged via the queue into microsoft:main with commit 8975084 Jun 24, 2025
22 checks passed
github-actions bot added a commit to zshannon/typescript-go that referenced this pull request Jun 25, 2025
# 1.0.0 (2025-06-25)

### Bug Fixes

* **1196:** extend parameter matching with index fallback when name matching fails ([microsoft#1241](https://github.com/zshannon/typescript-go/issues/1241)) ([8975084](8975084))
* **1250:** fix bigint literal type declaration emit ([microsoft#1258](https://github.com/zshannon/typescript-go/issues/1258)) ([6e03d62](6e03d62))
* **949:** fix unmatched closing tags in JSX with referenced identifiers ([microsoft#1056](https://github.com/zshannon/typescript-go/issues/1056)) ([671b5cb](671b5cb))
* avoid treating await in jsdoc as top-level await ([microsoft#877](https://github.com/zshannon/typescript-go/issues/877)) ([656029e](656029e))
* **docs:** Ensure function documentation appears on hover ([microsoft#739](https://github.com/zshannon/typescript-go/issues/739)) ([b2655e6](b2655e6))

### Features

* **911:** erasableSyntaxOnly not supported ([microsoft#1068](https://github.com/zshannon/typescript-go/issues/1068)) ([ddb1ebb](ddb1ebb))

### Performance Improvements

* use append instead of Concat in appendLookupLocations ([microsoft#632](https://github.com/zshannon/typescript-go/issues/632)) ([026e5f9](026e5f9))
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.

Destructured JSDoc Arguments No Longer Collectively Typeable Using Arbitrary Name Missing optional JSDoc param parsing
3 participants