Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a08885ec
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,发现更多精彩内容 >>
提交
a08885ec
编写于
4月 19, 2016
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: polish IRawDebugSession
上级
29ff5de6
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
46 addition
and
29 deletion
+46
-29
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
.../workbench/parts/debug/browser/debugEditorModelManager.ts
+1
-1
src/vs/workbench/parts/debug/browser/debugHover.ts
src/vs/workbench/parts/debug/browser/debugHover.ts
+1
-1
src/vs/workbench/parts/debug/common/debug.ts
src/vs/workbench/parts/debug/common/debug.ts
+13
-3
src/vs/workbench/parts/debug/electron-browser/debugActions.ts
...vs/workbench/parts/debug/electron-browser/debugActions.ts
+4
-4
src/vs/workbench/parts/debug/electron-browser/debugService.ts
...vs/workbench/parts/debug/electron-browser/debugService.ts
+7
-7
src/vs/workbench/parts/debug/node/rawDebugSession.ts
src/vs/workbench/parts/debug/node/rawDebugSession.ts
+14
-9
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
+6
-4
未找到文件。
src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts
浏览文件 @
a08885ec
...
...
@@ -282,7 +282,7 @@ export class DebugEditorModelManager implements IWorkbenchContribution {
}
return
result
?
result
:
!
session
||
session
.
capabilities
.
supportsConditionalBreakpoints
?
{
!
session
||
session
.
c
onfiguration
.
c
apabilities
.
supportsConditionalBreakpoints
?
{
glyphMarginClassName
:
'
debug-breakpoint-conditional-glyph
'
,
hoverMessage
:
breakpoint
.
condition
,
stickiness
:
editorcommon
.
TrackedRangeStickiness
.
NeverGrowsWhenTypingAtEdges
...
...
src/vs/workbench/parts/debug/browser/debugHover.ts
浏览文件 @
a08885ec
...
...
@@ -126,7 +126,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
private
getExpression
(
namesToFind
:
string
[]):
TPromise
<
Expression
>
{
const
session
=
this
.
debugService
.
getActiveSession
();
const
focusedStackFrame
=
this
.
debugService
.
getViewModel
().
getFocusedStackFrame
();
if
(
session
.
capabilities
.
supportsEvaluateForHovers
)
{
if
(
session
.
c
onfiguration
.
c
apabilities
.
supportsEvaluateForHovers
)
{
return
evaluateExpression
(
session
,
focusedStackFrame
,
new
Expression
(
namesToFind
.
join
(
'
.
'
),
true
),
'
hover
'
);
}
...
...
src/vs/workbench/parts/debug/common/debug.ts
浏览文件 @
a08885ec
...
...
@@ -56,8 +56,19 @@ export interface IExpression extends ITreeElement, IExpressionContainer {
}
export
interface
IThread
extends
ITreeElement
{
/**
* Id of the thread generated by the debug adapter backend.
*/
threadId
:
number
;
/**
* Name of the thread.
*/
name
:
string
;
/**
* Information about the current thread stop event. Null if thread is not stopped.
*/
stoppedDetails
:
IRawStoppedDetails
;
/**
...
...
@@ -237,9 +248,8 @@ export interface IRawAdapter extends IRawEnvAdapter {
}
export
interface
IRawDebugSession
extends
ee
.
EventEmitter
{
getType
():
string
;
isAttach
:
boolean
;
capabilities
:
DebugProtocol
.
Capabilites
;
configuration
:
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
};
disconnect
(
restart
?:
boolean
,
force
?:
boolean
):
TPromise
<
DebugProtocol
.
DisconnectResponse
>
;
next
(
args
:
DebugProtocol
.
NextArguments
):
TPromise
<
DebugProtocol
.
NextResponse
>
;
...
...
src/vs/workbench/parts/debug/electron-browser/debugActions.ts
浏览文件 @
a08885ec
...
...
@@ -137,7 +137,7 @@ export class RestartDebugAction extends AbstractDebugAction {
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
(()
=>
{
const
session
=
this
.
debugService
.
getActiveSession
();
if
(
session
)
{
this
.
updateLabel
(
session
.
isAttach
?
RestartDebugAction
.
RECONNECT_LABEL
:
RestartDebugAction
.
LABEL
);
this
.
updateLabel
(
session
.
configuration
.
isAttach
?
RestartDebugAction
.
RECONNECT_LABEL
:
RestartDebugAction
.
LABEL
);
}
}));
}
...
...
@@ -212,7 +212,7 @@ export class StopDebugAction extends AbstractDebugAction {
this
.
toDispose
.
push
(
this
.
debugService
.
onDidChangeState
(()
=>
{
const
session
=
this
.
debugService
.
getActiveSession
();
if
(
session
)
{
this
.
updateLabel
(
session
.
isAttach
?
StopDebugAction
.
DISCONNECT_LABEL
:
StopDebugAction
.
LABEL
);
this
.
updateLabel
(
session
.
configuration
.
isAttach
?
StopDebugAction
.
DISCONNECT_LABEL
:
StopDebugAction
.
LABEL
);
}
}));
}
...
...
@@ -493,7 +493,7 @@ export class CopyValueAction extends AbstractDebugAction {
if
(
this
.
value
instanceof
model
.
Variable
)
{
const
frameId
=
this
.
debugService
.
getViewModel
().
getFocusedStackFrame
().
frameId
;
const
session
=
this
.
debugService
.
getActiveSession
();
return
session
.
evaluate
({
expression
:
model
.
getFullExpressionName
(
this
.
value
,
session
.
getType
()
),
frameId
}).
then
(
result
=>
{
return
session
.
evaluate
({
expression
:
model
.
getFullExpressionName
(
this
.
value
,
session
.
configuration
.
type
),
frameId
}).
then
(
result
=>
{
clipboard
.
writeText
(
result
.
body
.
result
);
},
err
=>
clipboard
.
writeText
(
this
.
value
.
value
));
}
...
...
@@ -644,7 +644,7 @@ export class AddToWatchExpressionsAction extends AbstractDebugAction {
}
public
run
():
TPromise
<
any
>
{
return
this
.
debugService
.
addWatchExpression
(
model
.
getFullExpressionName
(
this
.
expression
,
this
.
debugService
.
getActiveSession
().
getType
()
));
return
this
.
debugService
.
addWatchExpression
(
model
.
getFullExpressionName
(
this
.
expression
,
this
.
debugService
.
getActiveSession
().
configuration
.
type
));
}
}
...
...
src/vs/workbench/parts/debug/electron-browser/debugService.ts
浏览文件 @
a08885ec
...
...
@@ -151,7 +151,7 @@ export class DebugService implements debug.IDebugService {
// from this point on we require an active session
let
session
=
this
.
getActiveSession
();
if
(
!
session
||
session
.
getType
()
!==
'
extensionHost
'
)
{
if
(
!
session
||
session
.
configuration
.
type
!==
'
extensionHost
'
)
{
return
;
// we are only intersted if we have an active debug session for extensionHost
}
...
...
@@ -232,7 +232,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
.
push
(
this
.
session
.
addListener2
(
debug
.
SessionEvents
.
INITIALIZED
,
(
event
:
DebugProtocol
.
InitializedEvent
)
=>
{
aria
.
status
(
nls
.
localize
(
'
debuggingStarted
'
,
"
Debugging started.
"
));
this
.
sendAllBreakpoints
().
then
(()
=>
{
if
(
this
.
session
.
capabilities
.
supportsConfigurationDoneRequest
)
{
if
(
this
.
session
.
c
onfiguration
.
c
apabilities
.
supportsConfigurationDoneRequest
)
{
this
.
session
.
configurationDone
().
done
(
null
,
errors
.
onUnexpectedError
);
}
});
...
...
@@ -327,7 +327,7 @@ export class DebugService implements debug.IDebugService {
this
.
toDisposeOnSessionEnd
.
push
(
this
.
session
.
addListener2
(
debug
.
SessionEvents
.
SERVER_EXIT
,
event
=>
{
// 'Run without debugging' mode VSCode must terminate the extension host. More details: #3905
if
(
this
.
session
.
getType
()
===
'
extensionHost
'
&&
this
.
state
===
debug
.
State
.
RunningNoDebug
)
{
if
(
this
.
session
.
configuration
.
type
===
'
extensionHost
'
&&
this
.
state
===
debug
.
State
.
RunningNoDebug
)
{
ipc
.
send
(
'
vscode:closeExtensionHostWindow
'
,
this
.
contextService
.
getWorkspace
().
resource
.
fsPath
);
}
if
(
this
.
session
&&
this
.
session
.
getId
()
===
event
.
sessionId
)
{
...
...
@@ -604,7 +604,7 @@ export class DebugService implements debug.IDebugService {
return
TPromise
.
wrapError
(
new
Error
(
nls
.
localize
(
'
debugAdapterCrash
'
,
"
Debug adapter process has terminated unexpectedly
"
)));
}
this
.
model
.
setExceptionBreakpoints
(
this
.
session
.
capabilities
.
exceptionBreakpointFilters
);
this
.
model
.
setExceptionBreakpoints
(
this
.
session
.
c
onfiguration
.
c
apabilities
.
exceptionBreakpointFilters
);
return
configuration
.
request
===
'
attach
'
?
this
.
session
.
attach
(
configuration
)
:
this
.
session
.
launch
(
configuration
);
}).
then
((
result
:
DebugProtocol
.
Response
)
=>
{
if
(
changeViewState
)
{
...
...
@@ -682,7 +682,7 @@ export class DebugService implements debug.IDebugService {
private
rawAttach
(
port
:
number
):
TPromise
<
any
>
{
if
(
this
.
session
)
{
if
(
!
this
.
session
.
isAttach
)
{
if
(
!
this
.
session
.
configuration
.
isAttach
)
{
return
this
.
session
.
attach
({
port
});
}
...
...
@@ -719,7 +719,7 @@ export class DebugService implements debug.IDebugService {
if
(
this
.
session
)
{
const
bpsExist
=
this
.
model
.
getBreakpoints
().
length
>
0
;
this
.
telemetryService
.
publicLog
(
'
debugSessionStop
'
,
{
type
:
this
.
session
.
getType
()
,
type
:
this
.
session
.
configuration
.
type
,
success
:
this
.
session
.
emittedStopped
||
!
bpsExist
,
sessionLengthInSeconds
:
this
.
session
.
getLengthInSeconds
(),
breakpointCount
:
this
.
model
.
getBreakpoints
().
length
,
...
...
@@ -875,7 +875,7 @@ export class DebugService implements debug.IDebugService {
}
private
sendFunctionBreakpoints
():
TPromise
<
void
>
{
if
(
!
this
.
session
||
!
this
.
session
.
readyForBreakpoints
||
!
this
.
session
.
capabilities
.
supportsFunctionBreakpoints
)
{
if
(
!
this
.
session
||
!
this
.
session
.
readyForBreakpoints
||
!
this
.
session
.
c
onfiguration
.
c
apabilities
.
supportsFunctionBreakpoints
)
{
return
TPromise
.
as
(
null
);
}
...
...
src/vs/workbench/parts/debug/node/rawDebugSession.ts
浏览文件 @
a08885ec
...
...
@@ -22,15 +22,17 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
shell
}
from
'
electron
'
;
export
class
RawDebugSession
extends
v8
.
V8Protocol
implements
debug
.
IRawDebugSession
{
public
restarted
:
boolean
;
private
serverProcess
:
cp
.
ChildProcess
;
private
socket
:
net
.
Socket
=
null
;
private
cachedInitServer
:
TPromise
<
void
>
;
private
startTime
:
number
;
private
stopServerPending
:
boolean
;
private
sentPromises
:
TPromise
<
DebugProtocol
.
Response
>
[];
public
isAttach
:
boolean
;
public
restarted
:
boolean
;
public
capabilities
:
DebugProtocol
.
Capabilites
;
private
isAttach
:
boolean
;
private
capabilities
:
DebugProtocol
.
Capabilites
;
constructor
(
private
messageService
:
IMessageService
,
...
...
@@ -40,7 +42,6 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
private
telemtryAdapter
:
AIAdapter
)
{
super
();
this
.
capabilities
=
{};
this
.
sentPromises
=
[];
}
...
...
@@ -87,9 +88,17 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
});
}
public
get
configuration
():
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
return
{
type
:
this
.
adapter
.
type
,
isAttach
:
this
.
isAttach
,
capabilities
:
this
.
capabilities
||
{}
};
}
public
initialize
(
args
:
DebugProtocol
.
InitializeRequestArguments
):
TPromise
<
DebugProtocol
.
InitializeResponse
>
{
return
this
.
send
(
'
initialize
'
,
args
).
then
(
response
=>
{
this
.
capabilities
=
response
.
body
||
this
.
capabilities
;
this
.
capabilities
=
response
.
body
;
return
response
;
});
}
...
...
@@ -206,10 +215,6 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
return
(
new
Date
().
getTime
()
-
this
.
startTime
)
/
1000
;
}
public
getType
():
string
{
return
this
.
adapter
.
type
;
}
private
connectServer
(
port
:
number
):
TPromise
<
void
>
{
return
new
TPromise
<
void
>
((
c
,
e
)
=>
{
this
.
socket
=
net
.
createConnection
(
port
,
'
127.0.0.1
'
,
()
=>
{
...
...
src/vs/workbench/parts/debug/test/common/mockDebugService.ts
浏览文件 @
a08885ec
...
...
@@ -126,11 +126,13 @@ export class MockDebugService implements debug.IDebugService {
class
MockRawSession
extends
ee
.
EventEmitter
implements
debug
.
IRawDebugSession
{
public
isAttach
:
boolean
=
false
;
public
capabilities
:
DebugProtocol
.
Capabilites
;
public
getType
():
string
{
return
null
;
public
get
configuration
():
{
type
:
string
,
isAttach
:
boolean
,
capabilities
:
DebugProtocol
.
Capabilites
}
{
return
{
type
:
'
mock
'
,
isAttach
:
false
,
capabilities
:
{}
};
}
public
disconnect
(
restart
?:
boolean
,
force
?:
boolean
):
TPromise
<
DebugProtocol
.
DisconnectResponse
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录