Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Reveal Active FileNew to Visual Studio Code? Get it now.
Reveal Active File

Reveal Active File

Jiahui Cen

|
2 installs
| (0) | Free
Adds a button above the Explorer file list to reveal the currently active file.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Reveal Active File

在 VS Code 资源管理器的文件列表标题栏增加一个“靶心”按钮。点击它,即可展开目录并选中当前编辑器中打开的文件,效果类似 PyCharm 的“从源代码自动定位/选择打开的文件”。

使用

  1. 安装扩展后,打开 VS Code 左侧的“资源管理器”。
  2. 打开任意工作区文件。
  3. 点击文件列表右上角的靶心图标(Reveal Active File in Explorer)。

也可以:

  • 打开命令面板,运行 Explorer: Reveal Active File in Explorer。
  • 使用快捷键:macOS 为 ⌥⌘R,Windows/Linux 为 Ctrl+Alt+R。

普通文本文件、自定义编辑器、Notebook 和差异对比编辑器均受支持。未保存的新文件没有实际路径,因此无法在文件列表中定位。

本地开发

  1. 用 VS Code 单独打开本目录。
  2. 按 F5 启动 Extension Development Host。
  3. 在新窗口中打开一个文件,然后点击资源管理器标题栏的靶心图标。

运行测试:

npm test

打包为 .vsix:

npm install
npm run package
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft