Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
47bd8ae1
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,发现更多精彩内容 >>
提交
47bd8ae1
编写于
11月 02, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "fix #37484"
This reverts commit
c8a8fc7d
.
上级
810eab9b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
24 deletion
+5
-24
extensions/vscode-api-tests/src/commands.test.ts
extensions/vscode-api-tests/src/commands.test.ts
+1
-17
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+1
-1
src/vs/workbench/api/node/extHostCommands.ts
src/vs/workbench/api/node/extHostCommands.ts
+3
-6
未找到文件。
extensions/vscode-api-tests/src/commands.test.ts
浏览文件 @
47bd8ae1
...
@@ -56,22 +56,6 @@ suite('commands namespace tests', () => {
...
@@ -56,22 +56,6 @@ suite('commands namespace tests', () => {
});
});
});
});
test
(
'
command with return-value
'
,
function
()
{
let
registration
=
commands
.
registerCommand
(
'
t1
'
,
function
()
{
return
new
Set
<
number
>
().
add
(
1
).
add
(
2
);
});
return
commands
.
executeCommand
(
'
t1
'
,
'
start
'
).
then
(
value
=>
{
registration
.
dispose
();
assert
.
ok
(
value
instanceof
Set
);
assert
.
equal
((
<
Set
<
number
>>
value
).
size
,
2
);
assert
.
equal
((
<
Set
<
number
>>
value
).
has
(
1
),
true
);
assert
.
equal
((
<
Set
<
number
>>
value
).
has
(
2
),
true
);
});
});
test
(
'
editorCommand with extra args
'
,
function
()
{
test
(
'
editorCommand with extra args
'
,
function
()
{
let
args
:
IArguments
;
let
args
:
IArguments
;
...
@@ -150,4 +134,4 @@ suite('commands namespace tests', () => {
...
@@ -150,4 +134,4 @@ suite('commands namespace tests', () => {
return
Promise
.
all
([
a
,
b
,
c
,
d
]);
return
Promise
.
all
([
a
,
b
,
c
,
d
]);
});
});
});
});
\ No newline at end of file
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
47bd8ae1
...
@@ -429,7 +429,7 @@ export interface MainThreadWindowShape extends IDisposable {
...
@@ -429,7 +429,7 @@ export interface MainThreadWindowShape extends IDisposable {
// -- extension host
// -- extension host
export
interface
ExtHostCommandsShape
{
export
interface
ExtHostCommandsShape
{
$executeContributedCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
void
>
;
$executeContributedCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
;
$getContributedCommandHandlerDescriptions
():
TPromise
<
{
[
id
:
string
]:
string
|
ICommandHandlerDescription
}
>
;
$getContributedCommandHandlerDescriptions
():
TPromise
<
{
[
id
:
string
]:
string
|
ICommandHandlerDescription
}
>
;
}
}
...
...
src/vs/workbench/api/node/extHostCommands.ts
浏览文件 @
47bd8ae1
...
@@ -74,7 +74,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
...
@@ -74,7 +74,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
if
(
this
.
_commands
.
has
(
id
))
{
if
(
this
.
_commands
.
has
(
id
))
{
// we stay inside the extension host and support
// we stay inside the extension host and support
// to pass any kind of parameters around
// to pass any kind of parameters around
return
this
.
_
executeContributedCommand
<
T
>
(
id
,
...
args
);
return
this
.
$
executeContributedCommand
<
T
>
(
id
,
...
args
);
}
else
{
}
else
{
// automagically convert some argument types
// automagically convert some argument types
...
@@ -96,9 +96,10 @@ export class ExtHostCommands implements ExtHostCommandsShape {
...
@@ -96,9 +96,10 @@ export class ExtHostCommands implements ExtHostCommandsShape {
return
this
.
_proxy
.
$executeCommand
<
T
>
(
id
,
args
);
return
this
.
_proxy
.
$executeCommand
<
T
>
(
id
,
args
);
}
}
}
}
private
_
executeContributedCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
{
$
executeContributedCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
T
>
{
let
command
=
this
.
_commands
.
get
(
id
);
let
command
=
this
.
_commands
.
get
(
id
);
if
(
!
command
)
{
if
(
!
command
)
{
return
TPromise
.
wrapError
<
T
>
(
new
Error
(
`Contributed command '
${
id
}
' does not exist.`
));
return
TPromise
.
wrapError
<
T
>
(
new
Error
(
`Contributed command '
${
id
}
' does not exist.`
));
...
@@ -132,10 +133,6 @@ export class ExtHostCommands implements ExtHostCommandsShape {
...
@@ -132,10 +133,6 @@ export class ExtHostCommands implements ExtHostCommandsShape {
}
}
}
}
$executeContributedCommand
<
T
>
(
id
:
string
,
...
args
:
any
[]):
Thenable
<
void
>
{
return
this
.
_executeContributedCommand
(
id
,
...
args
).
then
(
result
=>
void
0
);
}
getCommands
(
filterUnderscoreCommands
:
boolean
=
false
):
Thenable
<
string
[]
>
{
getCommands
(
filterUnderscoreCommands
:
boolean
=
false
):
Thenable
<
string
[]
>
{
return
this
.
_proxy
.
$getCommands
().
then
(
result
=>
{
return
this
.
_proxy
.
$getCommands
().
then
(
result
=>
{
if
(
filterUnderscoreCommands
)
{
if
(
filterUnderscoreCommands
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录