Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3fc780dc
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,发现更多精彩内容 >>
提交
3fc780dc
编写于
10月 16, 2019
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug more async/await
上级
042caca1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
35 deletion
+30
-35
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
+10
-12
src/vs/workbench/contrib/debug/common/debugModel.ts
src/vs/workbench/contrib/debug/common/debugModel.ts
+20
-23
未找到文件。
src/vs/workbench/contrib/debug/browser/breakpointsView.ts
浏览文件 @
3fc780dc
...
...
@@ -161,21 +161,19 @@ export class BreakpointsView extends ViewletPanel {
const
breakpointType
=
element
instanceof
Breakpoint
&&
element
.
logMessage
?
nls
.
localize
(
'
Logpoint
'
,
"
Logpoint
"
)
:
nls
.
localize
(
'
Breakpoint
'
,
"
Breakpoint
"
);
if
(
element
instanceof
Breakpoint
||
element
instanceof
FunctionBreakpoint
)
{
actions
.
push
(
new
Action
(
'
workbench.action.debug.openEditorAndEditBreakpoint
'
,
nls
.
localize
(
'
editBreakpoint
'
,
"
Edit {0}...
"
,
breakpointType
),
''
,
true
,
()
=>
{
actions
.
push
(
new
Action
(
'
workbench.action.debug.openEditorAndEditBreakpoint
'
,
nls
.
localize
(
'
editBreakpoint
'
,
"
Edit {0}...
"
,
breakpointType
),
''
,
true
,
async
()
=>
{
if
(
element
instanceof
Breakpoint
)
{
return
openBreakpointSource
(
element
,
false
,
false
,
this
.
debugService
,
this
.
editorService
).
then
(
editor
=>
{
if
(
editor
)
{
const
codeEditor
=
editor
.
getControl
();
if
(
isCodeEditor
(
codeEditor
))
{
codeEditor
.
getContribution
<
IBreakpointEditorContribution
>
(
BREAKPOINT_EDITOR_CONTRIBUTION_ID
).
showBreakpointWidget
(
element
.
lineNumber
,
element
.
column
);
}
const
editor
=
await
openBreakpointSource
(
element
,
false
,
false
,
this
.
debugService
,
this
.
editorService
);
if
(
editor
)
{
const
codeEditor
=
editor
.
getControl
();
if
(
isCodeEditor
(
codeEditor
))
{
codeEditor
.
getContribution
<
IBreakpointEditorContribution
>
(
BREAKPOINT_EDITOR_CONTRIBUTION_ID
).
showBreakpointWidget
(
element
.
lineNumber
,
element
.
column
);
}
});
}
}
else
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
this
.
onBreakpointsChange
();
}
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
this
.
onBreakpointsChange
();
return
Promise
.
resolve
(
undefined
);
}));
actions
.
push
(
new
Separator
());
}
...
...
src/vs/workbench/contrib/debug/common/debugModel.ts
浏览文件 @
3fc780dc
...
...
@@ -316,18 +316,17 @@ export class StackFrame implements IStackFrame {
return
(
from
>
0
?
'
...
'
:
''
)
+
this
.
source
.
uri
.
path
.
substr
(
from
);
}
getMostSpecificScopes
(
range
:
IRange
):
Promise
<
IScope
[]
>
{
return
this
.
getScopes
().
then
(
scopes
=>
{
s
copes
=
scopes
.
filter
(
s
=>
!
s
.
expensive
);
const
haveRangeInfo
=
s
copes
.
some
(
s
=>
!!
s
.
range
);
if
(
!
haveRangeInfo
)
{
return
s
copes
;
}
async
getMostSpecificScopes
(
range
:
IRange
):
Promise
<
IScope
[]
>
{
const
scopes
=
await
this
.
getScopes
();
const
nonExpensiveS
copes
=
scopes
.
filter
(
s
=>
!
s
.
expensive
);
const
haveRangeInfo
=
nonExpensiveS
copes
.
some
(
s
=>
!!
s
.
range
);
if
(
!
haveRangeInfo
)
{
return
nonExpensiveS
copes
;
}
const
scopesContainingRange
=
scopes
.
filter
(
scope
=>
scope
.
range
&&
Range
.
containsRange
(
scope
.
range
,
range
))
.
sort
((
first
,
second
)
=>
(
first
.
range
!
.
endLineNumber
-
first
.
range
!
.
startLineNumber
)
-
(
second
.
range
!
.
endLineNumber
-
second
.
range
!
.
startLineNumber
));
return
scopesContainingRange
.
length
?
scopesContainingRange
:
scopes
;
});
const
scopesContainingRange
=
nonExpensiveScopes
.
filter
(
scope
=>
scope
.
range
&&
Range
.
containsRange
(
scope
.
range
,
range
))
.
sort
((
first
,
second
)
=>
(
first
.
range
!
.
endLineNumber
-
first
.
range
!
.
startLineNumber
)
-
(
second
.
range
!
.
endLineNumber
-
second
.
range
!
.
startLineNumber
));
return
scopesContainingRange
.
length
?
scopesContainingRange
:
nonExpensiveScopes
;
}
restart
():
Promise
<
void
>
{
...
...
@@ -404,23 +403,21 @@ export class Thread implements IThread {
* Only fetches the first stack frame for performance reasons. Calling this method consecutive times
* gets the remainder of the call stack.
*/
fetchCallStack
(
levels
=
20
):
Promise
<
void
>
{
if
(
!
this
.
stopped
)
{
return
Promise
.
resolve
(
undefined
);
}
const
start
=
this
.
callStack
.
length
;
return
this
.
getCallStackImpl
(
start
,
levels
).
then
(
callStack
=>
{
async
fetchCallStack
(
levels
=
20
):
Promise
<
void
>
{
if
(
this
.
stopped
)
{
const
start
=
this
.
callStack
.
length
;
const
callStack
=
await
this
.
getCallStackImpl
(
start
,
levels
);
if
(
start
<
this
.
callStack
.
length
)
{
// Set the stack frames for exact position we requested. To make sure no concurrent requests create duplicate stack frames #30660
this
.
callStack
.
splice
(
start
,
this
.
callStack
.
length
-
start
);
}
this
.
callStack
=
this
.
callStack
.
concat
(
callStack
||
[]);
}
);
}
}
private
getCallStackImpl
(
startFrame
:
number
,
levels
:
number
):
Promise
<
IStackFrame
[]
>
{
return
this
.
session
.
stackTrace
(
this
.
threadId
,
startFrame
,
levels
).
then
(
response
=>
{
private
async
getCallStackImpl
(
startFrame
:
number
,
levels
:
number
):
Promise
<
IStackFrame
[]
>
{
try
{
const
response
=
await
this
.
session
.
stackTrace
(
this
.
threadId
,
startFrame
,
levels
);
if
(
!
response
||
!
response
.
body
)
{
return
[];
}
...
...
@@ -439,13 +436,13 @@ export class Thread implements IThread {
rsf
.
endColumn
||
rsf
.
column
),
startFrame
+
index
);
});
}
,
(
err
:
Error
)
=>
{
}
catch
(
err
)
{
if
(
this
.
stoppedDetails
)
{
this
.
stoppedDetails
.
framesErrorMessage
=
err
.
message
;
}
return
[];
}
);
}
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录