Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
38531625
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 搜索 >>
未验证
提交
38531625
编写于
3月 14, 2018
作者:
I
Isidor Nikolic
提交者:
GitHub
3月 14, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #45731 from nojvek/inline-values
updateInlineDecorations when model content changes
上级
572079a2
aff222c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
13 deletion
+24
-13
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
...h/parts/debug/electron-browser/debugEditorContribution.ts
+24
-13
未找到文件。
src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts
浏览文件 @
38531625
...
...
@@ -45,7 +45,8 @@ import { ContextSubMenu } from 'vs/base/browser/contextmenu';
const
HOVER_DELAY
=
300
;
const
LAUNCH_JSON_REGEX
=
/launch
\.
json$/
;
const
REMOVE_INLINE_VALUES_DELAY
=
100
;
const
UPDATE_INLINE_VALUE_DECORATIONS_DELAY
=
200
;
const
REMOVE_INLINE_VALUE_DECORATIONS_DELAY
=
100
;
const
INLINE_VALUE_DECORATION_KEY
=
'
inlinevaluedecoration
'
;
const
MAX_NUM_INLINE_VALUES
=
100
;
// JS Global scope can have 700+ entries. We want to limit ourselves for perf reasons
const
MAX_INLINE_DECORATOR_LENGTH
=
150
;
// Max string length of each inline decorator when debugging. If exceeded ... is added
...
...
@@ -57,7 +58,8 @@ export class DebugEditorContribution implements IDebugEditorContribution {
private
hoverWidget
:
DebugHoverWidget
;
private
showHoverScheduler
:
RunOnceScheduler
;
private
hideHoverScheduler
:
RunOnceScheduler
;
private
removeInlineValuesScheduler
:
RunOnceScheduler
;
private
updateInlineValueDecorationsScheduler
:
RunOnceScheduler
;
private
removeInlineValueDecorationsScheduler
:
RunOnceScheduler
;
private
hoverRange
:
Range
;
private
breakpointHintDecoration
:
string
[];
...
...
@@ -87,7 +89,17 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this
.
toDispose
=
[];
this
.
showHoverScheduler
=
new
RunOnceScheduler
(()
=>
this
.
showHover
(
this
.
hoverRange
,
false
),
HOVER_DELAY
);
this
.
hideHoverScheduler
=
new
RunOnceScheduler
(()
=>
this
.
hoverWidget
.
hide
(),
HOVER_DELAY
);
this
.
removeInlineValuesScheduler
=
new
RunOnceScheduler
(()
=>
this
.
editor
.
removeDecorations
(
INLINE_VALUE_DECORATION_KEY
),
REMOVE_INLINE_VALUES_DELAY
);
this
.
updateInlineValueDecorationsScheduler
=
new
RunOnceScheduler
(
()
=>
{
this
.
wordToLineNumbersMap
=
null
;
this
.
updateInlineValueDecorations
(
this
.
debugService
.
getViewModel
().
focusedStackFrame
);
},
UPDATE_INLINE_VALUE_DECORATIONS_DELAY
);
this
.
removeInlineValueDecorationsScheduler
=
new
RunOnceScheduler
(
()
=>
this
.
editor
.
removeDecorations
(
INLINE_VALUE_DECORATION_KEY
),
REMOVE_INLINE_VALUE_DECORATIONS_DELAY
);
this
.
registerListeners
();
this
.
breakpointWidgetVisible
=
CONTEXT_BREAKPOINT_WIDGET_VISIBLE
.
bindTo
(
contextKeyService
);
this
.
updateConfigurationWidgetVisibility
();
...
...
@@ -214,18 +226,17 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}));
this
.
toDispose
.
push
(
this
.
editor
.
onKeyDown
((
e
:
IKeyboardEvent
)
=>
this
.
onKeyDown
(
e
)));
this
.
toDispose
.
push
(
this
.
editor
.
onDidChangeModelContent
(()
=>
{
this
.
wordToLineNumbersMap
=
null
;
this
.
updateInlineValueDecorationsScheduler
.
schedule
()
;
}));
this
.
toDispose
.
push
(
this
.
editor
.
onDidChangeModel
(()
=>
{
const
s
f
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
s
tackFrame
=
this
.
debugService
.
getViewModel
().
focusedStackFrame
;
const
model
=
this
.
editor
.
getModel
();
this
.
editor
.
updateOptions
({
hover
:
!
s
f
||
!
model
||
model
.
uri
.
toString
()
!==
sf
.
source
.
uri
.
toString
()
});
this
.
editor
.
updateOptions
({
hover
:
!
s
tackFrame
||
!
model
||
model
.
uri
.
toString
()
!==
stackFrame
.
source
.
uri
.
toString
()
});
this
.
closeBreakpointWidget
();
this
.
toggleExceptionWidget
();
this
.
hideHoverWidget
();
this
.
updateConfigurationWidgetVisibility
();
this
.
wordToLineNumbersMap
=
null
;
this
.
updateInlineDecorations
(
sf
);
this
.
updateInlineValueDecorationsScheduler
.
schedule
();
}));
this
.
toDispose
.
push
(
this
.
editor
.
onDidScrollChange
(()
=>
this
.
hideHoverWidget
));
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
((
state
:
State
)
=>
{
...
...
@@ -288,7 +299,7 @@ export class DebugEditorContribution implements IDebugEditorContribution {
this
.
hideHoverWidget
();
}
this
.
updateInlineDecorations
(
sf
);
this
.
updateInline
Value
Decorations
(
sf
);
}
private
hideHoverWidget
():
void
{
...
...
@@ -474,17 +485,17 @@ export class DebugEditorContribution implements IDebugEditorContribution {
};
// Inline Decorations
private
updateInlineDecorations
(
stackFrame
:
IStackFrame
):
void
{
private
updateInline
Value
Decorations
(
stackFrame
:
IStackFrame
):
void
{
const
model
=
this
.
editor
.
getModel
();
if
(
!
this
.
configurationService
.
getValue
<
IDebugConfiguration
>
(
'
debug
'
).
inlineValues
||
!
model
||
!
stackFrame
||
model
.
uri
.
toString
()
!==
stackFrame
.
source
.
uri
.
toString
())
{
if
(
!
this
.
removeInlineValuesScheduler
.
isScheduled
())
{
this
.
removeInlineValuesScheduler
.
schedule
();
if
(
!
this
.
removeInlineValue
Decoration
sScheduler
.
isScheduled
())
{
this
.
removeInlineValue
Decoration
sScheduler
.
schedule
();
}
return
;
}
this
.
removeInlineValuesScheduler
.
cancel
();
this
.
removeInlineValue
Decoration
sScheduler
.
cancel
();
stackFrame
.
getMostSpecificScopes
(
stackFrame
.
range
)
// Get all top level children in the scope chain
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录