Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
6f3422a0
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,发现更多精彩内容 >>
提交
6f3422a0
编写于
1月 15, 2019
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
preserve type of file
上级
20b27991
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
26 deletion
+55
-26
src/vs/workbench/parts/debug/common/debugUtils.ts
src/vs/workbench/parts/debug/common/debugUtils.ts
+14
-3
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
...workbench/parts/debug/electron-browser/rawDebugSession.ts
+41
-23
未找到文件。
src/vs/workbench/parts/debug/common/debugUtils.ts
浏览文件 @
6f3422a0
...
...
@@ -134,6 +134,11 @@ export function convertToVSCPaths(message: DebugProtocol.ProtocolMessage, fixSou
}
function
convertPaths
(
msg
:
DebugProtocol
.
ProtocolMessage
,
fixSourcePaths
:
(
toDA
:
boolean
,
source
:
DebugProtocol
.
Source
|
undefined
)
=>
void
):
void
{
const
tmpSource
:
DebugProtocol
.
Source
=
{
path
:
''
};
switch
(
msg
.
type
)
{
case
'
event
'
:
const
event
=
<
DebugProtocol
.
Event
>
msg
;
...
...
@@ -164,9 +169,15 @@ function convertPaths(msg: DebugProtocol.ProtocolMessage, fixSourcePaths: (toDA:
fixSourcePaths
(
true
,
(
<
DebugProtocol
.
GotoTargetsArguments
>
request
.
arguments
).
source
);
break
;
case
'
launchVSCode
'
:
const
source
=
{
path
:
request
.
arguments
.
extensionDevelopmentPath
};
fixSourcePaths
(
false
,
source
);
request
.
arguments
.
extensionDevelopmentPath
=
source
.
path
;
tmpSource
.
path
=
request
.
arguments
.
extensionDevelopmentPath
;
fixSourcePaths
(
false
,
tmpSource
);
request
.
arguments
.
extensionDevelopmentPath
=
tmpSource
.
path
;
request
.
arguments
.
pathArgs
.
forEach
(
p
=>
{
tmpSource
.
path
=
p
.
path
;
fixSourcePaths
(
false
,
tmpSource
);
p
.
path
=
tmpSource
.
path
;
});
break
;
default
:
break
;
...
...
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
浏览文件 @
6f3422a0
...
...
@@ -17,13 +17,15 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment'
export
interface
ILaunchVSCodeArguments
{
sessionId
:
string
;
debugMode
:
'
noDebug
'
|
'
break
'
;
debugMode
:
'
noDebug
'
|
'
break
'
|
'
noBreak
'
;
debugPort
:
number
;
extensionDevelopmentPath
:
string
;
options
:
string
[];
args
:
string
[];
cwd
?:
string
;
env
:
{
[
key
:
string
]:
string
|
null
;
};
extensionDevelopmentPath
:
string
;
pathArgs
:
{
type
:
'
folder
'
|
'
file
'
;
path
:
string
;
}[];
env
?:
{
[
key
:
string
]:
string
|
null
;
};
}
/**
...
...
@@ -539,26 +541,30 @@ export class RawDebugSession {
private
launch
(
VSCodeArgs
:
ILaunchVSCodeArguments
):
Promise
<
void
>
{
let
envArgs
=
process
.
env
;
if
(
VSCodeArgs
.
env
)
{
// merge environment variables into a copy of the process.env
envArgs
=
objects
.
mixin
(
objects
.
mixin
({},
process
.
env
),
VSCodeArgs
.
env
);
// and delete some if necessary
Object
.
keys
(
envArgs
).
filter
(
k
=>
envArgs
[
k
]
===
null
).
forEach
(
key
=>
delete
envArgs
[
key
]);
}
const
spawnOpts
:
cp
.
SpawnOptions
=
{
env
:
envArgs
,
detached
:
false
// https://github.com/Microsoft/vscode/issues/57018
};
if
(
VSCodeArgs
.
cwd
)
{
spawnOpts
.
cwd
=
VSCodeArgs
.
cwd
;
if
(
VSCodeArgs
.
env
)
{
// merge environment variables into a copy of the process.env
const
envArgs
=
objects
.
mixin
(
objects
.
mixin
({},
process
.
env
),
VSCodeArgs
.
env
);
// and delete some if necessary
Object
.
keys
(
envArgs
).
filter
(
k
=>
envArgs
[
k
]
===
null
).
forEach
(
key
=>
delete
envArgs
[
key
]);
spawnOpts
.
env
=
envArgs
;
}
let
spawnArgs
=
[].
concat
(
VSCodeArgs
.
options
);
if
(
VSCodeArgs
.
debugMode
!==
'
noDebug
'
)
{
spawnArgs
.
push
(
`--debugBrkPluginHost=
${
VSCodeArgs
.
debugPort
}
`
);
switch
(
VSCodeArgs
.
debugMode
)
{
case
'
noDebug
'
:
break
;
case
'
break
'
:
spawnArgs
.
push
(
`--inspect-brk-extensions=
${
VSCodeArgs
.
debugPort
}
`
);
break
;
case
'
noBreak
'
:
spawnArgs
.
push
(
`--inspect-extensions=
${
VSCodeArgs
.
debugPort
}
`
);
break
;
}
// pass the debug session ID to the EH so that broadcast events know where they come from
...
...
@@ -575,19 +581,31 @@ export class RawDebugSession {
return
Promise
.
reject
(
new
Error
(
`VS Code executable unknown`
));
}
// if VS Code runs out of sources, add the
path to the VS Code workspace as a
first argument so that Electron turns into VS Code
// if VS Code runs out of sources, add the
VS Code workspace path as the
first argument so that Electron turns into VS Code
const
electronIdx
=
runtimeExecutable
.
indexOf
(
process
.
platform
===
'
win32
'
?
'
\\
.build
\\
electron
\\
'
:
'
/.build/electron/
'
);
if
(
electronIdx
>
0
&&
VSCodeArgs
.
args
.
length
>
0
)
{
// guess the VS Code workspace path
if
(
electronIdx
>
0
)
{
// guess the VS Code workspace path
from the executable
const
vscodeWorkspacePath
=
runtimeExecutable
.
substr
(
0
,
electronIdx
);
// only add path if user hasn't already added path
if
(
VSCodeArgs
.
args
.
length
===
0
||
VSCodeArgs
.
args
[
0
]
.
indexOf
(
vscodeWorkspacePath
)
!==
0
)
{
// only add path if user hasn't already added
that
path
if
(
VSCodeArgs
.
pathArgs
.
length
===
0
||
VSCodeArgs
.
pathArgs
[
0
].
path
.
indexOf
(
vscodeWorkspacePath
)
!==
0
)
{
spawnArgs
.
push
(
vscodeWorkspacePath
);
}
}
spawnArgs
=
spawnArgs
.
concat
(
VSCodeArgs
.
args
);
VSCodeArgs
.
pathArgs
.
forEach
(
p
=>
{
switch
(
p
.
type
)
{
case
'
file
'
:
spawnArgs
.
push
(
`--file-uri=
${
p
.
path
}
`
);
break
;
case
'
folder
'
:
spawnArgs
.
push
(
`--folder-uri=
${
p
.
path
}
`
);
break
;
default
:
spawnArgs
.
push
(
p
.
path
);
break
;
}
});
// Workaround for bug Microsoft/vscode#45832
if
(
process
.
platform
===
'
win32
'
&&
runtimeExecutable
.
indexOf
(
'
'
)
>
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录