文件中要包含的Visual Studio Code高级搜索通配符 [英] Visual Studio Code Advanced Search Wildcard in Files to Include
问题描述
我正在尝试为所有具有特定文件名标准的文件找到一行代码.我试图通过在 文件中放入 通配符 来利用Visual Studio代码的高级搜索 字段.但我无法实现这一目标.我尝试使用 星号(*)符号,但是我认为Visual Studio Code不接受.因此,我尝试搜索Internet,并使用.+?找到了
显然,Visual Studio Code支持 glob语法
,这确实很棒.要在问题中获得理想的结果,您只需要使用这种格式
./**/*& lt;partialFileName>
示例
文件夹结构:
|-应用|-用户|-list.ts | html | css | viewmodel|-form.ts | html | css | viewmodel|-汽车|-list.ts | html | css | viewmodel|-form.ts | html | css | viewmodel|-configurator.ts | html | css | viewmodel|-app.component.ts | html | css|-app.module.ts|-user.service.ts|-car.service.ts|-index.html|-main.ts|-style.css
让我们假设每个ViewModel文件都具有这个单词/代码/字符串 ICustomMatColumn
搜索关键字: ICustomMatColumn
要包含的文件:./**/* ViewModel.ts
搜索结果:
|-应用|-用户|-list.ts | viewmodel|-form.ts | viewmodel|-汽车|-list.ts | viewmodel|-form.ts | viewmodel|-configurator.ts | viewmodel
它将严格只包含您在 要包含的文件字段
中输入的带有partialFileName的文件I am trying to find a line of code to all my files with a specific file name criteria. I am trying to take advantage the Advanced Search of the Visual Studio Code by putting a wildcard in the files to include field of the search. But I wasn't able to achieve that. I tried to use asterisk (*) symbol, but I think the Visual Studio Code does not accept that. So I tried to search the internet and found this solution by using the .+?; however, it still does nothing.
Search Keyword
: ICustomMatColumn
files to include
: (wildcard)viewmodel.ts
Apparently, the Visual Studio Code supports glob syntax
which is really great. To achieve the desired result in the question you just need to do this format
./**/*< partialFileName >
Example
Folder Structure:
|-- app
|-- users
|-- list.ts|html|css|viewmodel
|-- form.ts|html|css|viewmodel
|-- cars
|-- list.ts|html|css|viewmodel
|-- form.ts|html|css|viewmodel
|-- configurator.ts|html|css|viewmodel
|-- app.component.ts|html|css
|-- app.module.ts
|-- user.service.ts
|-- car.service.ts
|-- index.html
|-- main.ts
|-- style.css
Let's Assume that every ViewModel file has this word/code/string ICustomMatColumn
Search Keyword: ICustomMatColumn
Files to Include: ./**/*ViewModel.ts
Search Result:
|-- app
|-- users
|-- list.ts|viewmodel
|-- form.ts|viewmodel
|-- cars
|-- list.ts|viewmodel
|-- form.ts|viewmodel
|-- configurator.ts|viewmodel
It will strictly include only the files with the partialFileName that you entered in the files to include field
这篇关于文件中要包含的Visual Studio Code高级搜索通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!