Skip to content

Commit b12b061

Browse files
authored
Throw when invalid parameter hint label is passed in (microsoft#161125)
Fixes microsoft#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
1 parent f05eb4a commit b12b061

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,10 @@ export namespace CompletionItem {
11341134

11351135
export namespace ParameterInformation {
11361136
export function from(info: types.ParameterInformation): languages.ParameterInformation {
1137+
if (typeof info.label !== 'string' && !Array.isArray(info.label)) {
1138+
throw new TypeError('Invalid label');
1139+
}
1140+
11371141
return {
11381142
label: info.label,
11391143
documentation: MarkdownString.fromStrict(info.documentation)

0 commit comments

Comments
 (0)