Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
f114b975
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,发现更多精彩内容 >>
提交
f114b975
编写于
7月 05, 2018
作者:
J
Joao Moreno
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove PProgress from QuickInput
related to #53487
上级
11c5b938
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
19 addition
and
16 deletion
+19
-16
src/vs/platform/quickinput/common/quickInput.ts
src/vs/platform/quickinput/common/quickInput.ts
+4
-2
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
+10
-9
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/browser/parts/quickinput/quickInput.ts
src/vs/workbench/browser/parts/quickinput/quickInput.ts
+4
-4
未找到文件。
src/vs/platform/quickinput/common/quickInput.ts
浏览文件 @
f114b975
...
...
@@ -23,7 +23,7 @@ export interface IQuickNavigateConfiguration {
keybindings
:
ResolvedKeybinding
[];
}
export
interface
IPickOptions
{
export
interface
IPickOptions
<
T
extends
IQuickPickItem
>
{
/**
* an optional string to show as place holder in the input box to guide the user what she picks on
...
...
@@ -49,6 +49,8 @@ export interface IPickOptions {
* an optional flag to make this picker multi-select
*/
canPickMany
?:
boolean
;
onDidFocus
?:
(
entry
:
T
)
=>
void
;
}
export
interface
IInputOptions
{
...
...
@@ -177,7 +179,7 @@ export interface IQuickInputService {
/**
* Opens the quick input box for selecting items and returns a promise with the user selected item(s) if any.
*/
pick
<
T
extends
IQuickPickItem
,
O
extends
IPickOptions
>
(
picks
:
TPromise
<
T
[]
>
,
options
?:
O
,
token
?:
CancellationToken
):
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
;
pick
<
T
extends
IQuickPickItem
,
O
extends
IPickOptions
<
T
>
>
(
picks
:
TPromise
<
T
[]
>
,
options
?:
O
,
token
?:
CancellationToken
):
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
;
/**
* Opens the quick input box for text input and returns a promise with the user typed value if any.
...
...
src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts
浏览文件 @
f114b975
...
...
@@ -38,7 +38,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
public
dispose
():
void
{
}
$show
(
options
:
IPickOptions
):
TPromise
<
number
|
number
[]
>
{
$show
(
options
:
IPickOptions
<
TransferQuickPickItems
>
):
TPromise
<
number
|
number
[]
>
{
const
myToken
=
++
this
.
_token
;
this
.
_contents
=
new
TPromise
<
TransferQuickPickItems
[]
>
((
c
,
e
)
=>
{
...
...
@@ -55,16 +55,21 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
};
});
options
=
{
...
options
,
onDidFocus
:
el
=>
{
if
(
el
)
{
this
.
_proxy
.
$onItemSelected
((
<
TransferQuickPickItems
>
el
).
handle
);
}
}
};
if
(
options
.
canPickMany
)
{
return
asWinJsPromise
(
token
=>
this
.
_quickInputService
.
pick
(
this
.
_contents
,
options
as
{
canPickMany
:
true
},
token
)).
then
(
items
=>
{
if
(
items
)
{
return
items
.
map
(
item
=>
item
.
handle
);
}
return
undefined
;
},
undefined
,
progress
=>
{
if
(
progress
)
{
this
.
_proxy
.
$onItemSelected
((
<
TransferQuickPickItems
>
progress
).
handle
);
}
});
}
else
{
return
asWinJsPromise
(
token
=>
this
.
_quickInputService
.
pick
(
this
.
_contents
,
options
,
token
)).
then
(
item
=>
{
...
...
@@ -72,10 +77,6 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
return
item
.
handle
;
}
return
undefined
;
},
undefined
,
progress
=>
{
if
(
progress
)
{
this
.
_proxy
.
$onItemSelected
((
<
TransferQuickPickItems
>
progress
).
handle
);
}
});
}
}
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
f114b975
...
...
@@ -402,7 +402,7 @@ export interface TransferInputBox extends BaseTransferQuickInput {
}
export
interface
MainThreadQuickOpenShape
extends
IDisposable
{
$show
(
options
:
IPickOptions
):
TPromise
<
number
|
number
[]
>
;
$show
(
options
:
IPickOptions
<
TransferQuickPickItems
>
):
TPromise
<
number
|
number
[]
>
;
$setItems
(
items
:
TransferQuickPickItems
[]):
TPromise
<
any
>
;
$setError
(
error
:
Error
):
TPromise
<
any
>
;
$input
(
options
:
vscode
.
InputBoxOptions
,
validateInput
:
boolean
):
TPromise
<
string
>
;
...
...
src/vs/workbench/browser/parts/quickinput/quickInput.ts
浏览文件 @
f114b975
...
...
@@ -891,8 +891,8 @@ export class QuickInputService extends Component implements IQuickInputService {
this
.
updateStyles
();
}
pick
<
T
extends
IQuickPickItem
,
O
extends
IPickOptions
>
(
picks
:
TPromise
<
T
[]
>
,
options
:
O
=
<
O
>
{},
token
:
CancellationToken
=
CancellationToken
.
None
):
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
{
return
new
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
((
resolve
,
reject
,
progress
)
=>
{
pick
<
T
extends
IQuickPickItem
,
O
extends
IPickOptions
<
T
>
>
(
picks
:
TPromise
<
T
[]
>
,
options
:
O
=
<
O
>
{},
token
:
CancellationToken
=
CancellationToken
.
None
):
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
{
return
new
TPromise
<
O
extends
{
canPickMany
:
true
}
?
T
[]
:
T
>
((
resolve
,
reject
)
=>
{
if
(
token
.
isCancellationRequested
)
{
resolve
(
undefined
);
return
;
...
...
@@ -914,8 +914,8 @@ export class QuickInputService extends Component implements IQuickInputService {
}),
input
.
onDidChangeActive
(
items
=>
{
const
focused
=
items
[
0
];
if
(
focused
)
{
progres
s
(
focused
);
if
(
focused
&&
options
.
onDidFocus
)
{
options
.
onDidFocu
s
(
focused
);
}
}),
input
.
onDidChangeSelection
(
items
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录