Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
3ae62a8d
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,发现更多精彩内容 >>
提交
3ae62a8d
编写于
3月 07, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: introduce map for sources, remove reference from source uri in workbench
上级
3338bf2f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
13 addition
and
27 deletion
+13
-27
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
+4
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-0
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+5
-1
src/vs/workbench/parts/debug/common/debugSource.ts
src/vs/workbench/parts/debug/common/debugSource.ts
+1
-9
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+2
-13
src/vs/workbench/parts/debug/test/common/debugSource.test.ts
src/vs/workbench/parts/debug/test/common/debugSource.test.ts
+0
-2
未找到文件。
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
浏览文件 @
3ae62a8d
...
...
@@ -5,6 +5,7 @@
import
*
as
lifecycle
from
'
vs/base/common/lifecycle
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
*
as
paths
from
'
vs/base/common/paths
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
guessMimeTypes
,
MIME_TEXT
}
from
'
vs/base/common/mime
'
;
...
...
@@ -14,7 +15,6 @@ import { IModeService } from 'vs/editor/common/services/modeService';
import
{
ITextModelResolverService
,
ITextModelContentProvider
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
DEBUG_SCHEME
,
IDebugService
,
State
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
Source
}
from
'
vs/workbench/parts/debug/common/debugSource
'
;
export
class
DebugContentProvider
implements
IWorkbenchContribution
,
ITextModelContentProvider
{
...
...
@@ -45,8 +45,10 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC
if
(
!
process
)
{
return
TPromise
.
wrapError
(
localize
(
'
unable
'
,
"
Unable to resolve the resource without a debug session
"
));
}
const
source
=
process
.
sources
.
get
(
resource
);
const
rawSource
=
source
?
source
.
raw
:
{
path
:
paths
.
normalize
(
resource
.
fsPath
,
true
)
};
return
process
.
session
.
source
({
sourceReference
:
Source
.
getSourceReference
(
resource
)
}).
then
(
response
=>
{
return
process
.
session
.
source
({
sourceReference
:
source
?
source
.
reference
:
undefined
,
source
:
rawSource
}).
then
(
response
=>
{
const
mime
=
response
.
body
.
mimeType
||
guessMimeTypes
(
resource
.
toString
())[
0
];
const
modePromise
=
this
.
modeService
.
getOrCreateMode
(
mime
);
const
model
=
this
.
modelService
.
createModel
(
response
.
body
.
content
,
modePromise
,
resource
);
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
3ae62a8d
...
...
@@ -102,6 +102,7 @@ export interface IProcess extends ITreeElement {
name
:
string
;
configuration
:
IConfig
;
session
:
ISession
;
sources
:
Map
<
uri
,
Source
>
;
isAttach
():
boolean
;
getThread
(
threadId
:
number
):
IThread
;
getAllThreads
():
IThread
[];
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
3ae62a8d
...
...
@@ -448,8 +448,10 @@ export class Thread implements debug.IThread {
if
(
!
rsf
)
{
return
new
StackFrame
(
this
,
0
,
new
Source
({
name
:
UNKNOWN_SOURCE_LABEL
},
true
),
nls
.
localize
(
'
unknownStack
'
,
"
Unknown stack location
"
),
null
,
null
);
}
const
source
=
rsf
.
source
?
new
Source
(
rsf
.
source
,
rsf
.
source
.
presentationHint
===
'
deemphasize
'
)
:
new
Source
({
name
:
UNKNOWN_SOURCE_LABEL
},
true
);
this
.
process
.
sources
.
set
(
source
.
uri
,
source
);
return
new
StackFrame
(
this
,
rsf
.
id
,
rsf
.
source
?
new
Source
(
rsf
.
source
,
rsf
.
source
.
presentationHint
===
'
deemphasize
'
)
:
new
Source
({
name
:
UNKNOWN_SOURCE_LABEL
},
true
)
,
rsf
.
name
,
rsf
.
line
,
rsf
.
column
);
return
new
StackFrame
(
this
,
rsf
.
id
,
source
,
rsf
.
name
,
rsf
.
line
,
rsf
.
column
);
});
},
(
err
:
Error
)
=>
{
if
(
this
.
stoppedDetails
)
{
...
...
@@ -492,9 +494,11 @@ export class Thread implements debug.IThread {
export
class
Process
implements
debug
.
IProcess
{
private
threads
:
Map
<
number
,
Thread
>
;
public
sources
:
Map
<
uri
,
Source
>
;
constructor
(
public
configuration
:
debug
.
IConfig
,
private
_session
:
debug
.
ISession
&
debug
.
ITreeElement
)
{
this
.
threads
=
new
Map
<
number
,
Thread
>
();
this
.
sources
=
new
Map
<
uri
,
Source
>
();
}
public
get
session
():
debug
.
ISession
{
...
...
src/vs/workbench/parts/debug/common/debugSource.ts
浏览文件 @
3ae62a8d
...
...
@@ -12,7 +12,7 @@ export class Source {
constructor
(
public
raw
:
DebugProtocol
.
Source
,
public
deemphasize
:
boolean
)
{
const
path
=
raw
.
path
||
raw
.
name
;
this
.
uri
=
raw
.
sourceReference
>
0
?
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:
${
path
}
?ref=
${
raw
.
sourceReference
}
`
)
:
uri
.
file
(
path
);
this
.
uri
=
raw
.
sourceReference
>
0
?
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:
${
path
}
`
)
:
uri
.
file
(
path
);
}
public
get
name
()
{
...
...
@@ -34,12 +34,4 @@ export class Source {
public
static
isInMemory
(
uri
:
uri
):
boolean
{
return
uri
.
toString
().
indexOf
(
`
${
DEBUG_SCHEME
}
:`
)
===
0
;
}
public
static
getSourceReference
(
uri
:
uri
):
number
{
if
(
!
Source
.
isInMemory
(
uri
))
{
return
0
;
}
return
parseInt
(
uri
.
query
.
substr
(
'
ref=
'
.
length
));
}
}
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
3ae62a8d
...
...
@@ -945,19 +945,8 @@ export class DebugService implements debug.IDebugService {
const
breakpointsToSend
=
distinct
(
this
.
model
.
getBreakpoints
().
filter
(
bp
=>
this
.
model
.
areBreakpointsActivated
()
&&
bp
.
enabled
&&
bp
.
uri
.
toString
()
===
modelUri
.
toString
()),
bp
=>
bp
.
lineNumber
.
toString
());
let
rawSource
:
DebugProtocol
.
Source
;
for
(
let
t
of
process
.
getAllThreads
())
{
const
callStack
=
t
.
getCallStack
();
if
(
callStack
)
{
for
(
let
sf
of
callStack
)
{
if
(
sf
.
source
.
uri
.
toString
()
===
modelUri
.
toString
())
{
rawSource
=
sf
.
source
.
raw
;
break
;
}
}
}
}
rawSource
=
rawSource
||
{
path
:
paths
.
normalize
(
modelUri
.
fsPath
,
true
),
name
:
paths
.
basename
(
modelUri
.
fsPath
)
};
const
source
=
process
.
sources
.
get
(
modelUri
);
const
rawSource
=
source
?
source
.
raw
:
{
path
:
paths
.
normalize
(
modelUri
.
fsPath
,
true
)
};
return
session
.
setBreakpoints
({
source
:
rawSource
,
...
...
src/vs/workbench/parts/debug/test/common/debugSource.test.ts
浏览文件 @
3ae62a8d
...
...
@@ -22,7 +22,6 @@ suite('Debug - Source', () => {
assert
.
equal
(
source
.
inMemory
,
false
);
assert
.
equal
(
source
.
reference
,
rawSource
.
sourceReference
);
assert
.
equal
(
source
.
uri
.
toString
(),
uri
.
file
(
rawSource
.
path
).
toString
());
assert
.
equal
(
Source
.
getSourceReference
(
source
.
uri
),
0
);
});
test
(
'
from raw internal source
'
,
()
=>
{
...
...
@@ -36,6 +35,5 @@ suite('Debug - Source', () => {
assert
.
equal
(
source
.
name
,
rawSource
.
name
);
assert
.
equal
(
source
.
inMemory
,
true
);
assert
.
equal
(
source
.
reference
,
rawSource
.
sourceReference
);
assert
.
equal
(
Source
.
getSourceReference
(
source
.
uri
),
11
);
});
});
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录