Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
f62a5db2
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,发现更多精彩内容 >>
提交
f62a5db2
编写于
11月 02, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: do not cache children for expressions (tree does that automatically)
上级
43f86ea3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
38 addition
and
47 deletion
+38
-47
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+35
-44
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-1
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/common/debugModel.ts
浏览文件 @
f62a5db2
...
...
@@ -106,59 +106,50 @@ export abstract class ExpressionContainer implements debug.IExpressionContainer
private
static
BASE_CHUNK_SIZE
=
100
;
public
valueChanged
:
boolean
;
private
children
:
TPromise
<
debug
.
IExpression
[]
>
;
private
_value
:
string
;
constructor
(
public
stackFrame
:
debug
.
IStackFrame
,
public
reference
:
number
,
private
id
:
string
,
private
cacheChildren
:
boolean
,
public
namedVariables
:
number
,
public
indexedVariables
:
number
,
private
startOfVariables
=
0
)
{
// noop
}
)
{
}
public
getChildren
():
TPromise
<
debug
.
IExpression
[]
>
{
if
(
!
this
.
cacheChildren
||
!
this
.
children
)
{
// only variables with reference > 0 have children.
if
(
this
.
reference
<=
0
)
{
this
.
children
=
TPromise
.
as
([]);
}
else
{
if
(
!
this
.
getChildrenInChunks
)
{
return
this
.
fetchVariables
(
undefined
,
undefined
,
undefined
);
// only variables with reference > 0 have children.
if
(
this
.
reference
<=
0
)
{
return
TPromise
.
as
([]);
}
if
(
!
this
.
getChildrenInChunks
)
{
return
this
.
fetchVariables
(
undefined
,
undefined
,
undefined
);
}
// Check if object has named variables, fetch them independent from indexed variables #9670
return
(
!!
this
.
namedVariables
?
this
.
fetchVariables
(
undefined
,
undefined
,
'
named
'
)
:
TPromise
.
as
([])).
then
(
childrenArray
=>
{
// Use a dynamic chunk size based on the number of elements #9774
let
chunkSize
=
ExpressionContainer
.
BASE_CHUNK_SIZE
;
while
(
this
.
indexedVariables
>
chunkSize
*
ExpressionContainer
.
BASE_CHUNK_SIZE
)
{
chunkSize
*=
ExpressionContainer
.
BASE_CHUNK_SIZE
;
}
if
(
this
.
indexedVariables
>
chunkSize
)
{
// There are a lot of children, create fake intermediate values that represent chunks #9537
const
numberOfChunks
=
Math
.
ceil
(
this
.
indexedVariables
/
chunkSize
);
for
(
let
i
=
0
;
i
<
numberOfChunks
;
i
++
)
{
const
start
=
this
.
startOfVariables
+
i
*
chunkSize
;
const
count
=
Math
.
min
(
chunkSize
,
this
.
indexedVariables
-
i
*
chunkSize
);
childrenArray
.
push
(
new
Variable
(
this
.
stackFrame
,
this
,
this
.
reference
,
`[
${
start
}
..
${
start
+
count
-
1
}
]`
,
''
,
''
,
null
,
count
,
null
,
true
,
start
));
}
// Check if object has named variables, fetch them independent from indexed variables #9670
this
.
children
=
(
!!
this
.
namedVariables
?
this
.
fetchVariables
(
undefined
,
undefined
,
'
named
'
)
:
TPromise
.
as
([])).
then
(
childrenArray
=>
{
// Use a dynamic chunk size based on the number of elements #9774
let
chunkSize
=
ExpressionContainer
.
BASE_CHUNK_SIZE
;
while
(
this
.
indexedVariables
>
chunkSize
*
ExpressionContainer
.
BASE_CHUNK_SIZE
)
{
chunkSize
*=
ExpressionContainer
.
BASE_CHUNK_SIZE
;
}
if
(
this
.
indexedVariables
>
chunkSize
)
{
// There are a lot of children, create fake intermediate values that represent chunks #9537
const
numberOfChunks
=
Math
.
ceil
(
this
.
indexedVariables
/
chunkSize
);
for
(
let
i
=
0
;
i
<
numberOfChunks
;
i
++
)
{
const
start
=
this
.
startOfVariables
+
i
*
chunkSize
;
const
count
=
Math
.
min
(
chunkSize
,
this
.
indexedVariables
-
i
*
chunkSize
);
childrenArray
.
push
(
new
Variable
(
this
.
stackFrame
,
this
,
this
.
reference
,
`[
${
start
}
..
${
start
+
count
-
1
}
]`
,
''
,
''
,
null
,
count
,
null
,
true
,
start
));
}
return
childrenArray
;
}
return
this
.
fetchVariables
(
this
.
startOfVariables
,
this
.
indexedVariables
,
'
indexed
'
)
.
then
(
variables
=>
childrenArray
.
concat
(
variables
));
});
return
childrenArray
;
}
}
return
this
.
children
;
return
this
.
fetchVariables
(
this
.
startOfVariables
,
this
.
indexedVariables
,
'
indexed
'
)
.
then
(
variables
=>
childrenArray
.
concat
(
variables
));
});
}
public
getId
():
string
{
...
...
@@ -205,8 +196,8 @@ export class Expression extends ExpressionContainer implements debug.IExpression
public
available
:
boolean
;
public
type
:
string
;
constructor
(
public
name
:
string
,
cacheChildren
:
boolean
,
id
=
generateUuid
())
{
super
(
null
,
0
,
id
,
cacheChildren
,
0
,
0
);
constructor
(
public
name
:
string
,
id
=
generateUuid
())
{
super
(
null
,
0
,
id
,
0
,
0
);
this
.
available
=
false
;
// name is not set if the expression is just being added
// in that case do not set default value to prevent flashing #14499
...
...
@@ -269,7 +260,7 @@ export class Variable extends ExpressionContainer implements debug.IExpression {
public
available
=
true
,
startOfVariables
=
0
)
{
super
(
stackFrame
,
reference
,
`variable:
${
parent
.
getId
()}
:
${
name
}
:
${
reference
}
`
,
true
,
namedVariables
,
indexedVariables
,
startOfVariables
);
super
(
stackFrame
,
reference
,
`variable:
${
parent
.
getId
()}
:
${
name
}
:
${
reference
}
`
,
namedVariables
,
indexedVariables
,
startOfVariables
);
this
.
value
=
massageValue
(
value
);
}
...
...
@@ -331,7 +322,7 @@ export class Scope extends ExpressionContainer implements debug.IScope {
namedVariables
:
number
,
indexedVariables
:
number
)
{
super
(
stackFrame
,
reference
,
`scope:
${
stackFrame
.
getId
()}
:
${
name
}
:
${
reference
}
`
,
true
,
namedVariables
,
indexedVariables
);
super
(
stackFrame
,
reference
,
`scope:
${
stackFrame
.
getId
()}
:
${
name
}
:
${
reference
}
`
,
namedVariables
,
indexedVariables
);
}
}
...
...
@@ -821,7 +812,7 @@ export class Model implements debug.IModel {
}
public
addReplExpression
(
process
:
debug
.
IProcess
,
stackFrame
:
debug
.
IStackFrame
,
name
:
string
):
TPromise
<
void
>
{
const
expression
=
new
Expression
(
name
,
true
);
const
expression
=
new
Expression
(
name
);
this
.
addReplElements
([
expression
]);
return
expression
.
evaluate
(
process
,
stackFrame
,
'
repl
'
)
.
then
(()
=>
this
.
_onDidChangeREPLElements
.
fire
());
...
...
@@ -896,7 +887,7 @@ export class Model implements debug.IModel {
}
public
addWatchExpression
(
process
:
debug
.
IProcess
,
stackFrame
:
debug
.
IStackFrame
,
name
:
string
):
TPromise
<
void
>
{
const
we
=
new
Expression
(
name
,
false
);
const
we
=
new
Expression
(
name
);
this
.
watchExpressions
.
push
(
we
);
if
(
!
name
)
{
this
.
_onDidChangeWatchExpressions
.
fire
(
we
);
...
...
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
浏览文件 @
f62a5db2
...
...
@@ -160,7 +160,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
const
matchingExpression
=
lineContent
.
substring
(
expressionRange
.
startColumn
-
1
,
expressionRange
.
endColumn
);
let
promise
:
TPromise
<
debug
.
IExpression
>
;
if
(
process
.
session
.
configuration
.
capabilities
.
supportsEvaluateForHovers
)
{
const
result
=
new
Expression
(
matchingExpression
,
true
);
const
result
=
new
Expression
(
matchingExpression
);
promise
=
result
.
evaluate
(
process
,
focusedStackFrame
,
'
hover
'
).
then
(()
=>
result
);
}
else
{
promise
=
this
.
findExpressionInStackFrame
(
matchingExpression
.
split
(
'
.
'
).
map
(
word
=>
word
.
trim
()).
filter
(
word
=>
!!
word
));
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
f62a5db2
...
...
@@ -402,7 +402,7 @@ export class DebugService implements debug.IDebugService {
let
result
:
Expression
[];
try
{
result
=
JSON
.
parse
(
this
.
storageService
.
get
(
DEBUG_WATCH_EXPRESSIONS_KEY
,
StorageScope
.
WORKSPACE
,
'
[]
'
)).
map
((
watchStoredData
:
{
name
:
string
,
id
:
string
})
=>
{
return
new
Expression
(
watchStoredData
.
name
,
false
,
watchStoredData
.
id
);
return
new
Expression
(
watchStoredData
.
name
,
watchStoredData
.
id
);
});
}
catch
(
e
)
{
}
...
...
src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts
浏览文件 @
f62a5db2
...
...
@@ -34,7 +34,7 @@ suite('Debug - View Model', () => {
test
(
'
selected expression
'
,
()
=>
{
assert
.
equal
(
model
.
getSelectedExpression
(),
null
);
const
expression
=
new
Expression
(
'
my expression
'
,
false
);
const
expression
=
new
Expression
(
'
my expression
'
);
model
.
setSelectedExpression
(
expression
);
assert
.
equal
(
model
.
getSelectedExpression
(),
expression
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录