Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
ef6b3de1
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,体验更适合开发者的 AI 搜索 >>
提交
ef6b3de1
编写于
1月 17, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
inlineValues: respect stackFrame lineNumber and column
上级
812472eb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
18 deletion
+26
-18
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+26
-18
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
ef6b3de1
...
@@ -56,7 +56,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
...
@@ -56,7 +56,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
breakpointHintDecoration
:
string
[];
private
breakpointHintDecoration
:
string
[];
private
breakpointWidget
:
BreakpointWidget
;
private
breakpointWidget
:
BreakpointWidget
;
private
breakpointWidgetVisible
:
IContextKey
<
boolean
>
;
private
breakpointWidgetVisible
:
IContextKey
<
boolean
>
;
private
wordToLineNumbersMap
:
Map
<
string
,
number
[]
>
;
private
wordToLineNumbersMap
:
Map
<
string
,
IPosition
[]
>
;
private
configurationWidget
:
FloatingClickWidget
;
private
configurationWidget
:
FloatingClickWidget
;
...
@@ -361,15 +361,21 @@ export class DebugEditorContribution implements IDebugEditorContribution {
...
@@ -361,15 +361,21 @@ export class DebugEditorContribution implements IDebugEditorContribution {
stackFrame
.
getScopes
()
stackFrame
.
getScopes
()
// Get all top level children in the scope chain
// Get all top level children in the scope chain
.
then
(
scopes
=>
TPromise
.
join
(
scopes
.
map
(
scope
=>
scope
.
getChildren
())))
.
then
(
scopes
=>
TPromise
.
join
(
scopes
.
filter
(
s
=>
!
s
.
expensive
).
map
(
scope
=>
scope
.
getChildren
()
.
then
(
children
=>
{
.
then
(
children
=>
{
const
expressions
=
children
.
reduce
((
previous
,
current
)
=>
previous
.
concat
(
current
),
[]);
let
range
=
new
Range
(
0
,
0
,
stackFrame
.
lineNumber
,
stackFrame
.
column
);
const
decorations
=
this
.
createAllInlineValueDecorations
(
expressions
);
if
(
scope
.
range
)
{
this
.
editor
.
setDecorations
(
INLINE_VALUE_DECORATION_KEY
,
decorations
);
range
=
range
.
setStartPosition
(
scope
.
range
.
startLineNumber
,
scope
.
range
.
startColumn
);
});
}
return
this
.
createInlineValueDecorationsInsideRange
(
children
,
range
);
}))).
then
(
decorationsPerScope
=>
{
const
allDecorations
=
decorationsPerScope
.
reduce
((
previous
,
current
)
=>
previous
.
concat
(
current
),
[]);
this
.
editor
.
setDecorations
(
INLINE_VALUE_DECORATION_KEY
,
allDecorations
);
}));
}
}
private
create
AllInlineValueDecorations
(
expressions
:
IExpression
[]
):
IDecorationOptions
[]
{
private
create
InlineValueDecorationsInsideRange
(
expressions
:
IExpression
[],
range
:
Range
):
IDecorationOptions
[]
{
const
nameValueMap
=
new
Map
<
string
,
string
>
();
const
nameValueMap
=
new
Map
<
string
,
string
>
();
for
(
let
expr
of
expressions
)
{
for
(
let
expr
of
expressions
)
{
nameValueMap
.
set
(
expr
.
name
,
expr
.
value
);
nameValueMap
.
set
(
expr
.
name
,
expr
.
value
);
...
@@ -380,17 +386,19 @@ export class DebugEditorContribution implements IDebugEditorContribution {
...
@@ -380,17 +386,19 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}
}
const
lineToNamesMap
:
Map
<
number
,
string
[]
>
=
new
Map
<
number
,
string
[]
>
();
const
lineToNamesMap
:
Map
<
number
,
string
[]
>
=
new
Map
<
number
,
string
[]
>
();
const
wordTo
LineNumbersMap
=
this
.
getWordToLineNumber
sMap
();
const
wordTo
PositionsMap
=
this
.
getWordToPosition
sMap
();
// Compute unique set of names on each line
// Compute unique set of names on each line
nameValueMap
.
forEach
((
value
,
name
)
=>
{
nameValueMap
.
forEach
((
value
,
name
)
=>
{
if
(
wordToLineNumbersMap
.
has
(
name
))
{
if
(
wordToPositionsMap
.
has
(
name
))
{
for
(
let
lineNumber
of
wordToLineNumbersMap
.
get
(
name
))
{
for
(
let
position
of
wordToPositionsMap
.
get
(
name
))
{
if
(
!
lineToNamesMap
.
has
(
lineNumber
))
{
if
(
range
.
containsPosition
(
position
))
{
lineToNamesMap
.
set
(
lineNumber
,
[]);
if
(
!
lineToNamesMap
.
has
(
position
.
lineNumber
))
{
}
lineToNamesMap
.
set
(
position
.
lineNumber
,
[]);
}
lineToNamesMap
.
get
(
lineNumber
).
push
(
name
);
lineToNamesMap
.
get
(
position
.
lineNumber
).
push
(
name
);
}
}
}
}
}
});
});
...
@@ -439,9 +447,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
...
@@ -439,9 +447,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
};
};
}
}
private
getWordTo
LineNumbersMap
():
Map
<
string
,
number
[]
>
{
private
getWordTo
PositionsMap
():
Map
<
string
,
IPosition
[]
>
{
if
(
!
this
.
wordToLineNumbersMap
)
{
if
(
!
this
.
wordToLineNumbersMap
)
{
this
.
wordToLineNumbersMap
=
new
Map
<
string
,
number
[]
>
();
this
.
wordToLineNumbersMap
=
new
Map
<
string
,
IPosition
[]
>
();
const
model
=
this
.
editor
.
getModel
();
const
model
=
this
.
editor
.
getModel
();
// For every word in every line, map its ranges for fast lookup
// For every word in every line, map its ranges for fast lookup
for
(
let
lineNumber
=
1
,
len
=
model
.
getLineCount
();
lineNumber
<=
len
;
++
lineNumber
)
{
for
(
let
lineNumber
=
1
,
len
=
model
.
getLineCount
();
lineNumber
<=
len
;
++
lineNumber
)
{
...
@@ -467,7 +475,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
...
@@ -467,7 +475,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this
.
wordToLineNumbersMap
.
set
(
word
,
[]);
this
.
wordToLineNumbersMap
.
set
(
word
,
[]);
}
}
this
.
wordToLineNumbersMap
.
get
(
word
).
push
(
lineNumber
);
this
.
wordToLineNumbersMap
.
get
(
word
).
push
(
{
lineNumber
,
column
:
token
.
startOffset
}
);
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录