Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d1b49cd8
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,发现更多精彩内容 >>
提交
d1b49cd8
编写于
9月 16, 2020
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Adding more explicit typings for TS 4.1 new Promise logic
上级
240afbde
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
11 addition
and
11 deletion
+11
-11
extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts
...vscode-api-tests/src/singlefolder-tests/languages.test.ts
+2
-2
extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts
...ns/vscode-api-tests/src/singlefolder-tests/window.test.ts
+5
-5
extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts
...-api-tests/src/singlefolder-tests/workspace.tasks.test.ts
+2
-2
extensions/vscode-notebook-tests/src/notebook.test.ts
extensions/vscode-notebook-tests/src/notebook.test.ts
+2
-2
未找到文件。
extensions/vscode-api-tests/src/singlefolder-tests/languages.test.ts
浏览文件 @
d1b49cd8
...
...
@@ -31,7 +31,7 @@ suite('vscode API - languages', () => {
let
clock
=
0
;
const
disposables
:
vscode
.
Disposable
[]
=
[];
let
close
=
new
Promise
(
resolve
=>
{
let
close
=
new
Promise
<
void
>
(
resolve
=>
{
disposables
.
push
(
vscode
.
workspace
.
onDidCloseTextDocument
(
e
=>
{
if
(
e
===
doc
)
{
assert
.
equal
(
doc
.
languageId
,
langIdNow
);
...
...
@@ -41,7 +41,7 @@ suite('vscode API - languages', () => {
}
}));
});
let
open
=
new
Promise
(
resolve
=>
{
let
open
=
new
Promise
<
void
>
(
resolve
=>
{
disposables
.
push
(
vscode
.
workspace
.
onDidOpenTextDocument
(
e
=>
{
if
(
e
===
doc
)
{
// same instance!
assert
.
equal
(
doc
.
languageId
,
'
json
'
);
...
...
extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts
浏览文件 @
d1b49cd8
...
...
@@ -85,7 +85,7 @@ suite('vscode API - window', () => {
let
[
one
,
two
]
=
editors
;
await
new
Promise
(
resolve
=>
{
await
new
Promise
<
void
>
(
resolve
=>
{
let
registration2
=
window
.
onDidChangeTextEditorViewColumn
(
event
=>
{
actualEvent
=
event
;
registration2
.
dispose
();
...
...
@@ -120,7 +120,7 @@ suite('vscode API - window', () => {
let
[,
two
]
=
editors
;
two
.
show
();
return
new
Promise
(
resolve
=>
{
return
new
Promise
<
void
>
(
resolve
=>
{
let
registration2
=
window
.
onDidChangeTextEditorViewColumn
(
event
=>
{
actualEvents
.
push
(
event
);
...
...
@@ -433,7 +433,7 @@ suite('vscode API - window', () => {
let
i
=
0
;
const
resolves
:
((
value
:
string
)
=>
void
)[]
=
[];
let
done
:
()
=>
void
;
const
unexpected
=
new
Promise
((
resolve
,
reject
)
=>
{
const
unexpected
=
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
done
=
()
=>
resolve
();
resolves
.
push
(
reject
);
});
...
...
@@ -594,7 +594,7 @@ suite('vscode API - window', () => {
function
createQuickPickTracker
<
T
extends
string
|
QuickPickItem
>
()
{
const
resolves
:
((
value
:
T
)
=>
void
)[]
=
[];
let
done
:
()
=>
void
;
const
unexpected
=
new
Promise
((
resolve
,
reject
)
=>
{
const
unexpected
=
new
Promise
<
void
>
((
resolve
,
reject
)
=>
{
done
=
()
=>
resolve
();
resolves
.
push
(
reject
);
});
...
...
@@ -613,7 +613,7 @@ suite('vscode API - window', () => {
return
workspace
.
openTextDocument
(
join
(
workspace
.
rootPath
||
''
,
'
./far.js
'
)).
then
(
doc
=>
window
.
showTextDocument
(
doc
)).
then
(
editor
=>
{
return
new
Promise
((
resolve
,
_reject
)
=>
{
return
new
Promise
<
void
>
((
resolve
,
_reject
)
=>
{
let
subscription
=
window
.
onDidChangeTextEditorSelection
(
e
=>
{
assert
.
ok
(
e
.
textEditor
===
editor
);
...
...
extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts
浏览文件 @
d1b49cd8
...
...
@@ -168,7 +168,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
});
test
(
'
Execution from onDidEndTaskProcess and onDidStartTaskProcess are equal to original
'
,
()
=>
{
return
new
Promise
(
async
(
resolve
)
=>
{
return
new
Promise
<
void
>
(
async
(
resolve
)
=>
{
const
task
=
new
Task
({
type
:
'
testTask
'
},
TaskScope
.
Workspace
,
'
echo
'
,
'
testTask
'
,
new
ShellExecution
(
'
echo
'
,
[
'
hello test
'
]));
let
taskExecution
:
TaskExecution
|
undefined
;
const
executeDoneEvent
:
EventEmitter
<
void
>
=
new
EventEmitter
();
...
...
@@ -213,7 +213,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
// https://github.com/microsoft/vscode/issues/100577
test
(
'
A CustomExecution task can be fetched and executed
'
,
()
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
return
new
Promise
<
void
>
(
async
(
resolve
,
reject
)
=>
{
class
CustomTerminal
implements
Pseudoterminal
{
private
readonly
writeEmitter
=
new
EventEmitter
<
string
>
();
public
readonly
onDidWrite
:
Event
<
string
>
=
this
.
writeEmitter
.
event
;
...
...
extensions/vscode-notebook-tests/src/notebook.test.ts
浏览文件 @
d1b49cd8
...
...
@@ -57,7 +57,7 @@ async function splitEditor() {
}
async
function
saveFileAndCloseAll
(
resource
:
vscode
.
Uri
)
{
const
documentClosed
=
new
Promise
((
resolve
,
_reject
)
=>
{
const
documentClosed
=
new
Promise
<
void
>
((
resolve
,
_reject
)
=>
{
const
d
=
vscode
.
notebook
.
onDidCloseNotebookDocument
(
e
=>
{
if
(
e
.
uri
.
toString
()
===
resource
.
toString
())
{
d
.
dispose
();
...
...
@@ -71,7 +71,7 @@ async function saveFileAndCloseAll(resource: vscode.Uri) {
}
async
function
saveAllFilesAndCloseAll
(
resource
:
vscode
.
Uri
|
undefined
)
{
const
documentClosed
=
new
Promise
((
resolve
,
_reject
)
=>
{
const
documentClosed
=
new
Promise
<
void
>
((
resolve
,
_reject
)
=>
{
if
(
!
resource
)
{
return
resolve
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录