[英]How to list all the files of a specific extension in a folder in VS Code?
How to list all the files of a specific extension in a folder in VS Code?如何在VS Code的文件夹中列出特定扩展名的所有文件?
Let us suppose I have a folder with a deep subfolders structure.让我们假设我有一个具有深层子文件夹结构的文件夹。 In that structure there are a lot of files of different extensions like: .html, .ts, .scss.在该结构中有很多不同扩展名的文件,例如:.html、.ts、.scss。 Now I want to get a list of all the files with the.html extension.现在我想获取所有扩展名为 .html 的文件的列表。 How can I do that?我怎样才能做到这一点?
Preferably I want not to see the subfolders structure.最好我不想看到子文件夹结构。 Just as when I search for a specific word I can limit file types to a specific extension in a specific folder - in this case I am given a list of files, with which I can easily work without a need to expand directories or read through the different from what I need extensions.就像当我搜索特定单词时,我可以将文件类型限制为特定文件夹中的特定扩展名 - 在这种情况下,我会得到一个文件列表,我可以轻松地使用这些文件,而无需扩展目录或阅读不同于我需要的扩展。
Partial solution for the problem is to figure out what patterns one is looking for in the files, then it is possible to use the in files search.该问题的部分解决方案是找出在文件中寻找的模式,然后可以使用文件内搜索。 Eg ./pathToMyFolder/**/*.html
.例如./pathToMyFolder/**/*.html
。 But I just need to open each.html file and I do not have a pattern to look for.但我只需要打开 each.html 文件,我没有要查找的模式。 And expanding each subdirectory and traversing it makes things really messy and cumbersome for me.扩展每个子目录并遍历它让我觉得事情真的很混乱和麻烦。 Also, there are files with other extensions and filtering them out also takes time.此外,还有其他扩展名的文件,将它们过滤掉也需要时间。
Ctrl P and type *.[desired extension]. Ctrl P 并输入 *.[期望的扩展名]。 Say *.cs说 *.cs
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.