Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cef0992f
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 搜索 >>
提交
cef0992f
编写于
10月 18, 2018
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
use debug uri for relative paths; better fix for #61088
上级
994eaadc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
10 deletion
+15
-10
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
+10
-6
src/vs/workbench/parts/debug/common/debugSource.ts
src/vs/workbench/parts/debug/common/debugSource.ts
+5
-4
未找到文件。
src/vs/workbench/parts/debug/browser/debugContentProvider.ts
浏览文件 @
cef0992f
...
...
@@ -56,20 +56,24 @@ export class DebugContentProvider implements IWorkbenchContribution, ITextModelC
if
(
!
session
)
{
return
Promise
.
reject
(
new
Error
(
localize
(
'
unable
'
,
"
Unable to resolve the resource without a debug session
"
)));
}
const
createErrModel
=
(
message
:
string
)
=>
{
const
createErrModel
=
(
errMsg
?
:
string
)
=>
{
this
.
debugService
.
sourceIsNotAvailable
(
resource
);
const
modePromise
=
this
.
modeService
.
getOrCreateMode
(
MIME_TEXT
);
const
message
=
errMsg
?
localize
(
'
canNotResolveSourceWithError
'
,
"
Could not load source '{0}': {1}.
"
,
resource
.
path
,
errMsg
)
:
localize
(
'
canNotResolveSource
'
,
"
Could not load source '{0}'.
"
,
resource
.
path
);
return
this
.
modelService
.
createModel
(
message
,
modePromise
,
resource
);
};
return
session
.
loadSource
(
resource
).
then
(
response
=>
{
if
(
!
response
)
{
return
createErrModel
(
localize
(
'
canNotResolveSource
'
,
"
Could not resolve resource {0}, no response from debug extension.
"
,
resource
.
toString
()));
if
(
response
&&
response
.
body
)
{
const
mime
=
response
.
body
.
mimeType
||
guessMimeTypes
(
resource
.
path
)[
0
];
const
modePromise
=
this
.
modeService
.
getOrCreateMode
(
mime
);
return
this
.
modelService
.
createModel
(
response
.
body
.
content
,
modePromise
,
resource
);
}
const
mime
=
response
.
body
.
mimeType
||
guessMimeTypes
(
resource
.
path
)[
0
];
const
modePromise
=
this
.
modeService
.
getOrCreateMode
(
mime
);
return
this
.
modelService
.
createModel
(
response
.
body
.
content
,
modePromise
,
resource
);
return
createErrModel
();
},
(
err
:
DebugProtocol
.
ErrorResponse
)
=>
createErrModel
(
err
.
message
));
}
...
...
src/vs/workbench/parts/debug/common/debugSource.ts
浏览文件 @
cef0992f
...
...
@@ -49,15 +49,16 @@ export class Source {
if
(
this
.
raw
.
sourceReference
>
0
)
{
this
.
uri
=
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:
${
encodeURIComponent
(
path
)}
?session=
${
encodeURIComponent
(
sessionId
)}
&ref=
${
this
.
raw
.
sourceReference
}
`
);
}
else
{
if
(
isUri
(
path
))
{
if
(
isUri
(
path
))
{
// path looks like a uri
this
.
uri
=
uri
.
parse
(
path
);
}
else
{
// assume path
// assume
a filesystem
path
if
(
paths
.
isAbsolute_posix
(
path
)
||
paths
.
isAbsolute_win32
(
path
))
{
this
.
uri
=
uri
.
file
(
path
);
}
else
{
// path is relative: this is not supported but if it happens we create a bogus uri for backward compatibility
this
.
uri
=
uri
.
file
(
path
);
// path is relative: since VS Code cannot deal with this by itself
// create a debug url that will result in a DAP 'source' request when the url is resolved.
this
.
uri
=
uri
.
parse
(
`
${
DEBUG_SCHEME
}
:
${
encodeURIComponent
(
path
)}
?session=
${
encodeURIComponent
(
sessionId
)}
`
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录