Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3acc0026
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,发现更多精彩内容 >>
提交
3acc0026
编写于
11月 06, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - less TPromise construction
上级
e99942cc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
10 addition
and
12 deletion
+10
-12
src/vs/platform/dialogs/node/dialogService.ts
src/vs/platform/dialogs/node/dialogService.ts
+3
-4
src/vs/workbench/node/extensionHostMain.ts
src/vs/workbench/node/extensionHostMain.ts
+1
-1
src/vs/workbench/services/extensions/node/lazyPromise.ts
src/vs/workbench/services/extensions/node/lazyPromise.ts
+5
-6
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
...eybinding/test/electron-browser/keybindingEditing.test.ts
+1
-1
未找到文件。
src/vs/platform/dialogs/node/dialogService.ts
浏览文件 @
3acc0026
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
readline
from
'
readline
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
IDialogService
,
IConfirmation
,
IConfirmationResult
}
from
'
vs/platform/dialogs/common/dialogs
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
localize
}
from
'
vs/nls
'
;
...
...
@@ -14,8 +13,8 @@ export class CommandLineDialogService implements IDialogService {
_serviceBrand
:
any
;
show
(
severity
:
Severity
,
message
:
string
,
options
:
string
[]):
T
Promise
<
number
>
{
const
promise
=
new
T
Promise
<
number
>
((
c
,
e
)
=>
{
show
(
severity
:
Severity
,
message
:
string
,
options
:
string
[]):
Promise
<
number
>
{
const
promise
=
new
Promise
<
number
>
((
c
,
e
)
=>
{
const
rl
=
readline
.
createInterface
({
input
:
process
.
stdin
,
output
:
process
.
stdout
,
...
...
@@ -58,7 +57,7 @@ export class CommandLineDialogService implements IDialogService {
return
-
1
;
}
confirm
(
confirmation
:
IConfirmation
):
T
Promise
<
IConfirmationResult
>
{
confirm
(
confirmation
:
IConfirmation
):
Promise
<
IConfirmationResult
>
{
return
this
.
show
(
Severity
.
Info
,
confirmation
.
message
,
[
confirmation
.
primaryButton
||
localize
(
'
ok
'
,
"
Ok
"
),
confirmation
.
secondaryButton
||
localize
(
'
cancel
'
,
"
Cancel
"
)]).
then
(
index
=>
{
return
{
confirmed
:
index
===
0
...
...
src/vs/workbench/node/extensionHostMain.ts
浏览文件 @
3acc0026
...
...
@@ -293,7 +293,7 @@ export class ExtensionHostMain {
// Execute the runner if it follows our spec
if
(
testRunner
&&
typeof
testRunner
.
run
===
'
function
'
)
{
return
new
T
Promise
<
void
>
((
c
,
e
)
=>
{
return
new
Promise
<
void
>
((
c
,
e
)
=>
{
testRunner
.
run
(
this
.
_environment
.
extensionTestsPath
,
(
error
,
failures
)
=>
{
if
(
error
)
{
e
(
error
.
toString
());
...
...
src/vs/workbench/services/extensions/node/lazyPromise.ts
浏览文件 @
3acc0026
...
...
@@ -4,13 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
ErrorCallback
,
TPromise
,
ValueCallback
}
from
'
vs/base/common/winjs.base
'
;
export
class
LazyPromise
implements
Thenable
<
any
>
{
private
_actual
:
T
Promise
<
any
>
|
null
;
private
_actualOk
:
ValueCallback
|
null
;
private
_actualErr
:
ErrorCallback
|
null
;
private
_actual
:
Promise
<
any
>
|
null
;
private
_actualOk
:
(
value
?:
any
)
=>
any
|
null
;
private
_actualErr
:
(
err
?:
any
)
=>
any
|
null
;
private
_hasValue
:
boolean
;
private
_value
:
any
;
...
...
@@ -28,9 +27,9 @@ export class LazyPromise implements Thenable<any> {
this
.
_err
=
null
;
}
private
_ensureActual
():
T
Promise
<
any
>
{
private
_ensureActual
():
Promise
<
any
>
{
if
(
!
this
.
_actual
)
{
this
.
_actual
=
new
T
Promise
<
any
>
((
c
,
e
)
=>
{
this
.
_actual
=
new
Promise
<
any
>
((
c
,
e
)
=>
{
this
.
_actualOk
=
c
;
this
.
_actualErr
=
e
;
...
...
src/vs/workbench/services/keybinding/test/electron-browser/keybindingEditing.test.ts
浏览文件 @
3acc0026
...
...
@@ -110,7 +110,7 @@ suite('KeybindingsEditing', () => {
}
teardown
(()
=>
{
return
new
T
Promise
<
void
>
((
c
,
e
)
=>
{
return
new
Promise
<
void
>
((
c
,
e
)
=>
{
if
(
testDir
)
{
extfs
.
del
(
testDir
,
os
.
tmpdir
(),
()
=>
c
(
null
),
()
=>
c
(
null
));
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录