Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
79591ff8
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,发现更多精彩内容 >>
提交
79591ff8
编写于
11月 07, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - remove TPromise from action provider interface because it is never async, #53526
上级
36ad2cc2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
37 addition
and
39 deletion
+37
-39
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
+11
-13
src/vs/base/parts/tree/browser/tree.ts
src/vs/base/parts/tree/browser/tree.ts
+2
-2
src/vs/workbench/browser/actions.ts
src/vs/workbench/browser/actions.ts
+4
-5
src/vs/workbench/parts/debug/browser/baseDebugView.ts
src/vs/workbench/parts/debug/browser/baseDebugView.ts
+4
-3
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
...s/workbench/parts/debug/electron-browser/callStackView.ts
+4
-4
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
+4
-4
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
...s/workbench/parts/debug/electron-browser/variablesView.ts
+4
-4
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
...ench/parts/debug/electron-browser/watchExpressionsView.ts
+4
-4
未找到文件。
src/vs/base/parts/quickopen/browser/quickOpenModel.ts
浏览文件 @
79591ff8
...
...
@@ -4,7 +4,6 @@
*--------------------------------------------------------------------------------------------*/
import
*
as
nls
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
types
from
'
vs/base/common/types
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
ITree
,
IActionProvider
}
from
'
vs/base/parts/tree/browser/tree
'
;
...
...
@@ -289,16 +288,16 @@ class NoActionProvider implements IActionProvider {
return
false
;
}
getActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
return
TPromise
.
as
(
null
)
;
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
null
;
}
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
return
false
;
}
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
return
TPromise
.
as
(
null
)
;
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
null
;
}
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
Action
):
IActionItem
{
...
...
@@ -421,13 +420,12 @@ class Renderer implements IRenderer<QuickOpenEntry> {
data
.
actionBar
.
context
=
entry
;
// make sure the context is the current element
this
.
actionProvider
.
getActions
(
null
,
entry
).
then
((
actions
)
=>
{
if
(
data
.
actionBar
.
isEmpty
()
&&
actions
&&
actions
.
length
>
0
)
{
data
.
actionBar
.
push
(
actions
,
{
icon
:
true
,
label
:
false
});
}
else
if
(
!
data
.
actionBar
.
isEmpty
()
&&
(
!
actions
||
actions
.
length
===
0
))
{
data
.
actionBar
.
clear
();
}
});
const
actions
=
this
.
actionProvider
.
getActions
(
null
,
entry
);
if
(
data
.
actionBar
.
isEmpty
()
&&
actions
&&
actions
.
length
>
0
)
{
data
.
actionBar
.
push
(
actions
,
{
icon
:
true
,
label
:
false
});
}
else
if
(
!
data
.
actionBar
.
isEmpty
()
&&
(
!
actions
||
actions
.
length
===
0
))
{
data
.
actionBar
.
clear
();
}
// Entry group class
if
(
entry
instanceof
QuickOpenEntryGroup
&&
entry
.
getGroupLabel
())
{
...
...
@@ -620,4 +618,4 @@ export function compareEntries(elementA: QuickOpenEntry, elementB: QuickOpenEntr
}
return
compareAnything
(
nameA
,
nameB
,
lookFor
);
}
\ No newline at end of file
}
src/vs/base/parts/tree/browser/tree.ts
浏览文件 @
79591ff8
...
...
@@ -731,7 +731,7 @@ export interface IActionProvider {
/**
* Returns a promise of an array with the actions of the element that should show up in place right to the element in the tree.
*/
getActions
(
tree
:
ITree
,
element
:
any
):
WinJS
.
TPromise
<
IAction
[]
>
;
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
;
/**
* Returns whether or not the element has secondary actions. These show up once the user has expanded the element's action bar.
...
...
@@ -741,7 +741,7 @@ export interface IActionProvider {
/**
* Returns a promise of an array with the secondary actions of the element that should show up once the user has expanded the element's action bar.
*/
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
WinJS
.
TPromise
<
IAction
[]
>
;
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
;
/**
* Returns an action item to render an action.
...
...
src/vs/workbench/browser/actions.ts
浏览文件 @
79591ff8
...
...
@@ -3,7 +3,6 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Registry
}
from
'
vs/platform/registry/common/platform
'
;
import
{
Action
,
IAction
}
from
'
vs/base/common/actions
'
;
import
{
BaseActionItem
,
Separator
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
...
...
@@ -92,7 +91,7 @@ export class ContributableActionProvider implements IActionProvider {
return
false
;
}
getActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
const
context
=
this
.
toContext
(
tree
,
element
);
...
...
@@ -105,7 +104,7 @@ export class ContributableActionProvider implements IActionProvider {
}
}
return
Promise
.
resolve
(
prepareActions
(
actions
)
);
return
prepareActions
(
actions
);
}
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
...
...
@@ -122,7 +121,7 @@ export class ContributableActionProvider implements IActionProvider {
return
false
;
}
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
TPromise
<
IAction
[]
>
{
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
const
context
=
this
.
toContext
(
tree
,
element
);
...
...
@@ -135,7 +134,7 @@ export class ContributableActionProvider implements IActionProvider {
}
}
return
Promise
.
resolve
(
prepareActions
(
actions
)
);
return
prepareActions
(
actions
);
}
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
Action
):
BaseActionItem
{
...
...
src/vs/workbench/parts/debug/browser/baseDebugView.ts
浏览文件 @
79591ff8
...
...
@@ -218,10 +218,11 @@ export class BaseDebugController extends WorkbenchTreeController {
const
anchor
=
{
x
:
event
.
posx
,
y
:
event
.
posy
};
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
anchor
,
getActions
:
()
=>
this
.
actionProvider
.
getSecondaryActions
(
tree
,
element
).
then
(
actions
=>
{
getActions
:
()
=>
{
const
actions
=
this
.
actionProvider
.
getSecondaryActions
(
tree
,
element
);
fillInContextMenuActions
(
this
.
contributedContextMenu
,
{
arg
:
this
.
getContext
(
element
)
},
actions
,
this
.
contextMenuService
);
return
actions
;
}
)
,
return
Promise
.
resolve
(
actions
)
;
},
onHide
:
(
wasCancelled
?:
boolean
)
=>
{
if
(
wasCancelled
)
{
tree
.
domFocus
();
...
...
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
浏览文件 @
79591ff8
...
...
@@ -256,15 +256,15 @@ class CallStackActionProvider implements IActionProvider {
return
false
;
}
getActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
return
Promise
.
resolve
([])
;
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
[]
;
}
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
return
element
!==
tree
.
getInput
();
}
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
if
(
element
instanceof
DebugSession
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartAction
,
RestartAction
.
ID
,
RestartAction
.
LABEL
));
...
...
@@ -289,7 +289,7 @@ class CallStackActionProvider implements IActionProvider {
actions
.
push
(
new
CopyStackTraceAction
(
CopyStackTraceAction
.
ID
,
CopyStackTraceAction
.
LABEL
));
}
return
Promise
.
resolve
(
actions
)
;
return
actions
;
}
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
IAction
):
IActionItem
{
...
...
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
浏览文件 @
79591ff8
...
...
@@ -324,15 +324,15 @@ export class ReplExpressionsActionProvider implements IActionProvider {
return
false
;
}
public
getActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
return
Promise
.
resolve
([])
;
public
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
[]
;
}
public
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
return
true
;
}
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
actions
.
push
(
new
CopyAction
(
CopyAction
.
ID
,
CopyAction
.
LABEL
));
actions
.
push
(
new
CopyAllAction
(
CopyAllAction
.
ID
,
CopyAllAction
.
LABEL
,
tree
));
...
...
@@ -340,7 +340,7 @@ export class ReplExpressionsActionProvider implements IActionProvider {
actions
.
push
(
new
Separator
());
actions
.
push
(
this
.
clearReplAction
);
return
Promise
.
resolve
(
actions
)
;
return
actions
;
}
public
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
IAction
):
IActionItem
{
...
...
src/vs/workbench/parts/debug/electron-browser/variablesView.ts
浏览文件 @
79591ff8
...
...
@@ -156,8 +156,8 @@ class VariablesActionProvider implements IActionProvider {
return
false
;
}
public
getActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
return
Promise
.
resolve
([])
;
public
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
[]
;
}
public
hasSecondaryActions
(
tree
:
ITree
,
element
:
any
):
boolean
{
...
...
@@ -165,7 +165,7 @@ class VariablesActionProvider implements IActionProvider {
return
element
instanceof
Variable
&&
!!
element
.
value
;
}
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
const
variable
=
<
Variable
>
element
;
actions
.
push
(
new
SetValueAction
(
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
...
...
@@ -174,7 +174,7 @@ class VariablesActionProvider implements IActionProvider {
actions
.
push
(
new
Separator
());
actions
.
push
(
new
AddToWatchExpressionsAction
(
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
return
Promise
.
resolve
(
actions
)
;
return
actions
;
}
public
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
IAction
):
IActionItem
{
...
...
src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts
浏览文件 @
79591ff8
...
...
@@ -144,11 +144,11 @@ class WatchExpressionsActionProvider implements IActionProvider {
return
true
;
}
public
getActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
return
Promise
.
resolve
([])
;
public
getActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
return
[]
;
}
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
Promise
<
IAction
[]
>
{
public
getSecondaryActions
(
tree
:
ITree
,
element
:
any
):
IAction
[]
{
const
actions
:
IAction
[]
=
[];
if
(
element
instanceof
Expression
)
{
const
expression
=
<
Expression
>
element
;
...
...
@@ -173,7 +173,7 @@ class WatchExpressionsActionProvider implements IActionProvider {
actions
.
push
(
new
RemoveAllWatchExpressionsAction
(
RemoveAllWatchExpressionsAction
.
ID
,
RemoveAllWatchExpressionsAction
.
LABEL
,
this
.
debugService
,
this
.
keybindingService
));
}
return
Promise
.
resolve
(
actions
)
;
return
actions
;
}
public
getActionItem
(
tree
:
ITree
,
element
:
any
,
action
:
IAction
):
IActionItem
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录