Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8572552e
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,发现更多精彩内容 >>
提交
8572552e
编写于
11月 06, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: use ids to manage breakpoint decorations, not their line number
fixes #37694
上级
c13006fe
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
6 addition
and
13 deletion
+6
-13
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+6
-13
未找到文件。
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
8572552e
...
...
@@ -19,7 +19,7 @@ interface IDebugEditorModelData {
model
:
IModel
;
toDispose
:
lifecycle
.
IDisposable
[];
breakpointDecorationIds
:
string
[];
breakpoint
Lines
:
number
[];
breakpoint
ModelIds
:
string
[];
breakpointDecorationsAsMap
:
Map
<
string
,
Range
>
;
currentStackDecorations
:
string
[];
dirty
:
boolean
;
...
...
@@ -91,7 +91,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
model
:
model
,
toDispose
:
toDispose
,
breakpointDecorationIds
:
breakPointDecorations
,
breakpoint
Lines
:
breakpoints
.
map
(
bp
=>
bp
.
lineNumber
),
breakpoint
ModelIds
:
breakpoints
.
map
(
bp
=>
bp
.
getId
()
),
breakpointDecorationsAsMap
,
currentStackDecorations
:
currentStackDecorations
,
dirty
:
false
,
...
...
@@ -208,20 +208,13 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
const
data
:
IRawBreakpoint
[]
=
[];
const
lineToBreakpointDataMap
=
new
Map
<
number
,
IBreakpoint
>
();
this
.
debugService
.
getModel
().
getBreakpoints
().
forEach
(
bp
=>
{
if
(
bp
.
uri
.
toString
()
===
modelUrlStr
)
{
lineToBreakpointDataMap
.
set
(
bp
.
lineNumber
,
bp
);
}
});
const
breakpoints
=
this
.
debugService
.
getModel
().
getBreakpoints
();
const
modelUri
=
modelData
.
model
.
uri
;
for
(
let
i
=
0
,
len
=
modelData
.
breakpointDecorationIds
.
length
;
i
<
len
;
i
++
)
{
const
decorationRange
=
modelData
.
model
.
getDecorationRange
(
modelData
.
breakpointDecorationIds
[
i
]);
const
lineNumber
=
modelData
.
breakpointLines
[
i
];
// check if the line got deleted.
if
(
decorationRange
.
endColumn
-
decorationRange
.
startColumn
>
0
)
{
const
breakpoint
=
lineToBreakpointDataMap
.
get
(
lineNumber
);
if
(
decorationRange
&&
decorationRange
.
endColumn
-
decorationRange
.
startColumn
>
0
)
{
const
breakpoint
=
breakpoints
.
filter
(
bp
=>
bp
.
getId
()
===
modelData
.
breakpointModelIds
[
i
]).
pop
(
);
// since we know it is collapsed, it cannot grow to multiple lines
if
(
breakpoint
)
{
data
.
push
({
...
...
@@ -270,9 +263,9 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
private
updateBreakpoints
(
modelData
:
IDebugEditorModelData
,
newBreakpoints
:
IBreakpoint
[]):
void
{
const
desiredDecorations
=
this
.
createBreakpointDecorations
(
modelData
.
model
,
newBreakpoints
);
modelData
.
breakpointDecorationIds
=
modelData
.
model
.
deltaDecorations
(
modelData
.
breakpointDecorationIds
,
desiredDecorations
);
modelData
.
breakpointModelIds
=
newBreakpoints
.
map
(
nbp
=>
nbp
.
getId
());
modelData
.
breakpointDecorationsAsMap
.
clear
();
modelData
.
breakpointDecorationIds
.
forEach
((
decorationId
,
index
)
=>
modelData
.
breakpointDecorationsAsMap
.
set
(
decorationId
,
desiredDecorations
[
index
].
range
));
modelData
.
breakpointLines
=
newBreakpoints
.
map
(
bp
=>
bp
.
lineNumber
);
}
private
createBreakpointDecorations
(
model
:
IModel
,
breakpoints
:
IBreakpoint
[]):
{
range
:
Range
;
options
:
IModelDecorationOptions
;
}[]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录