Skip to content

workbench.files.action.focusFilesExplorer focuses on wrong file if focus and highlight is on different file #149777

@ZYinMD

Description

@ZYinMD

Issue Type: Bug

Steps to Reproduce:

  1. click on an editor to focus on it
  2. command pallet > File: Focus on Files Explorer (aka workbench.files.action.focusFilesExplorer)
  3. press key a few times to move the highlight
  4. repeat step 1 -> 2 -> 3

Expected behavior:
on step 2, keyboard cursor focuses to the current file

Actual behavior:
on step 2, keyboard cursor focuses onto the previously highlighted file

Why I think it's a bug:

  1. because of how this command is named (it belongs to File:)
  2. because I believe this behavior changed in July 2021 or so, from the expected behavior to the actual behavior.
  3. because there are already two other commands that achieve the same effect: Explorer: Focus on Folders View and View: Show Explorer. We likely didn't mean to have a third command doing the same thing.

I suspect this is the root cause of #130598. If this gets fixed, #130598 will be fixed too.

VS Code version: Code 1.67.1 (da15b6f, 2022-05-06T12:37:03.389Z)
OS version: Windows_NT x64 10.0.19044
Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 7 5700U with Radeon Graphics (16 x 1797)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 31.34GB (13.27GB free)
Process Argv --crash-reporter-id 76333b68-ca09-45f5-9a16-77e964093e64
Screen Reader no
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30475216
vsclangdc:30486549

Metadata

Metadata

Assignees

Labels

*duplicateIssue identified as a duplicate of another issue(s)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions