Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Locate Active File in ExplorerNew to Visual Studio Code? Get it now.
Locate Active File in Explorer

Locate Active File in Explorer

Wang Tianyu

|
3 installs
| (0) | Free
Adds a toolbar button to the Explorer Files view to locate the active file in the Explorer.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Locate Active File in Explorer

A VS Code extension that adds a toolbar button to the Explorer Files view. Click the button to locate the active file in the Explorer without opening the context menu or Command Palette.

Features

  • One-click locate: Adds a go-to-file icon to the right side of the Explorer Files title bar.
  • Fast navigation: Locates, expands, and highlights the file that belongs to the currently active editor.
  • Native behavior: Uses VS Code's built-in workbench.files.action.showActiveFileInExplorer command, so the locate behavior stays consistent with the default VS Code action.

Why Use It

When working in large projects, it is common to jump between many files. To find the current file in the project tree, you usually need to:

  1. Right-click in the active editor and use VS Code's built-in Explorer locate action.
  2. Switch to Explorer with Ctrl+Shift+E and search manually.
  3. Run the command from the Command Palette with Ctrl+Shift+P.

This extension turns that repeated workflow into a single click.

How To Use

  1. Install the extension.
  2. Open any file.
  3. Hover over the Files section title in the VS Code Explorer.
  4. Click the go-to-file icon in the title bar.
  5. VS Code locates and highlights the active file in the Explorer.

Known Limitations

  • The button is visible only in the Explorer Files view (workbench.explorer.fileView). If that view is hidden in your layout, the button is not shown.
  • The button icon uses VS Code's built-in Codicon icon set.

Changelog

See CHANGELOG.md in this repository.


在资源管理器中定位当前文件

这个 VS Code 扩展会在“资源管理器”视图的“文件”分区标题栏增加一个快捷图标按钮。点击按钮即可在资源管理器中定位当前文件,无需再打开右键菜单或命令面板。

功能

  • 一键定位:在 VS Code “资源管理器”的“文件”标题栏右侧新增一个 go-to-file 图标。
  • 快速访问:点击按钮后,会在文件树中展开并高亮当前激活编辑器对应的文件。
  • 原生体验:调用 VS Code 内置命令 workbench.files.action.showActiveFileInExplorer,定位行为与 VS Code 默认操作保持一致。

解决痛点

在复杂项目中开发时,我们经常会在多个文件之间跳转。想查看当前文件在项目结构中的位置,通常需要:

  1. 在当前文件编辑区右键,执行 VS Code 内置的资源管理器定位操作。
  2. 使用快捷键 Ctrl+Shift+E 切换到资源管理器,然后手动查找。
  3. 通过命令面板 (Ctrl+Shift+P) 执行命令。

这个扩展把上述高频操作简化成一次点击。

如何使用

  1. 安装本扩展。
  2. 打开任意文件。
  3. 将鼠标悬停在 VS Code 左侧“资源管理器”的“文件”分区标题栏上。
  4. 点击标题栏中的 go-to-file 图标。
  5. VS Code 会在资源管理器中定位并高亮当前文件。

已知限制

  • 按钮仅在“资源管理器”的“文件”视图 (workbench.explorer.fileView) 中可见。如果你的布局中隐藏了此视图,按钮不会显示。
  • 按钮图标依赖 VS Code 内置的 Codicon 图标库。

更新日志

详见仓库中的 CHANGELOG.md。

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft