mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Fixed recent regression that caused a crash in the signature help provider.
This commit is contained in:
parent
56c6eddc47
commit
8d9ad7958d
@ -147,15 +147,17 @@ export class SignatureHelpProvider {
|
||||
|
||||
// If we have a typedKwargs, the param name will be wrong.
|
||||
const kwargsIndex = paramIndex >= params.length ? params.length - 1 : paramIndex;
|
||||
const kwargsParam = params[kwargsIndex];
|
||||
if (
|
||||
isTypedKwargs(kwargsParam) &&
|
||||
isClassInstance(kwargsParam.type) &&
|
||||
kwargsParam.type.details.typedDictEntries
|
||||
) {
|
||||
// Use the relative position in typed dict entries.
|
||||
const dictIndex = paramIndex - kwargsIndex;
|
||||
paramName = [...kwargsParam.type.details.typedDictEntries.keys()][dictIndex];
|
||||
if (kwargsIndex >= 0) {
|
||||
const kwargsParam = params[kwargsIndex];
|
||||
if (
|
||||
isTypedKwargs(kwargsParam) &&
|
||||
isClassInstance(kwargsParam.type) &&
|
||||
kwargsParam.type.details.typedDictEntries
|
||||
) {
|
||||
// Use the relative position in typed dict entries.
|
||||
const dictIndex = paramIndex - kwargsIndex;
|
||||
paramName = [...kwargsParam.type.details.typedDictEntries.keys()][dictIndex];
|
||||
}
|
||||
}
|
||||
|
||||
parameters.push({
|
||||
|
Loading…
Reference in New Issue
Block a user