Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4ada031b
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,发现更多精彩内容 >>
提交
4ada031b
编写于
12月 13, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: introduce explicit focusedThread
上级
e50a1f2d
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
41 addition
and
19 deletion
+41
-19
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+1
-1
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/common/debugViewModel.ts
src/vs/workbench/parts/debug/common/debugViewModel.ts
+11
-4
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
...s/workbench/parts/debug/electron-browser/callStackView.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+26
-11
src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts
.../workbench/parts/debug/test/common/debugViewModel.test.ts
+1
-1
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
4ada031b
...
...
@@ -781,7 +781,7 @@ export class FocusProcessAction extends AbstractDebugAction {
public
run
(
processName
:
string
):
TPromise
<
any
>
{
const
isMultiRoot
=
this
.
debugService
.
getConfigurationManager
().
getLaunches
().
length
>
1
;
const
process
=
this
.
debugService
.
getModel
().
getProcesses
().
filter
(
p
=>
p
.
getName
(
isMultiRoot
)
===
processName
).
pop
();
this
.
debugService
.
focusStackFrame
(
null
,
process
,
true
);
this
.
debugService
.
focusStackFrame
(
undefined
,
undefined
,
process
,
true
);
const
stackFrame
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
if
(
stackFrame
)
{
return
stackFrame
.
openInEditor
(
this
.
editorService
,
true
);
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
4ada031b
...
...
@@ -512,7 +512,7 @@ export interface IDebugService {
/**
* Sets the focused stack frame and evaluates all expressions against the newly focused stack frame,
*/
focusStackFrame
(
focusedStackFrame
:
IStackFrame
,
process
?:
IProcess
,
explicit
?:
boolean
):
void
;
focusStackFrame
(
focusedStackFrame
:
IStackFrame
,
thread
?:
IThread
,
process
?:
IProcess
,
explicit
?:
boolean
):
void
;
/**
* Adds new breakpoints to the model for the file specified with the uri. Notifies debug adapter of breakpoint changes.
...
...
src/vs/workbench/parts/debug/common/debugViewModel.ts
浏览文件 @
4ada031b
...
...
@@ -10,6 +10,7 @@ export class ViewModel implements debug.IViewModel {
private
_focusedStackFrame
:
debug
.
IStackFrame
;
private
_focusedProcess
:
debug
.
IProcess
;
private
_focusedThread
:
debug
.
IThread
;
private
selectedExpression
:
debug
.
IExpression
;
private
selectedFunctionBreakpoint
:
debug
.
IFunctionBreakpoint
;
private
_onDidFocusProcess
:
Emitter
<
debug
.
IProcess
|
undefined
>
;
...
...
@@ -40,13 +41,19 @@ export class ViewModel implements debug.IViewModel {
return
this
.
_focusedStackFrame
;
}
public
setFocusedStackFrame
(
stackFrame
:
debug
.
IStackFrame
,
process
:
debug
.
IProcess
,
explicit
:
boolean
):
void
{
this
.
_focusedStackFrame
=
stackFrame
;
if
(
process
!==
this
.
_focusedProcess
)
{
public
setFocus
(
stackFrame
:
debug
.
IStackFrame
,
thread
:
debug
.
IThread
,
process
:
debug
.
IProcess
,
explicit
:
boolean
):
void
{
let
shouldEmit
=
this
.
_focusedProcess
!==
process
||
this
.
_focusedThread
!==
thread
||
this
.
_focusedStackFrame
!==
stackFrame
;
if
(
this
.
_focusedProcess
!==
process
)
{
this
.
_focusedProcess
=
process
;
this
.
_onDidFocusProcess
.
fire
(
process
);
}
this
.
_onDidFocusStackFrame
.
fire
({
stackFrame
,
explicit
});
this
.
_focusedThread
=
thread
;
this
.
_focusedStackFrame
=
stackFrame
;
if
(
shouldEmit
)
{
this
.
_onDidFocusStackFrame
.
fire
({
stackFrame
,
explicit
});
}
}
public
get
onDidFocusProcess
():
Event
<
debug
.
IProcess
>
{
...
...
src/vs/workbench/parts/debug/electron-browser/callStackView.ts
浏览文件 @
4ada031b
...
...
@@ -222,7 +222,7 @@ class CallStackController extends BaseDebugController {
}
public
focusStackFrame
(
stackFrame
:
IStackFrame
,
event
:
any
,
preserveFocus
:
boolean
):
void
{
this
.
debugService
.
focusStackFrame
(
stackFrame
,
undefined
,
true
);
this
.
debugService
.
focusStackFrame
(
stackFrame
,
stackFrame
.
thread
,
stackFrame
.
thread
.
process
,
true
);
const
sideBySide
=
(
event
&&
(
event
.
ctrlKey
||
event
.
metaKey
));
stackFrame
.
openInEditor
(
this
.
editorService
,
preserveFocus
,
sideBySide
).
done
(
undefined
,
errors
.
onUnexpectedError
);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
4ada031b
...
...
@@ -320,7 +320,7 @@ export class DebugService implements debug.IDebugService {
const
threadId
=
event
.
body
.
allThreadsContinued
!==
false
?
undefined
:
event
.
body
.
threadId
;
this
.
model
.
clearThreads
(
session
.
getId
(),
false
,
threadId
);
if
(
this
.
viewModel
.
focusedProcess
.
getId
()
===
session
.
getId
())
{
this
.
focusStackFrame
(
null
,
this
.
viewModel
.
focusedProcess
);
this
.
focusStackFrame
(
undefined
,
this
.
viewModel
.
focusedThread
,
this
.
viewModel
.
focusedProcess
);
}
this
.
updateStateAndEmit
(
session
.
getId
(),
debug
.
State
.
Running
);
}));
...
...
@@ -534,18 +534,33 @@ export class DebugService implements debug.IDebugService {
}
}
public
focusStackFrame
(
stackFrame
:
debug
.
IStackFrame
,
process
?:
debug
.
IProcess
,
explicit
?:
boolean
):
void
{
public
focusStackFrame
(
stackFrame
:
debug
.
IStackFrame
,
thread
?:
debug
.
IThread
,
process
?:
debug
.
IProcess
,
explicit
?:
boolean
):
void
{
if
(
!
process
)
{
const
processes
=
this
.
model
.
getProcesses
();
process
=
stackFrame
?
stackFrame
.
thread
.
process
:
processes
.
length
?
processes
[
0
]
:
null
;
if
(
stackFrame
||
thread
)
{
process
=
stackFrame
?
stackFrame
.
thread
.
process
:
thread
.
process
;
}
else
{
const
processes
=
this
.
model
.
getProcesses
();
process
=
processes
.
length
?
processes
[
0
]
:
undefined
;
}
}
if
(
!
thread
)
{
if
(
stackFrame
)
{
thread
=
stackFrame
.
thread
;
}
else
{
const
threads
=
process
?
process
.
getAllThreads
()
:
undefined
;
thread
=
threads
&&
threads
.
length
?
threads
[
0
]
:
undefined
;
}
}
if
(
!
stackFrame
)
{
const
threads
=
process
?
process
.
getAllThreads
()
:
null
;
const
callStack
=
threads
&&
threads
.
length
===
1
?
threads
[
0
].
getCallStack
()
:
null
;
stackFrame
=
callStack
&&
callStack
.
length
?
callStack
[
0
]
:
null
;
if
(
thread
)
{
const
callStack
=
thread
.
getCallStack
();
stackFrame
=
callStack
&&
callStack
.
length
?
callStack
[
0
]
:
null
;
}
}
this
.
viewModel
.
setFocus
edStackFrame
(
stackFrame
,
process
,
explicit
);
this
.
viewModel
.
setFocus
(
stackFrame
,
thread
,
process
,
explicit
);
this
.
updateStateAndEmit
();
}
...
...
@@ -610,7 +625,7 @@ export class DebugService implements debug.IDebugService {
public
addReplExpression
(
name
:
string
):
TPromise
<
void
>
{
return
this
.
model
.
addReplExpression
(
this
.
viewModel
.
focusedProcess
,
this
.
viewModel
.
focusedStackFrame
,
name
)
// Evaluate all watch expressions and fetch variables again since repl evaluation might have changed some.
.
then
(()
=>
this
.
focusStackFrame
(
this
.
viewModel
.
focusedStackFrame
,
this
.
viewModel
.
focusedProcess
));
.
then
(()
=>
this
.
focusStackFrame
(
this
.
viewModel
.
focusedStackFrame
,
this
.
viewModel
.
focused
Thread
,
this
.
viewModel
.
focused
Process
));
}
public
removeReplExpressions
():
void
{
...
...
@@ -864,7 +879,7 @@ export class DebugService implements debug.IDebugService {
if
(
session
.
disconnected
)
{
return
TPromise
.
as
(
null
);
}
this
.
focusStackFrame
(
null
,
process
);
this
.
focusStackFrame
(
undefined
,
undefined
,
process
);
this
.
_onDidNewProcess
.
fire
(
process
);
const
internalConsoleOptions
=
configuration
.
internalConsoleOptions
||
this
.
configurationService
.
getValue
<
debug
.
IDebugConfiguration
>
(
'
debug
'
).
internalConsoleOptions
;
...
...
@@ -1041,7 +1056,7 @@ export class DebugService implements debug.IDebugService {
// Restart should preserve the focused process
const
restartedProcess
=
this
.
model
.
getProcesses
().
filter
(
p
=>
p
.
configuration
.
name
===
process
.
configuration
.
name
).
pop
();
if
(
restartedProcess
&&
restartedProcess
!==
this
.
viewModel
.
focusedProcess
)
{
this
.
focusStackFrame
(
null
,
restartedProcess
);
this
.
focusStackFrame
(
undefined
,
undefined
,
restartedProcess
);
}
}
});
...
...
src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts
浏览文件 @
4ada031b
...
...
@@ -26,7 +26,7 @@ suite('Debug - View Model', () => {
const
process
=
new
Process
({
name
:
'
mockProcess
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
mockSession
);
const
thread
=
new
Thread
(
process
,
'
myThread
'
,
1
);
const
frame
=
new
StackFrame
(
thread
,
1
,
null
,
'
app.js
'
,
'
normal
'
,
{
startColumn
:
1
,
startLineNumber
:
1
,
endColumn
:
undefined
,
endLineNumber
:
undefined
},
0
);
model
.
setFocus
edStackFrame
(
frame
,
process
,
false
);
model
.
setFocus
(
frame
,
thread
,
process
,
false
);
assert
.
equal
(
model
.
focusedStackFrame
.
getId
(),
frame
.
getId
());
assert
.
equal
(
model
.
focusedThread
.
threadId
,
1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录