Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
58b7cc9f
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,发现更多精彩内容 >>
提交
58b7cc9f
编写于
3月 13, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict null checks: callStackView
上级
471b98c1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
22 addition
and
35 deletion
+22
-35
src/tsconfig.strictNullChecks.json
src/tsconfig.strictNullChecks.json
+1
-12
src/vs/base/browser/ui/tree/tree.ts
src/vs/base/browser/ui/tree/tree.ts
+1
-1
src/vs/workbench/contrib/debug/electron-browser/callStackView.ts
...workbench/contrib/debug/electron-browser/callStackView.ts
+17
-18
src/vs/workbench/contrib/debug/electron-browser/repl.ts
src/vs/workbench/contrib/debug/electron-browser/repl.ts
+1
-1
src/vs/workbench/contrib/debug/electron-browser/variablesView.ts
...workbench/contrib/debug/electron-browser/variablesView.ts
+2
-3
未找到文件。
src/tsconfig.strictNullChecks.json
浏览文件 @
58b7cc9f
...
...
@@ -35,6 +35,7 @@
"./vs/workbench/contrib/debug/common/**/*.ts"
,
"./vs/workbench/contrib/debug/browser/**/*.ts"
,
"./vs/workbench/contrib/debug/node/**/*.ts"
,
"./vs/workbench/contrib/debug/electron-browser/**/*.ts"
,
"./vs/workbench/contrib/preferences/common/**/*.ts"
,
"./vs/workbench/contrib/preferences/**/settings*.ts"
,
"./vs/workbench/contrib/terminal/**/*"
...
...
@@ -157,18 +158,6 @@
"./vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts"
,
"./vs/workbench/contrib/comments/electron-browser/reactionsAction.ts"
,
"./vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts"
,
"./vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts"
,
"./vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts"
,
"./vs/workbench/contrib/debug/electron-browser/debugHover.ts"
,
"./vs/workbench/contrib/debug/electron-browser/terminalSupport.ts"
,
"./vs/workbench/contrib/debug/electron-browser/debugSession.ts"
,
"./vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts"
,
"./vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts"
,
"./vs/workbench/contrib/debug/electron-browser/repl.ts"
,
"./vs/workbench/contrib/debug/electron-browser/variablesView.ts"
,
"./vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts"
,
"./vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts"
,
"./vs/workbench/contrib/debug/electron-browser/debugService.ts"
,
"./vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugSource.test.ts"
,
"./vs/workbench/contrib/debug/test/common/debugUtils.test.ts"
,
...
...
src/vs/base/browser/ui/tree/tree.ts
浏览文件 @
58b7cc9f
...
...
@@ -145,7 +145,7 @@ export interface ITreeMouseEvent<T> {
export
interface
ITreeContextMenuEvent
<
T
>
{
browserEvent
:
UIEvent
;
element
:
T
|
null
;
anchor
:
HTMLElement
|
{
x
:
number
;
y
:
number
;
}
|
undefined
;
anchor
:
HTMLElement
|
{
x
:
number
;
y
:
number
;
};
}
export
interface
ITreeNavigator
<
T
>
{
...
...
src/vs/workbench/contrib/debug/electron-browser/callStackView.ts
浏览文件 @
58b7cc9f
...
...
@@ -156,7 +156,7 @@ export class CallStackView extends ViewletPanel {
return
;
}
const
focusStackFrame
=
(
stackFrame
:
IStackFrame
,
thread
:
IThrea
d
,
session
:
IDebugSession
)
=>
{
const
focusStackFrame
=
(
stackFrame
:
IStackFrame
|
undefined
,
thread
:
IThread
|
undefine
d
,
session
:
IDebugSession
)
=>
{
this
.
ignoreFocusStackFrameEvent
=
true
;
try
{
this
.
debugService
.
focusStackFrame
(
stackFrame
,
thread
,
session
,
true
);
...
...
@@ -309,7 +309,7 @@ export class CallStackView extends ViewletPanel {
});
}
private
getContextForContributedActions
(
element
:
CallStackItem
):
string
|
number
{
private
getContextForContributedActions
(
element
:
CallStackItem
|
null
):
string
|
number
|
undefined
{
if
(
element
instanceof
StackFrame
)
{
if
(
element
.
source
.
inMemory
)
{
return
element
.
source
.
raw
.
path
||
element
.
source
.
reference
;
...
...
@@ -563,11 +563,9 @@ class CallStackDelegate implements IListVirtualDelegate<CallStackItem> {
if
(
element
instanceof
ThreadAndSessionIds
)
{
return
LoadMoreRenderer
.
ID
;
}
if
(
element
instanceof
Array
)
{
return
ShowMoreRenderer
.
ID
;
}
return
undefined
;
// element instanceof Array
return
ShowMoreRenderer
.
ID
;
}
}
...
...
@@ -606,18 +604,21 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
}
}
private
getThreadChildren
(
thread
:
Thread
):
Promise
<
Array
<
IStackFrame
|
string
|
ThreadAndSessionIds
>
>
{
private
getThreadChildren
(
thread
:
Thread
):
Promise
<
CallStackItem
[]
>
{
return
this
.
getThreadCallstack
(
thread
).
then
(
children
=>
{
// Check if some stack frames should be hidden under a parent element since they are deemphasized
const
result
=
[];
const
result
:
CallStackItem
[]
=
[];
children
.
forEach
((
child
,
index
)
=>
{
if
(
child
instanceof
StackFrame
&&
child
.
source
&&
isDeemphasized
(
child
))
{
// Check if the user clicked to show the deemphasized source
if
(
this
.
deemphasizedStackFramesToShow
.
indexOf
(
child
)
===
-
1
)
{
if
(
result
.
length
&&
result
[
result
.
length
-
1
]
instanceof
Array
)
{
// Collect all the stackframes that will be "collapsed"
result
[
result
.
length
-
1
].
push
(
child
);
return
;
if
(
result
.
length
)
{
const
last
=
result
[
result
.
length
-
1
];
if
(
last
instanceof
Array
)
{
// Collect all the stackframes that will be "collapsed"
last
.
push
(
child
);
return
;
}
}
const
nextChild
=
index
<
children
.
length
-
1
?
children
[
index
+
1
]
:
undefined
;
...
...
@@ -644,7 +645,7 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
}
return
callStackPromise
.
then
(()
=>
{
if
(
callStack
.
length
===
1
&&
thread
.
session
.
capabilities
.
supportsDelayedStackTraceLoading
&&
thread
.
stoppedDetails
&&
thread
.
stoppedDetails
.
totalFrames
>
1
)
{
if
(
callStack
.
length
===
1
&&
thread
.
session
.
capabilities
.
supportsDelayedStackTraceLoading
&&
thread
.
stoppedDetails
&&
thread
.
stoppedDetails
.
totalFrames
&&
thread
.
stoppedDetails
.
totalFrames
>
1
)
{
// To reduce flashing of the call stack view simply append the stale call stack
// once we have the correct data the tree will refresh and we will no longer display it.
callStack
=
callStack
.
concat
(
thread
.
getStaleCallStack
().
slice
(
1
));
...
...
@@ -653,7 +654,7 @@ class CallStackDataSource implements IAsyncDataSource<IDebugModel, CallStackItem
if
(
thread
.
stoppedDetails
&&
thread
.
stoppedDetails
.
framesErrorMessage
)
{
callStack
=
callStack
.
concat
([
thread
.
stoppedDetails
.
framesErrorMessage
]);
}
if
(
thread
.
stoppedDetails
&&
thread
.
stoppedDetails
.
totalFrames
>
callStack
.
length
&&
callStack
.
length
>
1
)
{
if
(
thread
.
stoppedDetails
&&
thread
.
stoppedDetails
.
totalFrames
&&
thread
.
stoppedDetails
.
totalFrames
>
callStack
.
length
&&
callStack
.
length
>
1
)
{
callStack
=
callStack
.
concat
([
new
ThreadAndSessionIds
(
thread
.
session
.
getId
(),
thread
.
threadId
)]);
}
...
...
@@ -676,13 +677,11 @@ class CallStackAccessibilityProvider implements IAccessibilityProvider<CallStack
if
(
typeof
element
===
'
string
'
)
{
return
element
;
}
if
(
element
instanceof
ThreadAndSessionIds
)
{
return
nls
.
localize
(
'
loadMoreStackFrames
'
,
"
Load More Stack Frames
"
);
}
if
(
element
instanceof
Array
)
{
return
nls
.
localize
(
'
showMoreStackFrames
'
,
"
Show {0} More Stack Frames
"
,
element
.
length
);
}
return
null
;
// element instanceof ThreadAndSessionIds
return
nls
.
localize
(
'
loadMoreStackFrames
'
,
"
Load More Stack Frames
"
);
}
}
src/vs/workbench/contrib/debug/electron-browser/repl.ts
浏览文件 @
58b7cc9f
...
...
@@ -465,7 +465,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
actions
.
push
(
this
.
clearReplAction
);
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
e
.
anchor
!
,
getAnchor
:
()
=>
e
.
anchor
,
getActions
:
()
=>
actions
,
getActionsContext
:
()
=>
e
.
element
});
...
...
src/vs/workbench/contrib/debug/electron-browser/variablesView.ts
浏览文件 @
58b7cc9f
...
...
@@ -136,8 +136,7 @@ export class VariablesView extends ViewletPanel {
private
onContextMenu
(
e
:
ITreeContextMenuEvent
<
IExpression
|
IScope
>
):
void
{
const
element
=
e
.
element
;
const
anchor
=
e
.
anchor
;
if
(
element
instanceof
Variable
&&
!!
element
.
value
&&
anchor
)
{
if
(
element
instanceof
Variable
&&
!!
element
.
value
)
{
const
actions
:
IAction
[]
=
[];
const
variable
=
element
as
Variable
;
actions
.
push
(
new
SetValueAction
(
SetValueAction
.
ID
,
SetValueAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
...
...
@@ -147,7 +146,7 @@ export class VariablesView extends ViewletPanel {
actions
.
push
(
new
AddToWatchExpressionsAction
(
AddToWatchExpressionsAction
.
ID
,
AddToWatchExpressionsAction
.
LABEL
,
variable
,
this
.
debugService
,
this
.
keybindingService
));
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
anchor
,
getAnchor
:
()
=>
e
.
anchor
,
getActions
:
()
=>
actions
,
getActionsContext
:
()
=>
element
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录