Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
74fae4d7
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,发现更多精彩内容 >>
提交
74fae4d7
编写于
10月 05, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
repl: multiple trees per session
上级
51cfd808
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
17 deletion
+30
-17
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+0
-4
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/repl.ts
src/vs/workbench/parts/debug/electron-browser/repl.ts
+20
-7
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
+4
-3
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+3
-0
src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts
...ench/parts/debug/test/electron-browser/debugModel.test.ts
+1
-1
未找到文件。
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
74fae4d7
...
...
@@ -166,6 +166,7 @@ export interface IDebugSession extends ITreeElement {
// session events
readonly
onDidEndAdapter
:
Event
<
AdapterEndEvent
>
;
readonly
onDidChangeState
:
Event
<
void
>
;
readonly
onDidChangeReplElements
:
Event
<
void
>
;
// DA capabilities
readonly
capabilities
:
DebugProtocol
.
Capabilities
;
...
...
@@ -381,7 +382,6 @@ export interface IDebugModel extends ITreeElement {
getFunctionBreakpoints
():
ReadonlyArray
<
IFunctionBreakpoint
>
;
getExceptionBreakpoints
():
ReadonlyArray
<
IExceptionBreakpoint
>
;
getWatchExpressions
():
ReadonlyArray
<
IExpression
>
;
getReplElements
():
ReadonlyArray
<
IReplElement
>
;
onDidChangeBreakpoints
:
Event
<
IBreakpointsChangeEvent
>
;
onDidChangeCallStack
:
Event
<
void
>
;
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
74fae4d7
...
...
@@ -1005,10 +1005,6 @@ export class DebugModel implements IDebugModel {
this
.
_onDidChangeBreakpoints
.
fire
({
removed
:
removed
});
}
public
getReplElements
():
ReadonlyArray
<
IReplElement
>
{
return
this
.
sessions
.
map
(
s
=>
s
.
getReplElements
()).
reduce
((
left
,
right
)
=>
left
.
concat
(
right
),
[]);
}
public
getWatchExpressions
():
Expression
[]
{
return
this
.
watchExpressions
;
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
74fae4d7
...
...
@@ -471,7 +471,7 @@ export class DebugService implements IDebugService {
}
// Show the repl if some error got logged there #5870
if
(
this
.
model
.
getReplElements
().
length
>
0
)
{
if
(
session
&&
session
.
getReplElements
().
length
>
0
)
{
this
.
panelService
.
openPanel
(
REPL_ID
,
false
);
}
...
...
src/vs/workbench/parts/debug/electron-browser/repl.ts
浏览文件 @
74fae4d7
...
...
@@ -37,7 +37,7 @@ import { clipboard } from 'electron';
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
WorkbenchTree
}
from
'
vs/platform/list/browser/listService
'
;
import
{
memoize
}
from
'
vs/base/common/decorators
'
;
import
{
dispose
}
from
'
vs/base/common/lifecycle
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
OpenMode
,
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
EditorContextKeys
}
from
'
vs/editor/common/editorContextKeys
'
;
import
{
CodeEditorWidget
}
from
'
vs/editor/browser/widget/codeEditorWidget
'
;
...
...
@@ -106,10 +106,21 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
}
private
registerListeners
():
void
{
// TODO@Isidor
// this._register(this.debugService.getModel().onDidChangeReplElements(() => {
// this.refreshReplElements(this.debugService.getModel().getReplElements().length === 0);
// }));
let
replElementsChangeListener
:
IDisposable
;
this
.
_register
(
this
.
debugService
.
getViewModel
().
onDidFocusSession
(
session
=>
{
if
(
replElementsChangeListener
)
{
replElementsChangeListener
.
dispose
();
}
if
(
session
)
{
replElementsChangeListener
=
session
.
onDidChangeReplElements
(()
=>
{
this
.
refreshReplElements
(
session
.
getReplElements
().
length
===
0
);
});
if
(
this
.
tree
&&
this
.
isVisible
())
{
this
.
tree
.
setInput
(
session
);
}
}
}));
this
.
_register
(
this
.
panelService
.
onDidPanelOpen
(
panel
=>
this
.
refreshReplElements
(
true
)));
}
...
...
@@ -149,8 +160,6 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
accessibilityProvider
:
new
ReplExpressionsAccessibilityProvider
(),
controller
},
replTreeOptions
);
await
this
.
tree
.
setInput
(
this
.
debugService
.
getModel
());
}
public
setVisible
(
visible
:
boolean
):
Promise
<
void
>
{
...
...
@@ -159,6 +168,10 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
}
else
{
this
.
model
=
this
.
modelService
.
createModel
(
''
,
null
,
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:replinput`
),
true
);
this
.
replInput
.
setModel
(
this
.
model
);
const
focusedSession
=
this
.
debugService
.
getViewModel
().
focusedSession
;
if
(
focusedSession
&&
this
.
tree
.
getInput
()
!==
focusedSession
)
{
this
.
tree
.
setInput
(
focusedSession
);
}
}
return
super
.
setVisible
(
visible
);
...
...
src/vs/workbench/parts/debug/electron-browser/replViewer.ts
浏览文件 @
74fae4d7
...
...
@@ -15,7 +15,7 @@ import { IMouseEvent } from 'vs/base/browser/mouseEvent';
import
{
ITree
,
IAccessibilityProvider
,
ContextMenuEvent
,
IDataSource
,
IRenderer
,
IActionProvider
}
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
ICancelableEvent
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
IExpressionContainer
,
IExpression
,
IReplElementSource
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
DebugModel
,
RawObjectReplElement
,
Expression
,
SimpleReplElement
,
Variable
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
RawObjectReplElement
,
Expression
,
SimpleReplElement
,
Variable
}
from
'
vs/workbench/parts/debug/common/debugModel
'
;
import
{
renderVariable
,
renderExpressionValue
,
IVariableTemplateData
,
BaseDebugController
}
from
'
vs/workbench/parts/debug/browser/baseDebugView
'
;
import
{
ClearReplAction
,
ReplCollapseAllAction
}
from
'
vs/workbench/parts/debug/browser/debugActions
'
;
import
{
CopyAction
,
CopyAllAction
}
from
'
vs/workbench/parts/debug/electron-browser/electronDebugActions
'
;
...
...
@@ -24,6 +24,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import
{
LinkDetector
}
from
'
vs/workbench/parts/debug/browser/linkDetector
'
;
import
{
handleANSIOutput
}
from
'
vs/workbench/parts/debug/browser/debugANSIHandling
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
DebugSession
}
from
'
vs/workbench/parts/debug/electron-browser/debugSession
'
;
const
$
=
dom
.
$
;
...
...
@@ -34,11 +35,11 @@ export class ReplExpressionsDataSource implements IDataSource {
}
public
hasChildren
(
tree
:
ITree
,
element
:
any
):
boolean
{
return
element
instanceof
Debug
Model
||
(
<
IExpressionContainer
>
element
).
hasChildren
;
return
element
instanceof
Debug
Session
||
(
<
IExpressionContainer
>
element
).
hasChildren
;
}
public
getChildren
(
tree
:
ITree
,
element
:
any
):
TPromise
<
any
>
{
if
(
element
instanceof
Debug
Model
)
{
if
(
element
instanceof
Debug
Session
)
{
return
Promise
.
resolve
(
element
.
getReplElements
());
}
if
(
element
instanceof
RawObjectReplElement
)
{
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
74fae4d7
...
...
@@ -133,6 +133,9 @@ export class MockSession implements IDebugSession {
}
removeReplExpressions
():
void
{
}
get
onDidChangeReplElements
():
Event
<
void
>
{
return
null
;
}
addReplExpression
(
stackFrame
:
IStackFrame
,
name
:
string
):
TPromise
<
void
>
{
return
TPromise
.
as
(
void
0
);
...
...
src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts
浏览文件 @
74fae4d7
...
...
@@ -340,8 +340,8 @@ suite('Debug - Model', () => {
});
test
(
'
repl expressions
'
,
()
=>
{
assert
.
equal
(
model
.
getReplElements
().
length
,
0
);
const
session
=
new
DebugSession
({
resolved
:
{
name
:
'
mockSession
'
,
type
:
'
node
'
,
request
:
'
launch
'
},
unresolved
:
undefined
},
undefined
,
model
,
undefined
,
undefined
,
undefined
,
undefined
,
undefined
,
undefined
,
undefined
);
assert
.
equal
(
session
.
getReplElements
().
length
,
0
);
model
.
addSession
(
session
);
session
[
'
raw
'
]
=
<
any
>
rawSession
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录