Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
65fdc745
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65fdc745
编写于
7月 23, 2019
作者:
R
Rob Lourens
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use null across EH boundary instead of undefined
上级
b798ef97
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
6 deletion
+14
-6
src/vs/workbench/api/browser/mainThreadWorkspace.ts
src/vs/workbench/api/browser/mainThreadWorkspace.ts
+5
-4
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostWorkspace.ts
src/vs/workbench/api/common/extHostWorkspace.ts
+8
-1
未找到文件。
src/vs/workbench/api/browser/mainThreadWorkspace.ts
浏览文件 @
65fdc745
...
...
@@ -24,6 +24,7 @@ import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, Ma
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
isEqualOrParent
}
from
'
vs/base/common/resources
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
withNullAsUndefined
}
from
'
vs/base/common/types
'
;
@
extHostNamedCustomer
(
MainContext
.
MainThreadWorkspace
)
export
class
MainThreadWorkspace
implements
MainThreadWorkspaceShape
{
...
...
@@ -122,21 +123,21 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape {
// --- search ---
$startFileSearch
(
includePattern
:
string
,
_includeFolder
:
UriComponents
|
undefined
,
excludePatternOrDisregardExcludes
:
string
|
false
|
undefined
,
maxResults
:
number
,
token
:
CancellationToken
):
Promise
<
URI
[]
|
undefined
>
{
$startFileSearch
(
includePattern
:
string
|
null
,
_includeFolder
:
UriComponents
|
null
,
excludePatternOrDisregardExcludes
:
string
|
false
|
null
,
maxResults
:
number
|
null
,
token
:
CancellationToken
):
Promise
<
UriComponents
[]
|
null
>
{
const
includeFolder
=
URI
.
revive
(
_includeFolder
);
const
workspace
=
this
.
_contextService
.
getWorkspace
();
if
(
!
workspace
.
folders
.
length
)
{
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
(
null
);
}
const
query
=
this
.
_queryBuilder
.
file
(
includeFolder
?
[
includeFolder
]
:
workspace
.
folders
.
map
(
f
=>
f
.
uri
),
{
maxResults
,
maxResults
:
withNullAsUndefined
(
maxResults
)
,
disregardExcludeSettings
:
(
excludePatternOrDisregardExcludes
===
false
)
||
undefined
,
disregardSearchExcludeSettings
:
true
,
disregardIgnoreFiles
:
true
,
includePattern
,
includePattern
:
withNullAsUndefined
(
includePattern
)
,
excludePattern
:
typeof
excludePatternOrDisregardExcludes
===
'
string
'
?
excludePatternOrDisregardExcludes
:
undefined
,
_reason
:
'
startFileSearch
'
});
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
65fdc745
...
...
@@ -579,7 +579,7 @@ export interface ITextSearchComplete {
}
export
interface
MainThreadWorkspaceShape
extends
IDisposable
{
$startFileSearch
(
includePattern
:
string
|
undefined
,
includeFolder
:
UriComponents
|
undefined
,
excludePatternOrDisregardExcludes
:
string
|
false
|
undefined
,
maxResults
:
number
|
undefined
,
token
:
CancellationToken
):
Promise
<
UriComponents
[]
|
undefined
>
;
$startFileSearch
(
includePattern
:
string
|
null
,
includeFolder
:
UriComponents
|
null
,
excludePatternOrDisregardExcludes
:
string
|
false
|
null
,
maxResults
:
number
|
null
,
token
:
CancellationToken
):
Promise
<
UriComponents
[]
|
null
>
;
$startTextSearch
(
query
:
search
.
IPatternInfo
,
options
:
ITextQueryBuilderOptions
,
requestId
:
number
,
token
:
CancellationToken
):
Promise
<
ITextSearchComplete
>
;
$checkExists
(
folders
:
UriComponents
[],
includes
:
string
[],
token
:
CancellationToken
):
Promise
<
boolean
>
;
$saveAll
(
includeUntitled
?:
boolean
):
Promise
<
boolean
>
;
...
...
src/vs/workbench/api/common/extHostWorkspace.ts
浏览文件 @
65fdc745
...
...
@@ -24,6 +24,7 @@ import { ExtHostWorkspaceShape, IWorkspaceData, MainThreadMessageServiceShape, M
import
{
ExtensionIdentifier
,
IExtensionDescription
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
Barrier
}
from
'
vs/base/common/async
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
withUndefinedAsNull
}
from
'
vs/base/common/types
'
;
export
interface
IExtHostWorkspaceProvider
{
getWorkspaceFolder2
(
uri
:
vscode
.
Uri
,
resolveParent
?:
boolean
):
Promise
<
vscode
.
WorkspaceFolder
|
undefined
>
;
...
...
@@ -438,7 +439,13 @@ export class ExtHostWorkspace implements ExtHostWorkspaceShape, IExtHostWorkspac
return
Promise
.
resolve
([]);
}
return
this
.
_proxy
.
$startFileSearch
(
includePattern
,
includeFolder
,
excludePatternOrDisregardExcludes
,
maxResults
,
token
)
return
this
.
_proxy
.
$startFileSearch
(
withUndefinedAsNull
(
includePattern
),
withUndefinedAsNull
(
includeFolder
),
withUndefinedAsNull
(
excludePatternOrDisregardExcludes
),
withUndefinedAsNull
(
maxResults
),
token
)
.
then
(
data
=>
Array
.
isArray
(
data
)
?
data
.
map
(
d
=>
URI
.
revive
(
d
))
:
[]);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录