Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
14c4fde6
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,发现更多精彩内容 >>
提交
14c4fde6
编写于
3月 05, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null check extHostQuickOpen
上级
8f3cda12
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
23 addition
and
9 deletion
+23
-9
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-0
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
+1
-1
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostExtensionService.ts
src/vs/workbench/api/node/extHostExtensionService.ts
+3
-0
src/vs/workbench/api/node/extHostQuickOpen.ts
src/vs/workbench/api/node/extHostQuickOpen.ts
+17
-7
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
14c4fde6
...
@@ -95,6 +95,7 @@
...
@@ -95,6 +95,7 @@
"./vs/workbench/api/node/extHostMessageService.ts"
,
"./vs/workbench/api/node/extHostMessageService.ts"
,
"./vs/workbench/api/node/extHostOutputService.ts"
,
"./vs/workbench/api/node/extHostOutputService.ts"
,
"./vs/workbench/api/node/extHostProgress.ts"
,
"./vs/workbench/api/node/extHostProgress.ts"
,
"./vs/workbench/api/node/extHostQuickOpen.ts"
,
"./vs/workbench/api/node/extHostSearch.fileIndex.ts"
,
"./vs/workbench/api/node/extHostSearch.fileIndex.ts"
,
"./vs/workbench/api/node/extHostSearch.ts"
,
"./vs/workbench/api/node/extHostSearch.ts"
,
"./vs/workbench/api/node/extHostStorage.ts"
,
"./vs/workbench/api/node/extHostStorage.ts"
,
...
...
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
浏览文件 @
14c4fde6
...
@@ -85,7 +85,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
...
@@ -85,7 +85,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
// ---- input
// ---- input
$input
(
options
:
InputBoxOptions
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
{
$input
(
options
:
InputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
{
const
inputOptions
:
IInputOptions
=
Object
.
create
(
null
);
const
inputOptions
:
IInputOptions
=
Object
.
create
(
null
);
if
(
options
)
{
if
(
options
)
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
14c4fde6
...
@@ -460,7 +460,7 @@ export interface MainThreadQuickOpenShape extends IDisposable {
...
@@ -460,7 +460,7 @@ export interface MainThreadQuickOpenShape extends IDisposable {
$show
(
instance
:
number
,
options
:
IPickOptions
<
TransferQuickPickItems
>
,
token
:
CancellationToken
):
Promise
<
number
|
number
[]
|
undefined
>
;
$show
(
instance
:
number
,
options
:
IPickOptions
<
TransferQuickPickItems
>
,
token
:
CancellationToken
):
Promise
<
number
|
number
[]
|
undefined
>
;
$setItems
(
instance
:
number
,
items
:
TransferQuickPickItems
[]):
Promise
<
void
>
;
$setItems
(
instance
:
number
,
items
:
TransferQuickPickItems
[]):
Promise
<
void
>
;
$setError
(
instance
:
number
,
error
:
Error
):
Promise
<
void
>
;
$setError
(
instance
:
number
,
error
:
Error
):
Promise
<
void
>
;
$input
(
options
:
vscode
.
InputBoxOptions
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
;
$input
(
options
:
vscode
.
InputBoxOptions
|
undefined
,
validateInput
:
boolean
,
token
:
CancellationToken
):
Promise
<
string
>
;
$createOrUpdate
(
params
:
TransferQuickInput
):
Promise
<
void
>
;
$createOrUpdate
(
params
:
TransferQuickInput
):
Promise
<
void
>
;
$dispose
(
id
:
number
):
Promise
<
void
>
;
$dispose
(
id
:
number
):
Promise
<
void
>
;
}
}
...
...
src/vs/workbench/api/node/extHostExtensionService.ts
浏览文件 @
14c4fde6
...
@@ -116,6 +116,9 @@ class ExtensionStoragePath {
...
@@ -116,6 +116,9 @@ class ExtensionStoragePath {
return
Promise
.
resolve
(
undefined
);
return
Promise
.
resolve
(
undefined
);
}
}
if
(
!
this
.
_environment
.
appSettingsHome
)
{
return
undefined
;
}
const
storageName
=
this
.
_workspace
.
id
;
const
storageName
=
this
.
_workspace
.
id
;
const
storagePath
=
path
.
join
(
this
.
_environment
.
appSettingsHome
.
fsPath
,
'
workspaceStorage
'
,
storageName
);
const
storagePath
=
path
.
join
(
this
.
_environment
.
appSettingsHome
.
fsPath
,
'
workspaceStorage
'
,
storageName
);
...
...
src/vs/workbench/api/node/extHostQuickOpen.ts
浏览文件 @
14c4fde6
...
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri';
...
@@ -15,6 +15,7 @@ import { URI } from 'vs/base/common/uri';
import
{
ThemeIcon
,
QuickInputButtons
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
ThemeIcon
,
QuickInputButtons
}
from
'
vs/workbench/api/node/extHostTypes
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
ExtensionIdentifier
}
from
'
vs/platform/extensions/common/extensions
'
;
import
{
coalesce
}
from
'
vs/base/common/arrays
'
;
export
type
Item
=
string
|
QuickPickItem
;
export
type
Item
=
string
|
QuickPickItem
;
...
@@ -24,7 +25,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
...
@@ -24,7 +25,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
private
_workspace
:
IExtHostWorkspaceProvider
;
private
_workspace
:
IExtHostWorkspaceProvider
;
private
_commands
:
ExtHostCommands
;
private
_commands
:
ExtHostCommands
;
private
_onDidSelectItem
:
(
handle
:
number
)
=>
void
;
private
_onDidSelectItem
?
:
(
handle
:
number
)
=>
void
;
private
_validateInput
?:
(
input
:
string
)
=>
string
|
undefined
|
null
|
Thenable
<
string
|
undefined
|
null
>
;
private
_validateInput
?:
(
input
:
string
)
=>
string
|
undefined
|
null
|
Thenable
<
string
|
undefined
|
null
>
;
private
_sessions
=
new
Map
<
number
,
ExtHostQuickInput
>
();
private
_sessions
=
new
Map
<
number
,
ExtHostQuickInput
>
();
...
@@ -158,12 +159,15 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
...
@@ -158,12 +159,15 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
// ---- workspace folder picker
// ---- workspace folder picker
showWorkspaceFolderPick
(
options
?:
WorkspaceFolderPickOptions
,
token
=
CancellationToken
.
None
):
Promise
<
WorkspaceFolder
>
{
showWorkspaceFolderPick
(
options
?:
WorkspaceFolderPickOptions
,
token
=
CancellationToken
.
None
):
Promise
<
WorkspaceFolder
|
undefined
>
{
return
this
.
_commands
.
executeCommand
(
'
_workbench.pickWorkspaceFolder
'
,
[
options
]).
then
(
async
(
selectedFolder
:
WorkspaceFolder
)
=>
{
return
this
.
_commands
.
executeCommand
(
'
_workbench.pickWorkspaceFolder
'
,
[
options
]).
then
(
async
(
selectedFolder
:
WorkspaceFolder
)
=>
{
if
(
!
selectedFolder
)
{
if
(
!
selectedFolder
)
{
return
undefined
;
return
undefined
;
}
}
const
workspaceFolders
=
await
this
.
_workspace
.
getWorkspaceFolders2
();
const
workspaceFolders
=
await
this
.
_workspace
.
getWorkspaceFolders2
();
if
(
!
workspaceFolders
)
{
return
undefined
;
}
return
workspaceFolders
.
filter
(
folder
=>
folder
.
uri
.
toString
()
===
selectedFolder
.
uri
.
toString
())[
0
];
return
workspaceFolders
.
filter
(
folder
=>
folder
.
uri
.
toString
()
===
selectedFolder
.
uri
.
toString
())[
0
];
});
});
}
}
...
@@ -382,7 +386,9 @@ class ExtHostQuickInput implements QuickInput {
...
@@ -382,7 +386,9 @@ class ExtHostQuickInput implements QuickInput {
_fireDidTriggerButton
(
handle
:
number
)
{
_fireDidTriggerButton
(
handle
:
number
)
{
const
button
=
this
.
_handlesToButtons
.
get
(
handle
);
const
button
=
this
.
_handlesToButtons
.
get
(
handle
);
this
.
_onDidTriggerButtonEmitter
.
fire
(
button
);
if
(
button
)
{
this
.
_onDidTriggerButtonEmitter
.
fire
(
button
);
}
}
}
_fireDidHide
()
{
_fireDidHide
()
{
...
@@ -437,9 +443,13 @@ class ExtHostQuickInput implements QuickInput {
...
@@ -437,9 +443,13 @@ class ExtHostQuickInput implements QuickInput {
}
}
}
}
function
getIconUris
(
iconPath
:
QuickInputButton
[
'
iconPath
'
])
{
function
getIconUris
(
iconPath
:
QuickInputButton
[
'
iconPath
'
]):
{
dark
:
URI
,
light
?:
URI
}
|
undefined
{
const
dark
=
getDarkIconUri
(
iconPath
);
const
light
=
getLightIconUri
(
iconPath
);
const
light
=
getLightIconUri
(
iconPath
);
return
{
dark
:
getDarkIconUri
(
iconPath
)
||
light
,
light
};
if
(
!
light
&&
!
dark
)
{
return
undefined
;
}
return
{
dark
:
(
dark
||
light
)
!
,
light
};
}
}
function
getLightIconUri
(
iconPath
:
QuickInputButton
[
'
iconPath
'
])
{
function
getLightIconUri
(
iconPath
:
QuickInputButton
[
'
iconPath
'
])
{
...
@@ -563,13 +573,13 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
...
@@ -563,13 +573,13 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
onDidChangeSelection
=
this
.
_onDidChangeSelectionEmitter
.
event
;
onDidChangeSelection
=
this
.
_onDidChangeSelectionEmitter
.
event
;
_fireDidChangeActive
(
handles
:
number
[])
{
_fireDidChangeActive
(
handles
:
number
[])
{
const
items
=
handles
.
map
(
handle
=>
this
.
_handlesToItems
.
get
(
handle
));
const
items
=
coalesce
(
handles
.
map
(
handle
=>
this
.
_handlesToItems
.
get
(
handle
)
));
this
.
_activeItems
=
items
;
this
.
_activeItems
=
items
;
this
.
_onDidChangeActiveEmitter
.
fire
(
items
);
this
.
_onDidChangeActiveEmitter
.
fire
(
items
);
}
}
_fireDidChangeSelection
(
handles
:
number
[])
{
_fireDidChangeSelection
(
handles
:
number
[])
{
const
items
=
handles
.
map
(
handle
=>
this
.
_handlesToItems
.
get
(
handle
));
const
items
=
coalesce
(
handles
.
map
(
handle
=>
this
.
_handlesToItems
.
get
(
handle
)
));
this
.
_selectedItems
=
items
;
this
.
_selectedItems
=
items
;
this
.
_onDidChangeSelectionEmitter
.
fire
(
items
);
this
.
_onDidChangeSelectionEmitter
.
fire
(
items
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录