Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: OS Version: Version: 1.68.1 (user setup) Commit: Date: 2022-06-14T12:48:58.283Z Electron: 17.4.7 Chromium: 98.0.4758.141 16.13.0 V8: 9.8.177.13-electron.0 OS: Windows_NT x64 10.0. Steps to Reproduce: a TreeView. I'm using canSelectMany but this does not appear to make a difference one or more items in the view reveal with focus: true and select: false item will be expanded, but will not be scrolled to; instead one of the selected nodes is still shown. If no node is selected, the focused item is shown as expected. My use case is that I want to allow selecting multiple items in a tree, but the easiest way to navigate the tree is by clicking in a different view. When that happens, I call "reveal". I do not want to select as that would prevent multi-selection. So instead I chose "focus", which would be fine, except that if any selection exists in the tree, the tree will not scroll to the newly revealed node. Instead, it keeps one of the selected nodes visible (always the same one, not necessarily the closest one)
can you try out the latest insider build of VS Code: if the issue is fixed there, can you please respond with so we can mark this issue as verified to be fixed?
<!-- AUTHORVERIFICATIONREQUEST --This bug has been fixed in the latest release of ! you can help us out by commenting if things are now working as expected. If things still don't seem right, please ensure you're on version of Insiders (today's or later - you can use in the command palette to check), and leave a comment letting us know what isn't working as expected. Happy Coding!
or maybe if you could provide steps. I tried to follow the original steps but I wasn't quite sure I understood.
/verified

Discussion:
protected abstract activate(): void; <del> focus(reveal: boolean = true): void { </del> <ins> focus(reveal: boolean = true, revealItem?: ITreeItem): void { </ins> if (this.tree && this.root.children && this.root.children.length > 0) { // Make sure the current selected element is revealed <del> const selectedElement = this.tree.getSelection()[0]; if (selectedElement && reveal) { this.tree.reveal(selectedElement, 0.5); </del> <ins> const element = revealItem ?? this.tree.getSelection()[0]; if (element && reveal) { this.tree.reveal(element, 0.5); </ins> } // Pass Focus to Viewer

setFocus(item: ITreeItem): void { if (this.tree) { <del> this.focus(); </del> <ins> this.focus(true, item); </ins> this.tree.setFocus([item]); } }