简体   繁体   English

在 vscode 中模糊文件打开

[英]Fuzzy file opening in vscode

I am exploring vscode after using atom for a long while.在使用atom很长一段时间后,我正在探索vscode One of the things I'm missing is an equivalent of the lovely package advanced-open-file .我缺少的一件事是相当于可爱的 package advanced-open-file Is there something similar to this in vscode? vscode中有类似的东西吗?

I found the advanced-new-file extension, but it is only helpful when it comes to new files.我找到了advanced-new-file扩展名,但它只有在涉及到新文件时才有用。 I would like to be able to quickly open files from all over my local files (not only the workspace).我希望能够快速打开我所有本地文件(不仅是工作区)中的文件。

Edit: I found the option of workbench.action.quickOpen ;编辑:我找到了workbench.action.quickOpen的选项; but it doesn't allow opening files from the whole file system.但它不允许从整个文件系统打开文件。

Sorry, but currently the answer is no. 对不起,但目前的答案是否定的。 The problem is that input box doesn't provide a way to listen to key events: GitHub issue , so even the extensions can't do that currently. 问题是输入框没有提供监听键事件的方法: GitHub问题 ,所以即使扩展当前也不能这样做。 Here's the comment from advanced-new-file extension creator: 以下是高级新文件扩展程序创建者的评论:

Because VSCode extensions don't yet have the ability to do type-ahead autocomplete within the text input box (See https://github.com/Microsoft/vscode/issues/426 ), we work around this limitation and provide autocomplete using a two-step workflow of selecting existing path, then providing new filename/path relative to the selection. 由于VSCode扩展还没有能力在文本输入框中执行预先输入自动完成功能(请参阅https://github.com/Microsoft/vscode/issues/426 ),我们可以解决此限制并使用以下方法提供自动完成功能。选择现有路径的两步工作流程,然后提供相对于选择的新文件名/路径。

The good news is that there is a new API addressing this issue, but it's currently in 'proposed' state and can't be used for published extensions. 好消息是有一个新的API解决了这个问题,但它目前处于“建议”状态,不能用于已发布的扩展。

One workaround could be typing code -r some/path in integrated terminal and using 'tab' for autocomplete. 一种解决方法是在集成终端中键入code -r some/path并使用“tab”进行自动完成。

The Fuzzy search extension seems to work for me. 模糊搜索扩展似乎对我有用。

It adds a new action to the command palette which allows you to search for files in the current project and open them.它向命令面板添加了一个新操作,允许您在当前项目中搜索文件并打开它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM