Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
b3721667
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,发现更多精彩内容 >>
提交
b3721667
编写于
5月 04, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: different max value render lengths for repl / hover / viewlet
fixes #5823
上级
ef9ebb52
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
41 deletion
+42
-41
src/vs/workbench/parts/debug/browser/debugHover.ts
src/vs/workbench/parts/debug/browser/debugHover.ts
+2
-1
src/vs/workbench/parts/debug/browser/debugViewer.ts
src/vs/workbench/parts/debug/browser/debugViewer.ts
+40
-40
未找到文件。
src/vs/workbench/parts/debug/browser/debugHover.ts
浏览文件 @
b3721667
...
...
@@ -27,6 +27,7 @@ const debugTreeOptions = {
ariaLabel
:
nls
.
localize
(
'
treeAriaLabel
'
,
"
Debug Hover
"
)
};
const
MAX_ELEMENTS_SHOWN
=
18
;
const
MAX_VALUE_RENDER_LENGTH_IN_HOVER
=
4096
;
export
class
DebugHoverWidget
implements
editorbrowser
.
IContentWidget
{
...
...
@@ -182,7 +183,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
if
(
expression
.
reference
===
0
||
forceValueHover
)
{
this
.
treeContainer
.
hidden
=
true
;
this
.
valueContainer
.
hidden
=
false
;
viewer
.
renderExpressionValue
(
expression
,
this
.
valueContainer
,
false
);
viewer
.
renderExpressionValue
(
expression
,
this
.
valueContainer
,
false
,
MAX_VALUE_RENDER_LENGTH_IN_HOVER
);
this
.
valueContainer
.
title
=
''
;
this
.
editor
.
layoutContentWidget
(
this
);
if
(
focus
)
{
...
...
src/vs/workbench/parts/debug/browser/debugViewer.ts
浏览文件 @
b3721667
...
...
@@ -35,9 +35,9 @@ import {IKeyboardEvent} from 'vs/base/browser/keyboardEvent';
const
$
=
dom
.
emmet
;
const
booleanRegex
=
/^true|false$/i
;
const
stringRegex
=
/^
([
'"
])
.*
\1
$/
;
const
MAX_VALUE_RENDER_LENGTH
=
5000
;
const
MAX_VALUE_RENDER_LENGTH
_IN_VIEWLET
=
1024
;
export
function
renderExpressionValue
(
expressionOrValue
:
debug
.
IExpression
|
string
,
container
:
HTMLElement
,
showChanged
:
boolean
):
void
{
export
function
renderExpressionValue
(
expressionOrValue
:
debug
.
IExpression
|
string
,
container
:
HTMLElement
,
showChanged
:
boolean
,
maxValueRenderLength
?:
number
):
void
{
let
value
=
typeof
expressionOrValue
===
'
string
'
?
expressionOrValue
:
expressionOrValue
.
value
;
// remove stale classes
...
...
@@ -61,8 +61,8 @@ export function renderExpressionValue(expressionOrValue: debug.IExpression|strin
container
.
className
=
'
value changed
'
;
}
if
(
value
.
length
>
MAX_VALUE_RENDER_LENGTH
)
{
value
=
value
.
substr
(
0
,
MAX_VALUE_RENDER_LENGTH
)
+
'
...
'
;
if
(
maxValueRenderLength
&&
value
.
length
>
maxValueRenderLength
)
{
value
=
value
.
substr
(
0
,
maxValueRenderLength
)
+
'
...
'
;
}
container
.
textContent
=
value
;
container
.
title
=
value
;
...
...
@@ -74,7 +74,7 @@ export function renderVariable(tree: tree.ITree, variable: model.Variable, data:
}
if
(
variable
.
value
)
{
renderExpressionValue
(
variable
,
data
.
value
,
showChanged
);
renderExpressionValue
(
variable
,
data
.
value
,
showChanged
,
MAX_VALUE_RENDER_LENGTH_IN_VIEWLET
);
data
.
expression
.
title
=
variable
.
value
;
}
else
{
data
.
value
.
textContent
=
''
;
...
...
@@ -195,7 +195,7 @@ export class BaseDebugController extends treedefaults.DefaultController {
export
class
CallStackActionProvider
implements
renderer
.
IActionProvider
{
constructor
(@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
constructor
(
@
IInstantiationService
private
instantiationService
:
IInstantiationService
)
{
// noop
}
...
...
@@ -233,7 +233,7 @@ export class CallStackActionProvider implements renderer.IActionProvider {
export
class
CallStackDataSource
implements
tree
.
IDataSource
{
constructor
(@
debug
.
IDebugService
private
debugService
:
debug
.
IDebugService
)
{
constructor
(
@
debug
.
IDebugService
private
debugService
:
debug
.
IDebugService
)
{
// noop
}
...
...
@@ -286,10 +286,10 @@ interface ILoadMoreTemplateData {
interface
IStackFrameTemplateData
{
stackFrame
:
HTMLElement
;
label
:
HTMLElement
;
file
:
HTMLElement
;
fileName
:
HTMLElement
;
lineNumber
:
HTMLElement
;
label
:
HTMLElement
;
file
:
HTMLElement
;
fileName
:
HTMLElement
;
lineNumber
:
HTMLElement
;
}
export
class
CallStackRenderer
implements
tree
.
IRenderer
{
...
...
@@ -298,11 +298,11 @@ export class CallStackRenderer implements tree.IRenderer {
private
static
STACK_FRAME_TEMPLATE_ID
=
'
stackFrame
'
;
private
static
LOAD_MORE_TEMPLATE_ID
=
'
loadMore
'
;
constructor
(@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
constructor
(
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
// noop
}
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
return
22
;
}
...
...
@@ -371,7 +371,7 @@ export class CallStackRenderer implements tree.IRenderer {
data
.
label
.
title
=
stackFrame
.
name
;
data
.
fileName
.
textContent
=
getSourceName
(
stackFrame
.
source
,
this
.
contextService
);
if
(
stackFrame
.
source
.
available
&&
stackFrame
.
lineNumber
!==
undefined
)
{
data
.
lineNumber
.
textContent
=
`
${
stackFrame
.
lineNumber
}
`
;
data
.
lineNumber
.
textContent
=
`
${
stackFrame
.
lineNumber
}
`
;
dom
.
removeClass
(
data
.
lineNumber
,
'
unavailable
'
);
}
else
{
dom
.
addClass
(
data
.
lineNumber
,
'
unavailable
'
);
...
...
@@ -385,7 +385,7 @@ export class CallStackRenderer implements tree.IRenderer {
export
class
CallstackAccessibilityProvider
implements
tree
.
IAccessibilityProvider
{
constructor
(@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
constructor
(
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
// noop
}
...
...
@@ -423,7 +423,7 @@ export class VariablesActionProvider implements renderer.IActionProvider {
public
getSecondaryActions
(
tree
:
tree
.
ITree
,
element
:
any
):
TPromise
<
actions
.
IAction
[]
>
{
let
actions
:
actions
.
Action
[]
=
[];
const
variable
=
<
model
.
Variable
>
element
;
const
variable
=
<
model
.
Variable
>
element
;
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
AddToWatchExpressionsAction
,
debugactions
.
AddToWatchExpressionsAction
.
ID
,
debugactions
.
AddToWatchExpressionsAction
.
LABEL
,
variable
));
if
(
variable
.
reference
===
0
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
CopyValueAction
,
debugactions
.
CopyValueAction
.
ID
,
debugactions
.
CopyValueAction
.
LABEL
,
variable
));
...
...
@@ -452,17 +452,17 @@ export class VariablesDataSource implements tree.IDataSource {
return
true
;
}
let
variable
=
<
model
.
Variable
>
element
;
let
variable
=
<
model
.
Variable
>
element
;
return
variable
.
reference
!==
0
&&
!
strings
.
equalsIgnoreCase
(
variable
.
value
,
'
null
'
);
}
public
getChildren
(
tree
:
tree
.
ITree
,
element
:
any
):
TPromise
<
any
>
{
if
(
element
instanceof
viewmodel
.
ViewModel
)
{
let
focusedStackFrame
=
(
<
viewmodel
.
ViewModel
>
element
).
getFocusedStackFrame
();
let
focusedStackFrame
=
(
<
viewmodel
.
ViewModel
>
element
).
getFocusedStackFrame
();
return
focusedStackFrame
?
focusedStackFrame
.
getScopes
(
this
.
debugService
)
:
TPromise
.
as
([]);
}
let
scope
=
<
model
.
Scope
>
element
;
let
scope
=
<
model
.
Scope
>
element
;
return
scope
.
getChildren
(
this
.
debugService
);
}
...
...
@@ -577,7 +577,7 @@ export class WatchExpressionsActionProvider implements renderer.IActionProvider
public
getSecondaryActions
(
tree
:
tree
.
ITree
,
element
:
any
):
TPromise
<
actions
.
IAction
[]
>
{
const
actions
:
actions
.
Action
[]
=
[];
if
(
element
instanceof
model
.
Expression
)
{
const
expression
=
<
model
.
Expression
>
element
;
const
expression
=
<
model
.
Expression
>
element
;
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
AddWatchExpressionAction
,
debugactions
.
AddWatchExpressionAction
.
ID
,
debugactions
.
AddWatchExpressionAction
.
LABEL
));
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
RenameWatchExpressionAction
,
debugactions
.
RenameWatchExpressionAction
.
ID
,
debugactions
.
RenameWatchExpressionAction
.
LABEL
,
expression
));
if
(
expression
.
reference
===
0
)
{
...
...
@@ -590,7 +590,7 @@ export class WatchExpressionsActionProvider implements renderer.IActionProvider
}
else
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
AddWatchExpressionAction
,
debugactions
.
AddWatchExpressionAction
.
ID
,
debugactions
.
AddWatchExpressionAction
.
LABEL
));
if
(
element
instanceof
model
.
Variable
)
{
const
variable
=
<
model
.
Variable
>
element
;
const
variable
=
<
model
.
Variable
>
element
;
if
(
variable
.
reference
===
0
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
debugactions
.
CopyValueAction
,
debugactions
.
CopyValueAction
.
ID
,
debugactions
.
CopyValueAction
.
LABEL
,
variable
.
value
));
}
...
...
@@ -622,16 +622,16 @@ export class WatchExpressionsDataSource implements tree.IDataSource {
return
true
;
}
const
watchExpression
=
<
model
.
Expression
>
element
;
const
watchExpression
=
<
model
.
Expression
>
element
;
return
watchExpression
.
reference
!==
0
&&
!
strings
.
equalsIgnoreCase
(
watchExpression
.
value
,
'
null
'
);
}
public
getChildren
(
tree
:
tree
.
ITree
,
element
:
any
):
TPromise
<
any
>
{
if
(
element
instanceof
model
.
Model
)
{
return
TPromise
.
as
((
<
model
.
Model
>
element
).
getWatchExpressions
());
return
TPromise
.
as
((
<
model
.
Model
>
element
).
getWatchExpressions
());
}
let
expression
=
<
model
.
Expression
>
element
;
let
expression
=
<
model
.
Expression
>
element
;
return
expression
.
getChildren
(
this
.
debugService
);
}
...
...
@@ -657,10 +657,10 @@ export class WatchExpressionsRenderer implements tree.IRenderer {
@
IContextViewService
private
contextViewService
:
IContextViewService
)
{
this
.
toDispose
=
[];
this
.
actionProvider
=
<
WatchExpressionsActionProvider
>
actionProvider
;
this
.
actionProvider
=
<
WatchExpressionsActionProvider
>
actionProvider
;
}
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
return
22
;
}
...
...
@@ -676,7 +676,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer {
let
data
:
IWatchExpressionTemplateData
=
Object
.
create
(
null
);
if
(
templateId
===
WatchExpressionsRenderer
.
WATCH_EXPRESSION_TEMPLATE_ID
)
{
data
.
actionBar
=
new
actionbar
.
ActionBar
(
container
,
{
actionRunner
:
this
.
actionRunner
});
data
.
actionBar
.
push
(
this
.
actionProvider
.
getExpressionActions
()
,
{
icon
:
true
,
label
:
false
});
data
.
actionBar
.
push
(
this
.
actionProvider
.
getExpressionActions
(),
{
icon
:
true
,
label
:
false
});
}
data
.
expression
=
dom
.
append
(
container
,
$
(
isMacintosh
?
'
.expression.mac
'
:
'
.expression.win-linux
'
));
...
...
@@ -703,7 +703,7 @@ export class WatchExpressionsRenderer implements tree.IRenderer {
data
.
name
.
textContent
=
`
${
watchExpression
.
name
}
:`
;
if
(
watchExpression
.
value
)
{
renderExpressionValue
(
watchExpression
,
data
.
value
,
true
);
renderExpressionValue
(
watchExpression
,
data
.
value
,
true
,
MAX_VALUE_RENDER_LENGTH_IN_VIEWLET
);
data
.
expression
.
title
=
watchExpression
.
value
;
}
}
...
...
@@ -748,7 +748,7 @@ export class WatchExpressionsController extends BaseDebugController {
protected
onLeftClick
(
tree
:
tree
.
ITree
,
element
:
any
,
event
:
mouse
.
IMouseEvent
):
boolean
{
// double click on primitive value: open input box to be able to select and copy value.
if
(
element
instanceof
model
.
Expression
&&
event
.
detail
===
2
)
{
const
expression
=
<
debug
.
IExpression
>
element
;
const
expression
=
<
debug
.
IExpression
>
element
;
if
(
expression
.
reference
===
0
)
{
this
.
debugService
.
getViewModel
().
setSelectedExpression
(
expression
);
}
...
...
@@ -761,7 +761,7 @@ export class WatchExpressionsController extends BaseDebugController {
protected
onRename
(
tree
:
tree
.
ITree
,
event
:
KeyboardEvent
):
boolean
{
const
element
=
tree
.
getFocus
();
if
(
element
instanceof
model
.
Expression
)
{
const
watchExpression
=
<
model
.
Expression
>
element
;
const
watchExpression
=
<
model
.
Expression
>
element
;
if
(
watchExpression
.
reference
===
0
)
{
this
.
debugService
.
getViewModel
().
setSelectedExpression
(
watchExpression
);
}
...
...
@@ -774,7 +774,7 @@ export class WatchExpressionsController extends BaseDebugController {
protected
onDelete
(
tree
:
tree
.
ITree
,
event
:
IKeyboardEvent
):
boolean
{
const
element
=
tree
.
getFocus
();
if
(
element
instanceof
model
.
Expression
)
{
const
we
=
<
model
.
Expression
>
element
;
const
we
=
<
model
.
Expression
>
element
;
this
.
debugService
.
removeWatchExpressions
(
we
.
getId
());
return
true
;
...
...
@@ -856,8 +856,8 @@ export class BreakpointsDataSource implements tree.IDataSource {
}
public
getChildren
(
tree
:
tree
.
ITree
,
element
:
any
):
TPromise
<
any
>
{
const
model
=
<
model
.
Model
>
element
;
const
exBreakpoints
=
<
debug
.
IEnablement
[]
>
model
.
getExceptionBreakpoints
();
const
model
=
<
model
.
Model
>
element
;
const
exBreakpoints
=
<
debug
.
IEnablement
[]
>
model
.
getExceptionBreakpoints
();
return
TPromise
.
as
(
exBreakpoints
.
concat
(
model
.
getFunctionBreakpoints
()).
concat
(
model
.
getBreakpoints
()));
}
...
...
@@ -901,7 +901,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
// noop
}
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
public
getHeight
(
tree
:
tree
.
ITree
,
element
:
any
):
number
{
return
22
;
}
...
...
@@ -929,7 +929,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
data
.
breakpoint
=
dom
.
append
(
container
,
$
(
'
.breakpoint
'
));
data
.
toDisposeBeforeRender
=
[];
data
.
checkbox
=
<
HTMLInputElement
>
$
(
'
input
'
);
data
.
checkbox
=
<
HTMLInputElement
>
$
(
'
input
'
);
data
.
checkbox
.
type
=
'
checkbox
'
;
if
(
!
isMacintosh
)
{
data
.
checkbox
.
className
=
'
checkbox-win-linux
'
;
...
...
@@ -963,7 +963,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
}
private
renderExceptionBreakpoint
(
exceptionBreakpoint
:
debug
.
IExceptionBreakpoint
,
data
:
IExceptionBreakpointTemplateData
):
void
{
data
.
name
.
textContent
=
exceptionBreakpoint
.
label
||
`
${
exceptionBreakpoint
.
filter
}
exceptions`
;;
data
.
name
.
textContent
=
exceptionBreakpoint
.
label
||
`
${
exceptionBreakpoint
.
filter
}
exceptions`
;;
data
.
checkbox
.
checked
=
exceptionBreakpoint
.
enabled
;
}
...
...
@@ -1008,7 +1008,7 @@ export class BreakpointsRenderer implements tree.IRenderer {
export
class
BreakpointsAccessibilityProvider
implements
tree
.
IAccessibilityProvider
{
constructor
(@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
constructor
(
@
IWorkspaceContextService
private
contextService
:
IWorkspaceContextService
)
{
// noop
}
...
...
@@ -1029,7 +1029,7 @@ export class BreakpointsAccessibilityProvider implements tree.IAccessibilityProv
export
class
BreakpointsController
extends
BaseDebugController
{
protected
onLeftClick
(
tree
:
tree
.
ITree
,
element
:
any
,
event
:
mouse
.
IMouseEvent
):
boolean
{
protected
onLeftClick
(
tree
:
tree
.
ITree
,
element
:
any
,
event
:
mouse
.
IMouseEvent
):
boolean
{
if
(
element
instanceof
model
.
FunctionBreakpoint
&&
event
.
detail
===
2
)
{
this
.
debugService
.
getViewModel
().
setSelectedFunctionBreakpoint
(
element
);
return
true
;
...
...
@@ -1050,10 +1050,10 @@ export class BreakpointsController extends BaseDebugController {
protected
onDelete
(
tree
:
tree
.
ITree
,
event
:
IKeyboardEvent
):
boolean
{
const
element
=
tree
.
getFocus
();
if
(
element
instanceof
model
.
Breakpoint
)
{
this
.
debugService
.
removeBreakpoints
((
<
model
.
Breakpoint
>
element
).
getId
()).
done
(
null
,
errors
.
onUnexpectedError
);
this
.
debugService
.
removeBreakpoints
((
<
model
.
Breakpoint
>
element
).
getId
()).
done
(
null
,
errors
.
onUnexpectedError
);
return
true
;
}
else
if
(
element
instanceof
model
.
FunctionBreakpoint
)
{
const
fbp
=
<
model
.
FunctionBreakpoint
>
element
;
const
fbp
=
<
model
.
FunctionBreakpoint
>
element
;
this
.
debugService
.
removeFunctionBreakpoints
(
fbp
.
getId
()).
done
(
null
,
errors
.
onUnexpectedError
);
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录