mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Add fallback for invalid signature help data structure
Fixes #80617 Some extensions may provide us with bad data types (if they are js or don't have strict null enabled for example). Try to be more careful about handling such cases by falling back to an empty array instead of undefined
This commit is contained in:
@@ -859,7 +859,7 @@ export namespace SignatureInformation {
|
||||
return {
|
||||
label: info.label,
|
||||
documentation: info.documentation ? MarkdownString.fromStrict(info.documentation) : undefined,
|
||||
parameters: info.parameters && info.parameters.map(ParameterInformation.from)
|
||||
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.from) : []
|
||||
};
|
||||
}
|
||||
|
||||
@@ -867,7 +867,7 @@ export namespace SignatureInformation {
|
||||
return {
|
||||
label: info.label,
|
||||
documentation: htmlContent.isMarkdownString(info.documentation) ? MarkdownString.to(info.documentation) : info.documentation,
|
||||
parameters: info.parameters && info.parameters.map(ParameterInformation.to)
|
||||
parameters: Array.isArray(info.parameters) ? info.parameters.map(ParameterInformation.to) : []
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -878,7 +878,7 @@ export namespace SignatureHelp {
|
||||
return {
|
||||
activeSignature: help.activeSignature,
|
||||
activeParameter: help.activeParameter,
|
||||
signatures: help.signatures && help.signatures.map(SignatureInformation.from)
|
||||
signatures: Array.isArray(help.signatures) ? help.signatures.map(SignatureInformation.from) : [],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -886,7 +886,7 @@ export namespace SignatureHelp {
|
||||
return {
|
||||
activeSignature: help.activeSignature,
|
||||
activeParameter: help.activeParameter,
|
||||
signatures: help.signatures && help.signatures.map(SignatureInformation.to)
|
||||
signatures: Array.isArray(help.signatures) ? help.signatures.map(SignatureInformation.to) : [],
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user