forked from microsoft/vscode
-
Notifications
You must be signed in to change notification settings - Fork 494
Commit db6bcdf
authored
Improve performance of QuickPickList (microsoft#184661)
Highlights:
* remove Object.assign [usage](https://github.com/microsoft/vscode/blob/76ec379410c009cdfdde52fc00e89c97bf745e3c/src/vs/platform/quickinput/browser/quickInputList.ts#L92)
* remove [extra reduce
](https://github.com/microsoft/vscode/blob/76ec379410c009cdfdde52fc00e89c97bf745e3c/src/vs/platform/quickinput/browser/quickInputList.ts#L593)
* `show-checkboxes` that can be [moved out of reduce](https://github.com/microsoft/vscode/blob/76ec379410c009cdfdde52fc00e89c97bf745e3c/src/vs/platform/quickinput/browser/quickInputList.ts#L553) and computed once
* move [saneLabel & other sane things](https://github.com/microsoft/vscode/blob/76ec379410c009cdfdde52fc00e89c97bf745e3c/src/vs/platform/quickinput/browser/quickInputList.ts#L535) into ListElement to compute there using Lazy
* remove regex newline replacement with `labelEscapeNewLines`
NOTE: that last bullet means new lines will now be rendered as `⏎` instead of just a space. I see this as an improvement but we'll see if anyone complains. If they, do it's easy to bring back the old behavior while keeping the perf gains in this PR (they'd be computed lazily)
Lowlights:
I attempted to remove [onChecked in ListElement](https://github.com/microsoft/vscode/blob/76ec379410c009cdfdde52fc00e89c97bf745e3c/src/vs/platform/quickinput/browser/quickInputList.ts#L587) for one big emitter... but I don't think this is possible given these other usages:
* [In the QuickInputAccessibilityProvider](https://github.com/microsoft/vscode/blob/dd2441f7ba44e0aa46bd52005e4f8066d72fc3d7/src/vs/platform/quickinput/browser/quickInputList.ts#L1012) to inform if the element is checked
* [In the renderElement](https://github.com/microsoft/vscode/blob/dd2441f7ba44e0aa46bd52005e4f8066d72fc3d7/src/vs/platform/quickinput/browser/quickInputList.ts#L174) that updates the actual checkbox item
Fixes microsoft#1846151 parent addb079 commit db6bcdfCopy full SHA for db6bcdf
File tree
Expand file treeCollapse file tree
2 files changed
+186
-105
lines changedFilter options
- src/vs/platform/quickinput
- browser
- common
Expand file treeCollapse file tree
2 files changed
+186
-105
lines changed
0 commit comments