mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Throw when invalid parameter hint label is passed in (#161125)
Fixes #161055 I'm fairly sure that our code is correct if everything has the expected types. However extensions may be passing us invalid data so that the types are runtime don't match what we expect
This commit is contained in:
parent
f05eb4af4f
commit
b12b061b7e
|
@ -1134,6 +1134,10 @@ export namespace CompletionItem {
|
|||
|
||||
export namespace ParameterInformation {
|
||||
export function from(info: types.ParameterInformation): languages.ParameterInformation {
|
||||
if (typeof info.label !== 'string' && !Array.isArray(info.label)) {
|
||||
throw new TypeError('Invalid label');
|
||||
}
|
||||
|
||||
return {
|
||||
label: info.label,
|
||||
documentation: MarkdownString.fromStrict(info.documentation)
|
||||
|
|
Loading…
Reference in a new issue