Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
a56ec40e
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a56ec40e
编写于
7月 11, 2018
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
findTextInFiles - add second signature for optional options
上级
74bfb73f
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
65 addition
and
2 deletion
+65
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+52
-1
src/vs/workbench/api/node/extHost.api.impl.ts
src/vs/workbench/api/node/extHost.api.impl.ts
+13
-1
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
a56ec40e
...
...
@@ -189,12 +189,45 @@ declare module 'vscode' {
provideTextSearchResults
?(
query
:
TextSearchQuery
,
options
:
TextSearchOptions
,
progress
:
Progress
<
TextSearchResult
>
,
token
:
CancellationToken
):
Thenable
<
void
>
;
}
/**
* Options that can be set on a findTextInFiles search.
*/
export
interface
FindTextInFilesOptions
{
/**
* A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern
* will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern)
* to restrict the search results to a [workspace folder](#WorkspaceFolder).
*/
include
?:
GlobPattern
;
exclude
?:
GlobPattern
;
/**
* A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern
* will be matched against the file paths of resulting matches relative to their workspace. When `undefined` only default excludes will
* apply, when `null` no excludes will apply.
*/
exclude
?:
GlobPattern
|
null
;
/**
* The maximum number of results to search for
*/
maxResults
?:
number
;
/**
* Whether external files that exclude files, like .gitignore, should be respected.
* See the vscode setting `"search.useIgnoreFiles"`.
*/
useIgnoreFiles
?:
boolean
;
/**
* Whether symlinks should be followed while searching.
* See the vscode setting `"search.followSymlinks"`.
*/
followSymlinks
?:
boolean
;
/**
* Interpret files using this encoding.
* See the vscode setting `"files.encoding"`
*/
encoding
?:
string
;
}
...
...
@@ -210,6 +243,24 @@ declare module 'vscode' {
*/
export
function
registerSearchProvider
(
scheme
:
string
,
provider
:
SearchProvider
):
Disposable
;
/**
* Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
* @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words.
* @param callback A callback, called for each result
* @param token A token that can be used to signal cancellation to the underlying search engine.
* @return A thenable that resolves when the search is complete.
*/
export
function
findTextInFiles
(
query
:
TextSearchQuery
,
callback
:
(
result
:
TextSearchResult
)
=>
void
,
token
?:
CancellationToken
):
Thenable
<
void
>
;
/**
* Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace.
* @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words.
* @param options An optional set of query options. Include and exclude patterns, maxResults, etc.
* @param callback A callback, called for each result
* @param token A token that can be used to signal cancellation to the underlying search engine.
* @return A thenable that resolves when the search is complete.
*/
export
function
findTextInFiles
(
query
:
TextSearchQuery
,
options
:
FindTextInFilesOptions
,
callback
:
(
result
:
TextSearchResult
)
=>
void
,
token
?:
CancellationToken
):
Thenable
<
void
>
;
}
...
...
src/vs/workbench/api/node/extHost.api.impl.ts
浏览文件 @
a56ec40e
...
...
@@ -500,7 +500,19 @@ export function createApiFactory(
findFiles
:
(
include
,
exclude
,
maxResults
?,
token
?)
=>
{
return
extHostWorkspace
.
findFiles
(
typeConverters
.
GlobPattern
.
from
(
include
),
typeConverters
.
GlobPattern
.
from
(
exclude
),
maxResults
,
extension
.
id
,
token
);
},
findTextInFiles
:
(
query
:
vscode
.
TextSearchQuery
,
options
:
vscode
.
FindTextInFilesOptions
,
callback
:
(
result
:
vscode
.
TextSearchResult
)
=>
void
,
token
?:
vscode
.
CancellationToken
)
=>
{
findTextInFiles
:
(
query
:
vscode
.
TextSearchQuery
,
optionsOrCallback
,
callbackOrToken
?,
token
?:
vscode
.
CancellationToken
)
=>
{
let
options
:
vscode
.
FindTextInFilesOptions
;
let
callback
:
(
result
:
vscode
.
TextSearchResult
)
=>
void
;
if
(
typeof
optionsOrCallback
===
'
object
'
)
{
options
=
optionsOrCallback
;
callback
=
callbackOrToken
;
}
else
{
options
=
{};
callback
=
optionsOrCallback
;
token
=
callbackOrToken
;
}
return
extHostWorkspace
.
findTextInFiles
(
query
,
options
||
{},
callback
,
extension
.
id
,
token
);
},
saveAll
:
(
includeUntitled
?)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录