Skip to content

Commit

Permalink
Fix quick input list null reference exception
Browse files Browse the repository at this point in the history
Fixes #63956

The root cause is that `IListOptions` was untyped here. This hid an implicit `any` in `identityProvider`. We were accessing an non-existant property on the `any` value
  • Loading branch information
mjbvz committed Nov 29, 2018
1 parent 5df76d3 commit 8f4870c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vs/workbench/browser/parts/quickinput/quickInputList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { Action } from 'vs/base/common/actions';
import { getIconClass } from 'vs/workbench/browser/parts/quickinput/quickInputUtils';
import { IListOptions } from 'vs/base/browser/ui/list/listWidget';

const $ = dom.$;

Expand Down Expand Up @@ -244,11 +245,11 @@ export class QuickInputList {
this.container = dom.append(this.parent, $('.quick-input-list'));
const delegate = new ListElementDelegate();
this.list = this.instantiationService.createInstance(WorkbenchList, this.container, delegate, [new ListElementRenderer()], {
identityProvider: { getId: element => element.label },
identityProvider: { getId: element => element.saneLabel },
openController: { shouldOpen: () => false }, // Workaround #58124
setRowLineHeight: false,
multipleSelectionSupport: false
}) as WorkbenchList<ListElement>;
} as IListOptions<ListElement>) as WorkbenchList<ListElement>;
this.list.getHTMLElement().id = id;
this.disposables.push(this.list);
this.disposables.push(this.list.onKeyDown(e => {
Expand Down

0 comments on commit 8f4870c

Please sign in to comment.