Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1d566aeb
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
1d566aeb
编写于
2月 10, 2017
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: get rid of session.configuration.type
fixes #20432
上级
4b2b4a59
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
30 addition
and
34 deletion
+30
-34
src/vs/workbench/parts/debug/browser/debugActions.ts
src/vs/workbench/parts/debug/browser/debugActions.ts
+3
-3
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
+3
-3
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+1
-1
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+1
-1
src/vs/workbench/parts/debug/common/debugModel.ts
src/vs/workbench/parts/debug/common/debugModel.ts
+2
-2
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
+1
-1
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+10
-8
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
+3
-3
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
...workbench/parts/debug/electron-browser/rawDebugSession.ts
+4
-7
src/vs/workbench/parts/debug/test/common/mockDebug.ts
src/vs/workbench/parts/debug/test/common/mockDebug.ts
+2
-5
未找到文件。
src/vs/workbench/parts/debug/browser/debugActions.ts
浏览文件 @
1d566aeb
...
...
@@ -603,7 +603,7 @@ export class SetValueAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
process
&&
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsSetVariable
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
process
&&
process
.
session
.
capabilities
.
supportsSetVariable
;
}
}
...
...
@@ -795,7 +795,7 @@ export class StepBackAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
process
&&
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsStepBack
;
process
&&
process
.
session
.
capabilities
.
supportsStepBack
;
}
}
...
...
@@ -818,6 +818,6 @@ export class ReverseContinueAction extends AbstractDebugAction {
protected
isEnabled
(
state
:
State
):
boolean
{
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
return
super
.
isEnabled
(
state
)
&&
state
===
State
.
Stopped
&&
process
&&
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsStepBack
;
process
&&
process
.
session
.
capabilities
.
supportsStepBack
;
}
}
src/vs/workbench/parts/debug/browser/debugActionsWidget.ts
浏览文件 @
1d566aeb
...
...
@@ -210,7 +210,7 @@ export class DebugActionsWidget implements IWorkbenchContribution {
const
state
=
this
.
debugService
.
state
;
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
const
attached
=
process
&&
!
strings
.
equalsIgnoreCase
(
process
.
session
.
configuration
.
type
,
'
extensionHost
'
)
&&
process
.
isAttach
(
);
const
attached
=
process
&&
strings
.
equalsIgnoreCase
(
process
.
configuration
.
request
,
'
attach
'
)
&&
!
strings
.
equalsIgnoreCase
(
process
.
configuration
.
type
,
'
extensionHost
'
);
return
this
.
allActions
.
filter
(
a
=>
{
if
(
a
.
id
===
ContinueAction
.
ID
)
{
...
...
@@ -220,10 +220,10 @@ export class DebugActionsWidget implements IWorkbenchContribution {
return
state
===
debug
.
State
.
Running
;
}
if
(
a
.
id
===
StepBackAction
.
ID
)
{
return
process
&&
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsStepBack
;
return
process
&&
process
.
session
.
capabilities
.
supportsStepBack
;
}
if
(
a
.
id
===
ReverseContinueAction
.
ID
)
{
return
process
&&
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsStepBack
;
return
process
&&
process
.
session
.
capabilities
.
supportsStepBack
;
}
if
(
a
.
id
===
DisconnectAction
.
ID
)
{
return
attached
;
...
...
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
1d566aeb
...
...
@@ -271,7 +271,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
}
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
if
(
process
&&
!
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsConditionalBreakpoints
)
{
if
(
process
&&
!
process
.
session
.
capabilities
.
supportsConditionalBreakpoints
)
{
return
DebugEditorModelManager
.
BREAKPOINT_UNSUPPORTED_DECORATION
;
}
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
1d566aeb
...
...
@@ -78,7 +78,7 @@ export interface ISession {
variables
(
args
:
DebugProtocol
.
VariablesArguments
):
TPromise
<
DebugProtocol
.
VariablesResponse
>
;
evaluate
(
args
:
DebugProtocol
.
EvaluateArguments
):
TPromise
<
DebugProtocol
.
EvaluateResponse
>
;
c
onfiguration
:
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilities
}
;
c
apabilities
:
DebugProtocol
.
Capabilities
;
disconnect
(
restart
?:
boolean
,
force
?:
boolean
):
TPromise
<
DebugProtocol
.
DisconnectResponse
>
;
custom
(
request
:
string
,
args
:
any
):
TPromise
<
DebugProtocol
.
Response
>
;
onDidEvent
:
Event
<
DebugProtocol
.
Event
>
;
...
...
src/vs/workbench/parts/debug/common/debugModel.ts
浏览文件 @
1d566aeb
...
...
@@ -269,7 +269,7 @@ export class Variable extends ExpressionContainer implements debug.IExpression {
names
.
forEach
(
name
=>
{
if
(
!
result
)
{
result
=
name
;
}
else
if
(
Variable
.
ARRAY_ELEMENT_SYNTAX
.
test
(
name
)
||
(
this
.
process
.
session
.
configuration
.
type
===
'
node
'
&&
!
Variable
.
NOT_PROPERTY_SYNTAX
.
test
(
name
)))
{
}
else
if
(
Variable
.
ARRAY_ELEMENT_SYNTAX
.
test
(
name
)
||
(
this
.
process
.
configuration
.
type
===
'
node
'
&&
!
Variable
.
NOT_PROPERTY_SYNTAX
.
test
(
name
)))
{
// use safe way to access node properties a['property_name']. Also handles array elements.
result
=
name
&&
name
.
indexOf
(
'
[
'
)
===
0
?
`
${
result
}${
name
}
`
:
`
${
result
}
['
${
name
}
']`
;
}
else
{
...
...
@@ -591,7 +591,7 @@ export class Process implements debug.IProcess {
}
public
completions
(
frameId
:
number
,
text
:
string
,
position
:
Position
,
overwriteBefore
:
number
):
TPromise
<
ISuggestion
[]
>
{
if
(
!
this
.
session
.
c
onfiguration
.
c
apabilities
.
supportsCompletionsRequest
)
{
if
(
!
this
.
session
.
capabilities
.
supportsCompletionsRequest
)
{
return
TPromise
.
as
([]);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugHover.ts
浏览文件 @
1d566aeb
...
...
@@ -170,7 +170,7 @@ export class DebugHoverWidget implements IContentWidget {
// use regex to extract the sub-expression #9821
const
matchingExpression
=
lineContent
.
substring
(
expressionRange
.
startColumn
-
1
,
expressionRange
.
endColumn
);
let
promise
:
TPromise
<
IExpression
>
;
if
(
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsEvaluateForHovers
)
{
if
(
process
.
session
.
capabilities
.
supportsEvaluateForHovers
)
{
const
result
=
new
Expression
(
matchingExpression
);
promise
=
result
.
evaluate
(
process
,
this
.
debugService
.
getViewModel
().
focusedStackFrame
,
'
hover
'
).
then
(()
=>
result
);
}
else
{
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
1d566aeb
...
...
@@ -149,7 +149,8 @@ export class DebugService implements debug.IDebugService {
// TODO@Isidor this is a hack to just get any 'extensionHost' session.
// Optimally the broadcast would contain the id of the session
// We are only intersted if we have an active debug session for extensionHost
const
session
=
<
RawDebugSession
>
this
.
model
.
getProcesses
().
map
(
p
=>
p
.
session
).
filter
(
s
=>
s
.
configuration
.
type
===
'
extensionHost
'
).
pop
();
const
process
=
this
.
model
.
getProcesses
().
filter
(
p
=>
p
.
configuration
.
type
===
'
extensionHost
'
).
pop
();
const
session
=
process
?
<
RawDebugSession
>
process
.
session
:
null
;
if
(
broadcast
.
channel
===
EXTENSION_ATTACH_BROADCAST_CHANNEL
)
{
this
.
rawAttach
(
session
,
broadcast
.
payload
.
port
);
return
;
...
...
@@ -242,7 +243,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
.
onDidInitialize
(
event
=>
{
aria
.
status
(
nls
.
localize
(
'
debuggingStarted
'
,
"
Debugging started.
"
));
const
sendConfigurationDone
=
()
=>
{
if
(
session
&&
session
.
c
onfiguration
.
c
apabilities
.
supportsConfigurationDoneRequest
)
{
if
(
session
&&
session
.
capabilities
.
supportsConfigurationDoneRequest
)
{
return
session
.
configurationDone
().
done
(
null
,
e
=>
{
// Disconnect the debug session on configuration done error #10596
if
(
session
)
{
...
...
@@ -363,7 +364,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
.
get
(
session
.
getId
()).
push
(
session
.
onDidExitAdapter
(
event
=>
{
// 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905
const
process
=
this
.
viewModel
.
focusedProcess
;
if
(
session
&&
session
.
configuration
.
type
===
'
extensionHost
'
&&
this
.
sessionStates
.
get
(
session
.
getId
())
===
debug
.
State
.
Running
&&
if
(
process
&&
session
&&
process
.
getId
()
===
session
.
getId
()
&&
process
.
configuration
.
type
===
'
extensionHost
'
&&
this
.
sessionStates
.
get
(
session
.
getId
())
===
debug
.
State
.
Running
&&
process
&&
this
.
contextService
.
getWorkspace
()
&&
process
.
configuration
.
noDebug
)
{
this
.
windowsService
.
closeExtensionHostWindow
(
this
.
contextService
.
getWorkspace
().
resource
.
fsPath
);
}
...
...
@@ -694,7 +695,7 @@ export class DebugService implements debug.IDebugService {
supportsVariablePaging
:
true
,
// #9537
supportsRunInTerminalRequest
:
true
// #10574
}).
then
((
result
:
DebugProtocol
.
InitializeResponse
)
=>
{
this
.
model
.
setExceptionBreakpoints
(
session
.
c
onfiguration
.
c
apabilities
.
exceptionBreakpointFilters
);
this
.
model
.
setExceptionBreakpoints
(
session
.
capabilities
.
exceptionBreakpointFilters
);
return
configuration
.
request
===
'
attach
'
?
session
.
attach
(
configuration
)
:
session
.
launch
(
configuration
);
}).
then
((
result
:
DebugProtocol
.
Response
)
=>
{
if
(
session
.
disconnected
)
{
...
...
@@ -826,7 +827,7 @@ export class DebugService implements debug.IDebugService {
return
this
.
createProcess
(
this
.
viewModel
.
selectedConfigurationName
);
}
if
(
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsRestartRequest
)
{
if
(
process
.
session
.
capabilities
.
supportsRestartRequest
)
{
return
process
.
session
.
custom
(
'
restart
'
,
null
);
}
const
preserveFocus
=
process
.
getId
()
===
this
.
viewModel
.
focusedProcess
.
getId
();
...
...
@@ -852,8 +853,9 @@ export class DebugService implements debug.IDebugService {
private
onSessionEnd
(
session
:
RawDebugSession
):
void
{
const
bpsExist
=
this
.
model
.
getBreakpoints
().
length
>
0
;
const
process
=
this
.
model
.
getProcesses
().
filter
(
p
=>
p
.
getId
()
===
session
.
getId
()).
pop
();
this
.
telemetryService
.
publicLog
(
'
debugSessionStop
'
,
{
type
:
session
.
configuration
.
type
,
type
:
process
.
configuration
.
type
,
success
:
session
.
emittedStopped
||
!
bpsExist
,
sessionLengthInSeconds
:
session
.
getLengthInSeconds
(),
breakpointCount
:
this
.
model
.
getBreakpoints
().
length
,
...
...
@@ -866,7 +868,7 @@ export class DebugService implements debug.IDebugService {
// an internal module might be open so the dispose can throw -> ignore and continue with stop session.
}
this
.
model
.
removeProcess
(
session
.
getId
());
this
.
model
.
removeProcess
(
process
.
getId
());
const
focusedProcess
=
this
.
viewModel
.
focusedProcess
;
if
(
focusedProcess
&&
focusedProcess
.
getId
()
===
session
.
getId
())
{
this
.
focusStackFrameAndEvaluate
(
null
).
done
(
null
,
errors
.
onUnexpectedError
);
...
...
@@ -970,7 +972,7 @@ export class DebugService implements debug.IDebugService {
private
sendFunctionBreakpoints
(
targetProcess
?:
debug
.
IProcess
):
TPromise
<
void
>
{
const
sendFunctionBreakpointsToProcess
=
(
process
:
debug
.
IProcess
):
TPromise
<
void
>
=>
{
const
session
=
<
RawDebugSession
>
process
.
session
;
if
(
!
session
.
readyForBreakpoints
||
!
session
.
c
onfiguration
.
c
apabilities
.
supportsFunctionBreakpoints
)
{
if
(
!
session
.
readyForBreakpoints
||
!
session
.
capabilities
.
supportsFunctionBreakpoints
)
{
return
TPromise
.
as
(
null
);
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugViewer.ts
浏览文件 @
1d566aeb
...
...
@@ -318,7 +318,7 @@ export class CallStackActionProvider implements IActionProvider {
actions
.
push
(
this
.
instantiationService
.
createInstance
(
PauseAction
,
PauseAction
.
ID
,
PauseAction
.
LABEL
));
}
}
else
if
(
element
instanceof
StackFrame
)
{
if
(
element
.
thread
.
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsRestartFrame
)
{
if
(
element
.
thread
.
process
.
session
.
capabilities
.
supportsRestartFrame
)
{
actions
.
push
(
this
.
instantiationService
.
createInstance
(
RestartFrameAction
,
RestartFrameAction
.
ID
,
RestartFrameAction
.
LABEL
));
}
actions
.
push
(
new
CopyStackTraceAction
(
CopyStackTraceAction
.
ID
,
CopyStackTraceAction
.
LABEL
));
...
...
@@ -1167,9 +1167,9 @@ export class BreakpointsRenderer implements IRenderer {
// Mark function breakpoints as disabled if deactivated or if debug type does not support them #9099
const
process
=
this
.
debugService
.
getViewModel
().
focusedProcess
;
if
((
process
&&
!
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsFunctionBreakpoints
)
||
!
this
.
debugService
.
getModel
().
areBreakpointsActivated
())
{
if
((
process
&&
!
process
.
session
.
capabilities
.
supportsFunctionBreakpoints
)
||
!
this
.
debugService
.
getModel
().
areBreakpointsActivated
())
{
tree
.
addTraits
(
'
disabled
'
,
[
functionBreakpoint
]);
if
(
process
&&
!
process
.
session
.
c
onfiguration
.
c
apabilities
.
supportsFunctionBreakpoints
)
{
if
(
process
&&
!
process
.
session
.
capabilities
.
supportsFunctionBreakpoints
)
{
data
.
breakpoint
.
title
=
nls
.
localize
(
'
functionBreakpointsNotSupported
'
,
"
Function breakpoints are not supported by this debug type
"
);
}
}
else
{
...
...
src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts
浏览文件 @
1d566aeb
...
...
@@ -51,7 +51,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
private
startTime
:
number
;
public
disconnected
:
boolean
;
private
sentPromises
:
TPromise
<
DebugProtocol
.
Response
>
[];
private
capabilities
:
DebugProtocol
.
Capabilities
;
private
_
capabilities
:
DebugProtocol
.
Capabilities
;
private
allThreadsContinued
:
boolean
;
private
_onDidInitialize
:
Emitter
<
DebugProtocol
.
InitializedEvent
>
;
...
...
@@ -214,11 +214,8 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
this
.
_onDidEvent
.
fire
(
event
);
}
public
get
configuration
():
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilities
}
{
return
{
type
:
this
.
adapter
.
type
,
capabilities
:
this
.
capabilities
||
{}
};
public
get
capabilities
():
DebugProtocol
.
Capabilities
{
return
this
.
_capabilities
||
{};
}
public
initialize
(
args
:
DebugProtocol
.
InitializeRequestArguments
):
TPromise
<
DebugProtocol
.
InitializeResponse
>
{
...
...
@@ -227,7 +224,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.ISession {
private
readCapabilities
(
response
:
DebugProtocol
.
Response
):
DebugProtocol
.
Response
{
if
(
response
)
{
this
.
capabilities
=
objects
.
mixin
(
this
.
capabilities
,
response
.
body
);
this
.
_capabilities
=
objects
.
mixin
(
this
.
_
capabilities
,
response
.
body
);
}
return
response
;
...
...
src/vs/workbench/parts/debug/test/common/mockDebug.ts
浏览文件 @
1d566aeb
...
...
@@ -128,11 +128,8 @@ export class MockSession implements debug.ISession {
return
TPromise
.
as
(
null
);
}
public
get
configuration
():
{
type
:
string
,
capabilities
:
DebugProtocol
.
Capabilities
}
{
return
{
type
:
'
mock
'
,
capabilities
:
{}
};
public
get
capabilities
():
DebugProtocol
.
Capabilities
{
return
{};
}
public
get
onDidEvent
():
Event
<
DebugProtocol
.
Event
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录