mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
Fix inlay hint crash for jsdoc function type syntax (#47684)
* Fix inlay hint crash for jsdoc function type syntax Parameters in JSDoc function types do not have names. The type does not reflect this. This PR fixes the crash; I'll see how much churn it causes to fix the type as well. Fixes #47606 * make inlay hints test smaller
This commit is contained in:
committed by
GitHub
parent
7183b14831
commit
1ebdcc6fb8
@@ -31508,6 +31508,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getParameterIdentifierNameAtPosition(signature: Signature, pos: number): [parameterName: __String, isRestParameter: boolean] | undefined {
|
||||
if (signature.declaration?.kind === SyntaxKind.JSDocFunctionType) {
|
||||
return undefined;
|
||||
}
|
||||
const paramCount = signature.parameters.length - (signatureHasRestParameter(signature) ? 1 : 0);
|
||||
if (pos < paramCount) {
|
||||
const param = signature.parameters[pos];
|
||||
|
||||
Reference in New Issue
Block a user