Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
0f731a79
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0f731a79
编写于
7月 18, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pass on --debugId from extension host to debug
fixes #30698
上级
ed98fcab
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
40 addition
and
31 deletion
+40
-31
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+1
-0
src/vs/code/electron-main/windows.ts
src/vs/code/electron-main/windows.ts
+1
-0
src/vs/platform/environment/common/environment.ts
src/vs/platform/environment/common/environment.ts
+3
-1
src/vs/platform/environment/node/argv.ts
src/vs/platform/environment/node/argv.ts
+1
-0
src/vs/platform/environment/node/environmentService.ts
src/vs/platform/environment/node/environmentService.ts
+3
-3
src/vs/platform/environment/test/node/environmentService.test.ts
...platform/environment/test/node/environmentService.test.ts
+12
-12
src/vs/workbench/electron-browser/extensionHost.ts
src/vs/workbench/electron-browser/extensionHost.ts
+11
-3
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-0
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+7
-12
未找到文件。
src/vs/code/electron-main/window.ts
浏览文件 @
0f731a79
...
...
@@ -518,6 +518,7 @@ export class CodeWindow implements ICodeWindow {
configuration
.
verbose
=
cli
.
verbose
;
configuration
.
debugPluginHost
=
cli
.
debugPluginHost
;
configuration
.
debugBrkPluginHost
=
cli
.
debugBrkPluginHost
;
configuration
.
debugId
=
cli
.
debugId
;
configuration
[
'
extensions-dir
'
]
=
cli
[
'
extensions-dir
'
];
}
...
...
src/vs/code/electron-main/windows.ts
浏览文件 @
0f731a79
...
...
@@ -1007,6 +1007,7 @@ export class WindowsManager implements IWindowsMainService {
configuration
.
extensionDevelopmentPath
=
currentWindowConfig
.
extensionDevelopmentPath
;
configuration
.
verbose
=
currentWindowConfig
.
verbose
;
configuration
.
debugBrkPluginHost
=
currentWindowConfig
.
debugBrkPluginHost
;
configuration
.
debugId
=
currentWindowConfig
.
debugId
;
configuration
.
debugPluginHost
=
currentWindowConfig
.
debugPluginHost
;
configuration
[
'
extensions-dir
'
]
=
currentWindowConfig
[
'
extensions-dir
'
];
}
...
...
src/vs/platform/environment/common/environment.ts
浏览文件 @
0f731a79
...
...
@@ -31,6 +31,7 @@ export interface ParsedArgs {
extensionDevelopmentPath
?:
string
;
extensionTestsPath
?:
string
;
debugBrkPluginHost
?:
string
;
debugId
?:
string
;
debugPluginHost
?:
string
;
'
list-extensions
'
?:
boolean
;
'
show-versions
'
?:
boolean
;
...
...
@@ -71,7 +72,8 @@ export interface IEnvironmentService {
extensionDevelopmentPath
:
string
;
extensionTestsPath
:
string
;
debugExtensionHost
:
{
port
:
number
;
break
:
boolean
;
};
debugExtensionHost
:
{
port
:
number
;
break
:
boolean
;
debugId
:
string
};
logExtensionHostCommunication
:
boolean
;
...
...
src/vs/platform/environment/node/argv.ts
浏览文件 @
0f731a79
...
...
@@ -20,6 +20,7 @@ const options: minimist.Opts = {
'
install-extension
'
,
'
uninstall-extension
'
,
'
debugBrkPluginHost
'
,
'
debugId
'
,
'
debugPluginHost
'
,
'
open-url
'
,
'
enable-proposed-api
'
...
...
src/vs/platform/environment/node/environmentService.ts
浏览文件 @
0f731a79
...
...
@@ -109,7 +109,7 @@ export class EnvironmentService implements IEnvironmentService {
get
skipGettingStarted
():
boolean
{
return
this
.
_args
[
'
skip-getting-started
'
];
}
@
memoize
get
debugExtensionHost
():
{
port
:
number
;
break
:
boolean
;
}
{
return
parseExtensionHostPort
(
this
.
_args
,
this
.
isBuilt
);
}
get
debugExtensionHost
():
{
port
:
number
;
break
:
boolean
;
debugId
:
string
}
{
return
parseExtensionHostPort
(
this
.
_args
,
this
.
isBuilt
);
}
get
isBuilt
():
boolean
{
return
!
process
.
env
[
'
VSCODE_DEV
'
];
}
get
verbose
():
boolean
{
return
this
.
_args
.
verbose
;
}
...
...
@@ -142,11 +142,11 @@ export class EnvironmentService implements IEnvironmentService {
constructor
(
private
_args
:
ParsedArgs
,
private
_execPath
:
string
)
{
}
}
export
function
parseExtensionHostPort
(
args
:
ParsedArgs
,
isBuild
:
boolean
):
{
port
:
number
;
break
:
boolean
;
}
{
export
function
parseExtensionHostPort
(
args
:
ParsedArgs
,
isBuild
:
boolean
):
{
port
:
number
;
break
:
boolean
;
debugId
:
string
}
{
const
portStr
=
args
.
debugBrkPluginHost
||
args
.
debugPluginHost
;
const
port
=
Number
(
portStr
)
||
(
!
isBuild
?
5870
:
null
);
const
brk
=
port
?
Boolean
(
!!
args
.
debugBrkPluginHost
)
:
false
;
return
{
port
,
break
:
brk
};
return
{
port
,
break
:
brk
,
debugId
:
args
.
debugId
};
}
function
parsePathArg
(
arg
:
string
,
process
:
NodeJS
.
Process
):
string
{
...
...
src/vs/platform/environment/test/node/environmentService.test.ts
浏览文件 @
0f731a79
...
...
@@ -14,23 +14,23 @@ suite('EnvironmentService', () => {
test
(
'
parseExtensionHostPort when built
'
,
()
=>
{
const
parse
=
a
=>
parseExtensionHostPort
(
parseArgs
(
a
),
true
);
assert
.
deepEqual
(
parse
([]),
{
port
:
null
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost
'
]),
{
port
:
null
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
]),
{
port
:
1234
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost
'
]),
{
port
:
null
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
,
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
});
assert
.
deepEqual
(
parse
([]),
{
port
:
null
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost
'
]),
{
port
:
null
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
]),
{
port
:
1234
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost
'
]),
{
port
:
null
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
,
'
--debugBrkPluginHost=5678
'
,
'
--debugId=7
'
]),
{
port
:
5678
,
break
:
true
,
debugId
:
'
7
'
});
});
test
(
'
parseExtensionHostPort when unbuilt
'
,
()
=>
{
const
parse
=
a
=>
parseExtensionHostPort
(
parseArgs
(
a
),
false
);
assert
.
deepEqual
(
parse
([]),
{
port
:
5870
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost
'
]),
{
port
:
5870
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
]),
{
port
:
1234
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost
'
]),
{
port
:
5870
,
break
:
false
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
,
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
});
assert
.
deepEqual
(
parse
([]),
{
port
:
5870
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost
'
]),
{
port
:
5870
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
]),
{
port
:
1234
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost
'
]),
{
port
:
5870
,
break
:
false
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugBrkPluginHost=5678
'
]),
{
port
:
5678
,
break
:
true
,
debugId
:
undefined
});
assert
.
deepEqual
(
parse
([
'
--debugPluginHost=1234
'
,
'
--debugBrkPluginHost=5678
'
,
'
--debugId=7
'
]),
{
port
:
5678
,
break
:
true
,
debugId
:
'
7
'
});
});
test
(
'
userDataPath
'
,
()
=>
{
...
...
src/vs/workbench/electron-browser/extensionHost.ts
浏览文件 @
0f731a79
...
...
@@ -202,7 +202,10 @@ export class ExtensionHostProcessWorker {
if
(
this
.
isExtensionDevelopmentHost
&&
port
)
{
this
.
broadcastService
.
broadcast
({
channel
:
EXTENSION_ATTACH_BROADCAST_CHANNEL
,
payload
:
{
port
}
payload
:
{
debugId
:
this
.
environmentService
.
debugExtensionHost
.
debugId
,
port
}
});
}
...
...
@@ -344,7 +347,10 @@ export class ExtensionHostProcessWorker {
else
if
(
!
this
.
environmentService
.
isBuilt
||
this
.
isExtensionDevelopmentHost
)
{
this
.
broadcastService
.
broadcast
({
channel
:
EXTENSION_LOG_BROADCAST_CHANNEL
,
payload
:
logEntry
payload
:
{
logEntry
,
debugId
:
this
.
environmentService
.
debugExtensionHost
.
debugId
}
});
}
}
...
...
@@ -411,7 +417,9 @@ export class ExtensionHostProcessWorker {
if
(
this
.
isExtensionDevelopmentHost
&&
!
this
.
isExtensionDevelopmentTestFromCli
&&
!
this
.
isExtensionDevelopmentDebug
)
{
this
.
broadcastService
.
broadcast
({
channel
:
EXTENSION_TERMINATE_BROADCAST_CHANNEL
,
payload
:
true
payload
:
{
debugId
:
this
.
environmentService
.
debugExtensionHost
.
debugId
}
});
event
.
veto
(
TPromise
.
timeout
(
100
/* wait a bit for IPC to get delivered */
).
then
(()
=>
false
));
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
0f731a79
...
...
@@ -331,6 +331,7 @@ export interface IEnvConfig {
internalConsoleOptions
?:
string
;
preLaunchTask
?:
string
;
__restart
?:
any
;
__sessionId
?:
string
;
debugServer
?:
number
;
noDebug
?:
boolean
;
port
?:
number
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
0f731a79
...
...
@@ -166,16 +166,12 @@ export class DebugService implements debug.IDebugService {
private
onBroadcast
(
broadcast
:
IBroadcast
):
void
{
// attach: PH is ready to be attached to
const
process
=
this
.
model
.
getProcesses
().
filter
(
p
=>
strings
.
equalsIgnoreCase
(
p
.
configuration
.
type
,
'
extensionhost
'
)).
pop
();
if
(
!
process
)
{
return
;
// TODO@Andre TODO@Isidor the broadcast should carry over the session ID so that we can do the correct thing here (see https://github.com/Microsoft/vscode/issues/30698)
}
const
process
=
this
.
model
.
getProcesses
().
filter
(
p
=>
p
.
getId
()
===
broadcast
.
payload
.
debugId
).
pop
();
const
session
=
process
?
<
RawDebugSession
>
process
.
session
:
null
;
if
(
broadcast
.
channel
===
EXTENSION_ATTACH_BROADCAST_CHANNEL
)
{
if
(
session
)
{
// Only support one extension host session at a time. More details #29884
this
.
onSessionEnd
(
session
)
;
session
.
attach
({
port
:
broadcast
.
payload
.
port
}).
done
(
undefined
,
errors
.
onUnexpectedError
);
return
;
}
const
config
=
this
.
configurationManager
.
getConfiguration
(
this
.
viewModel
.
selectedConfigurationName
);
...
...
@@ -188,10 +184,8 @@ export class DebugService implements debug.IDebugService {
return
;
}
if
(
broadcast
.
channel
===
EXTENSION_TERMINATE_BROADCAST_CHANNEL
)
{
if
(
session
)
{
if
(
session
&&
broadcast
.
channel
===
EXTENSION_TERMINATE_BROADCAST_CHANNEL
)
{
this
.
onSessionEnd
(
session
);
}
return
;
}
...
...
@@ -202,7 +196,7 @@ export class DebugService implements debug.IDebugService {
// an extension logged output, show it inside the REPL
if
(
broadcast
.
channel
===
EXTENSION_LOG_BROADCAST_CHANNEL
)
{
let
extensionOutput
:
ILogEntry
=
broadcast
.
payload
;
let
extensionOutput
:
ILogEntry
=
broadcast
.
payload
.
logEntry
;
let
sev
=
extensionOutput
.
severity
===
'
warn
'
?
severity
.
Warning
:
extensionOutput
.
severity
===
'
error
'
?
severity
.
Error
:
severity
.
Info
;
let
args
:
any
[]
=
[];
...
...
@@ -773,6 +767,7 @@ export class DebugService implements debug.IDebugService {
private
doCreateProcess
(
configuration
:
debug
.
IConfig
):
TPromise
<
debug
.
IProcess
>
{
const
sessionId
=
generateUuid
();
configuration
.
__sessionId
=
sessionId
;
this
.
updateStateAndEmit
(
sessionId
,
debug
.
State
.
Initializing
);
return
this
.
telemetryService
.
getTelemetryInfo
().
then
(
info
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录