Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
943835bf
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,发现更多精彩内容 >>
提交
943835bf
编写于
8月 31, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: remove isAttach field from debugService, get it from configuration
fixes #11163
上级
b7ab0e8c
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
25 addition
and
33 deletion
+25
-33
src/vs/workbench/parts/debug/browser/debugActionItems.ts
src/vs/workbench/parts/debug/browser/debugActionItems.ts
+3
-2
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+7
-8
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+3
-2
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+3
-3
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
...kbench/parts/debug/electron-browser/debug.contribution.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+1
-5
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
...workbench/parts/debug/electron-browser/rawDebugSession.ts
+2
-6
src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
...s/workbench/parts/debug/node/debugConfigurationManager.ts
+4
-4
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
+1
-2
未找到文件。
src/vs/workbench/parts/debug/browser/debugActionItems.ts
浏览文件 @
943835bf
...
...
@@ -38,14 +38,15 @@ export class DebugSelectActionItem extends SelectActionItem {
}
private
updateOptions
(
changeDebugConfiguration
:
boolean
):
TPromise
<
any
>
{
return
this
.
debugService
.
getConfigurationManager
().
loadLaunchConfig
().
then
(
config
=>
{
const
configurationManager
=
this
.
debugService
.
getConfigurationManager
();
return
configurationManager
.
loadLaunchConfig
().
then
(
config
=>
{
if
(
!
config
||
!
config
.
configurations
||
config
.
configurations
.
length
===
0
)
{
this
.
setOptions
([
nls
.
localize
(
'
noConfigurations
'
,
"
No Configurations
"
)],
0
);
return
changeDebugConfiguration
?
this
.
actionRunner
.
run
(
this
.
_action
,
null
)
:
null
;
}
const
configurationNames
=
config
.
configurations
.
filter
(
cfg
=>
!!
cfg
.
name
).
map
(
cfg
=>
cfg
.
name
);
const
configurationName
=
this
.
debugService
.
getConfigurationManager
().
configurationName
;
const
configurationName
=
configurationManager
.
configuration
?
configurationManager
.
configuration
.
name
:
null
;
let
selected
=
configurationNames
.
indexOf
(
configurationName
);
this
.
setOptions
(
configurationNames
,
selected
);
...
...
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
943835bf
...
...
@@ -142,12 +142,12 @@ export class RestartAction extends AbstractDebugAction {
constructor
(
id
:
string
,
label
:
string
,
@
IDebugService
debugService
:
IDebugService
,
@
IKeybindingService
keybindingService
:
IKeybindingService
)
{
super
(
id
,
label
,
'
debug-action restart
'
,
debugService
,
keybindingService
);
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
(()
=>
{
const
session
=
this
.
debugService
.
getActiveSession
(
);
if
(
session
)
{
this
.
updateLabel
(
session
.
configuration
.
isAttach
?
RestartAction
.
RECONNECT_LABEL
:
RestartAction
.
LABEL
);
}
})
);
this
.
setLabel
(
this
.
debugService
.
getConfigurationManager
().
configuration
);
this
.
toDispose
.
push
(
this
.
debugService
.
getConfigurationManager
().
onDidConfigurationChange
(
config
=>
this
.
setLabel
(
config
))
);
}
private
setLabel
(
config
:
debug
.
IConfig
):
void
{
this
.
updateLabel
(
config
.
request
===
'
attach
'
?
RestartAction
.
RECONNECT_LABEL
:
RestartAction
.
LABEL
);
}
public
run
():
TPromise
<
any
>
{
...
...
@@ -273,8 +273,7 @@ export class DisconnectAction extends AbstractDebugAction {
}
protected
isEnabled
(
state
:
debug
.
State
):
boolean
{
const
session
=
this
.
debugService
.
getActiveSession
();
return
super
.
isEnabled
(
state
)
&&
state
!==
debug
.
State
.
Inactive
&&
session
&&
session
.
configuration
.
isAttach
;
return
super
.
isEnabled
(
state
)
&&
state
!==
debug
.
State
.
Inactive
;
}
}
...
...
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
943835bf
...
...
@@ -180,10 +180,11 @@ export class DebugActionsWidget implements wbext.IWorkbenchContribution {
this
.
toDispose
.
push
(
this
.
pauseAction
);
this
.
toDispose
.
push
(
this
.
disconnectAction
);
}
this
.
actions
[
0
]
=
state
===
debug
.
State
.
Running
?
this
.
pauseAction
:
this
.
continueAction
;
const
session
=
this
.
debugService
.
getActiveSession
();
this
.
actions
[
5
]
=
session
&&
session
.
configuration
.
isAttach
?
this
.
disconnectAction
:
this
.
stopAction
;
const
configuration
=
this
.
debugService
.
getConfigurationManager
().
configuration
;
this
.
actions
[
5
]
=
configuration
&&
configuration
.
request
===
'
attach
'
?
this
.
disconnectAction
:
this
.
stopAction
;
if
(
session
&&
session
.
configuration
.
capabilities
.
supportsStepBack
)
{
if
(
!
this
.
stepBackAction
)
{
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
943835bf
...
...
@@ -250,7 +250,7 @@ export interface IRawBreakpointContribution {
}
export
interface
IRawDebugSession
{
configuration
:
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
};
configuration
:
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilites
};
disconnect
(
restart
?:
boolean
,
force
?:
boolean
):
TPromise
<
DebugProtocol
.
DisconnectResponse
>
;
...
...
@@ -265,7 +265,7 @@ export interface IRawDebugSession {
}
export
interface
IConfigurationManager
{
configuration
Name
:
strin
g
;
configuration
:
IConfi
g
;
setConfiguration
(
name
:
string
):
TPromise
<
void
>
;
openConfigFile
(
sideBySide
:
boolean
):
TPromise
<
boolean
>
;
loadLaunchConfig
():
TPromise
<
IGlobalConfig
>
;
...
...
@@ -274,7 +274,7 @@ export interface IConfigurationManager {
/**
* Allows to register on change of debug configuration.
*/
onDidConfigurationChange
:
Event
<
strin
g
>
;
onDidConfigurationChange
:
Event
<
IConfi
g
>
;
}
export
const
IDebugService
=
createDecorator
<
IDebugService
>
(
DEBUG_SERVICE_ID
);
...
...
src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts
浏览文件 @
943835bf
...
...
@@ -118,7 +118,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const
configurationManager
=
debugService
.
getConfigurationManager
();
return
configurationManager
.
setConfiguration
(
configuration
)
.
then
(()
=>
{
return
configurationManager
.
configuration
Name
?
debugService
.
createSession
(
false
)
return
configurationManager
.
configuration
?
debugService
.
createSession
(
false
)
:
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
launchConfigDoesNotExist
'
,
"
Launch configuration '{0}' does not exist.
"
,
configuration
)));
});
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
943835bf
...
...
@@ -739,11 +739,7 @@ export class DebugService implements debug.IDebugService {
private
rawAttach
(
port
:
number
):
TPromise
<
any
>
{
if
(
this
.
session
)
{
if
(
!
this
.
session
.
configuration
.
isAttach
)
{
return
this
.
session
.
attach
({
port
});
}
this
.
session
.
disconnect
().
done
(
null
,
errors
.
onUnexpectedError
);
return
this
.
session
.
attach
({
port
});
}
this
.
setStateAndEmit
(
debug
.
State
.
Initializing
);
...
...
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
浏览文件 @
943835bf
...
...
@@ -52,7 +52,6 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
private
startTime
:
number
;
private
stopServerPending
:
boolean
;
private
sentPromises
:
TPromise
<
DebugProtocol
.
Response
>
[];
private
isAttach
:
boolean
;
private
capabilities
:
DebugProtocol
.
Capabilites
;
private
_onDidInitialize
:
Emitter
<
DebugProtocol
.
InitializedEvent
>
;
...
...
@@ -212,10 +211,9 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
this
.
_onDidEvent
.
fire
(
event
);
}
public
get
configuration
():
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
public
get
configuration
():
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
return
{
type
:
this
.
adapter
.
type
,
isAttach
:
this
.
isAttach
,
capabilities
:
this
.
capabilities
||
{}
};
}
...
...
@@ -233,12 +231,10 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
}
public
launch
(
args
:
DebugProtocol
.
LaunchRequestArguments
):
TPromise
<
DebugProtocol
.
LaunchResponse
>
{
this
.
isAttach
=
false
;
return
this
.
send
(
'
launch
'
,
args
).
then
(
response
=>
this
.
readCapabilities
(
response
));
}
public
attach
(
args
:
DebugProtocol
.
AttachRequestArguments
):
TPromise
<
DebugProtocol
.
AttachResponse
>
{
this
.
isAttach
=
true
;
return
this
.
send
(
'
attach
'
,
args
).
then
(
response
=>
this
.
readCapabilities
(
response
));
}
...
...
@@ -358,7 +354,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
let
command
=
''
;
if
(
platform
.
isWindows
)
{
const
quote
=
(
s
:
string
)
=>
{
s
=
s
.
replace
(
/
\"
/g
,
'
""
'
);
return
(
s
.
indexOf
(
'
'
)
>=
0
||
s
.
indexOf
(
'
"
'
)
>=
0
)
?
`"
${
s
}
"`
:
s
;
...
...
src/vs/workbench/parts/debug/node/debugConfigurationManager.ts
浏览文件 @
943835bf
...
...
@@ -175,7 +175,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
private
systemVariables
:
ISystemVariables
;
private
adapters
:
Adapter
[];
private
allModeIdsForBreakpoints
:
{
[
key
:
string
]:
boolean
};
private
_onDidConfigurationChange
:
Emitter
<
strin
g
>
;
private
_onDidConfigurationChange
:
Emitter
<
debug
.
IConfi
g
>
;
constructor
(
configName
:
string
,
...
...
@@ -189,7 +189,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
@
ICommandService
private
commandService
:
ICommandService
)
{
this
.
systemVariables
=
this
.
contextService
.
getWorkspace
()
?
new
ConfigVariables
(
this
.
configurationService
,
this
.
editorService
,
this
.
contextService
,
this
.
environmentService
)
:
null
;
this
.
_onDidConfigurationChange
=
new
Emitter
<
strin
g
>
();
this
.
_onDidConfigurationChange
=
new
Emitter
<
debug
.
IConfi
g
>
();
this
.
setConfiguration
(
configName
);
this
.
adapters
=
[];
this
.
registerListeners
();
...
...
@@ -252,7 +252,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
});
}
public
get
onDidConfigurationChange
():
Event
<
strin
g
>
{
public
get
onDidConfigurationChange
():
Event
<
debug
.
IConfi
g
>
{
return
this
.
_onDidConfigurationChange
.
event
;
}
...
...
@@ -364,7 +364,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
});
}
}
}).
then
(()
=>
this
.
_onDidConfigurationChange
.
fire
(
this
.
configuration
Name
));
}).
then
(()
=>
this
.
_onDidConfigurationChange
.
fire
(
this
.
configuration
));
}
public
openConfigFile
(
sideBySide
:
boolean
):
TPromise
<
boolean
>
{
...
...
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
浏览文件 @
943835bf
...
...
@@ -145,10 +145,9 @@ export class MockDebugService implements debug.IDebugService {
class
MockRawSession
implements
debug
.
IRawDebugSession
{
public
get
configuration
():
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
public
get
configuration
():
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
return
{
type
:
'
mock
'
,
isAttach
:
false
,
capabilities
:
{}
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录