Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
cc80ec81
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,发现更多精彩内容 >>
提交
cc80ec81
编写于
11月 09, 2018
作者:
I
isidor
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debug: minor polish
上级
be0c72b9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
39 deletion
+39
-39
src/vs/workbench/parts/debug/common/debugSource.ts
src/vs/workbench/parts/debug/common/debugSource.ts
+7
-7
src/vs/workbench/parts/debug/common/replModel.ts
src/vs/workbench/parts/debug/common/replModel.ts
+4
-5
src/vs/workbench/parts/debug/node/debugAdapter.ts
src/vs/workbench/parts/debug/node/debugAdapter.ts
+14
-13
src/vs/workbench/parts/debug/node/debugger.ts
src/vs/workbench/parts/debug/node/debugger.ts
+14
-14
未找到文件。
src/vs/workbench/parts/debug/common/debugSource.ts
浏览文件 @
cc80ec81
...
...
@@ -63,27 +63,27 @@ export class Source {
}
}
public
get
name
()
{
get
name
()
{
return
this
.
raw
.
name
||
resources
.
basenameOrAuthority
(
this
.
uri
);
}
public
get
origin
()
{
get
origin
()
{
return
this
.
raw
.
origin
;
}
public
get
presentationHint
()
{
get
presentationHint
()
{
return
this
.
raw
.
presentationHint
;
}
public
get
reference
()
{
get
reference
()
{
return
this
.
raw
.
sourceReference
;
}
public
get
inMemory
()
{
get
inMemory
()
{
return
this
.
uri
.
scheme
===
DEBUG_SCHEME
;
}
public
openInEditor
(
editorService
:
IEditorService
,
selection
:
IRange
,
preserveFocus
?:
boolean
,
sideBySide
?:
boolean
,
pinned
?:
boolean
):
Thenable
<
any
>
{
openInEditor
(
editorService
:
IEditorService
,
selection
:
IRange
,
preserveFocus
?:
boolean
,
sideBySide
?:
boolean
,
pinned
?:
boolean
):
Thenable
<
any
>
{
return
!
this
.
available
?
Promise
.
resolve
(
null
)
:
editorService
.
openEditor
({
resource
:
this
.
uri
,
description
:
this
.
origin
,
...
...
@@ -97,7 +97,7 @@ export class Source {
},
sideBySide
?
SIDE_GROUP
:
ACTIVE_GROUP
);
}
public
static
getEncodedDebugData
(
modelUri
:
uri
):
{
name
:
string
,
path
:
string
,
sessionId
:
string
,
sourceReference
:
number
}
{
static
getEncodedDebugData
(
modelUri
:
uri
):
{
name
:
string
,
path
:
string
,
sessionId
:
string
,
sourceReference
:
number
}
{
let
path
:
string
;
let
sourceReference
:
number
;
let
sessionId
:
string
;
...
...
src/vs/workbench/parts/debug/common/replModel.ts
浏览文件 @
cc80ec81
...
...
@@ -18,17 +18,17 @@ export class ReplModel {
constructor
(
private
session
:
IDebugSession
)
{
}
public
getReplElements
():
ReadonlyArray
<
IReplElement
>
{
getReplElements
():
ReadonlyArray
<
IReplElement
>
{
return
this
.
replElements
;
}
public
addReplExpression
(
stackFrame
:
IStackFrame
,
name
:
string
):
Promise
<
void
>
{
addReplExpression
(
stackFrame
:
IStackFrame
,
name
:
string
):
Promise
<
void
>
{
const
expression
=
new
Expression
(
name
);
this
.
addReplElements
([
expression
]);
return
expression
.
evaluate
(
this
.
session
,
stackFrame
,
'
repl
'
);
}
public
appendToRepl
(
data
:
string
|
IExpression
,
sev
:
severity
,
source
?:
IReplElementSource
):
void
{
appendToRepl
(
data
:
string
|
IExpression
,
sev
:
severity
,
source
?:
IReplElementSource
):
void
{
const
clearAnsiSequence
=
'
\
u001b[2J
'
;
if
(
typeof
data
===
'
string
'
&&
data
.
indexOf
(
clearAnsiSequence
)
>=
0
)
{
// [2J is the ansi escape sequence for clearing the display http://ascii-table.com/ansi-escape-sequences.php
...
...
@@ -63,7 +63,7 @@ export class ReplModel {
}
}
public
logToRepl
(
sev
:
severity
,
args
:
any
[],
frame
?:
{
uri
:
URI
,
line
:
number
,
column
:
number
})
{
logToRepl
(
sev
:
severity
,
args
:
any
[],
frame
?:
{
uri
:
URI
,
line
:
number
,
column
:
number
})
{
let
source
:
IReplElementSource
;
if
(
frame
)
{
...
...
@@ -141,5 +141,4 @@ export class ReplModel {
this
.
replElements
=
[];
}
}
}
src/vs/workbench/parts/debug/node/debugAdapter.ts
浏览文件 @
cc80ec81
...
...
@@ -44,41 +44,38 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
abstract
startSession
():
Promise
<
void
>
;
abstract
stopSession
():
Promise
<
void
>
;
public
dispose
():
void
{
}
abstract
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
;
public
get
onError
():
Event
<
Error
>
{
get
onError
():
Event
<
Error
>
{
return
this
.
_onError
.
event
;
}
public
get
onExit
():
Event
<
number
>
{
get
onExit
():
Event
<
number
>
{
return
this
.
_onExit
.
event
;
}
public
onMessage
(
callback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
):
void
{
onMessage
(
callback
:
(
message
:
DebugProtocol
.
ProtocolMessage
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Message' callback`
));
}
this
.
messageCallback
=
callback
;
}
public
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
):
void
{
onEvent
(
callback
:
(
event
:
DebugProtocol
.
Event
)
=>
void
):
void
{
if
(
this
.
eventCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Event' callback`
));
}
this
.
eventCallback
=
callback
;
}
public
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
):
void
{
onRequest
(
callback
:
(
request
:
DebugProtocol
.
Request
)
=>
void
):
void
{
if
(
this
.
requestCallback
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to set more than one 'Request' callback`
));
}
this
.
requestCallback
=
callback
;
}
public
sendResponse
(
response
:
DebugProtocol
.
Response
):
void
{
sendResponse
(
response
:
DebugProtocol
.
Response
):
void
{
if
(
response
.
seq
>
0
)
{
this
.
_onError
.
fire
(
new
Error
(
`attempt to send more than one response for command
${
response
.
command
}
`
));
}
else
{
...
...
@@ -86,7 +83,7 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
}
}
public
sendRequest
(
command
:
string
,
args
:
any
,
clb
:
(
result
:
DebugProtocol
.
Response
)
=>
void
,
timeout
?:
number
):
void
{
sendRequest
(
command
:
string
,
args
:
any
,
clb
:
(
result
:
DebugProtocol
.
Response
)
=>
void
,
timeout
?:
number
):
void
{
const
request
:
any
=
{
command
:
command
...
...
@@ -122,7 +119,7 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
}
}
public
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
acceptMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
if
(
this
.
messageCallback
)
{
this
.
messageCallback
(
message
);
}
else
{
...
...
@@ -174,6 +171,10 @@ export abstract class AbstractDebugAdapter implements IDebugAdapter {
});
},
1000
);
}
dispose
():
void
{
this
.
cancelPending
();
}
}
/**
...
...
@@ -202,7 +203,7 @@ export abstract class StreamDebugAdapter extends AbstractDebugAdapter {
readable
.
on
(
'
data
'
,
(
data
:
Buffer
)
=>
this
.
handleData
(
data
));
}
public
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
if
(
this
.
outputStream
)
{
const
json
=
JSON
.
stringify
(
message
);
...
...
@@ -473,7 +474,7 @@ export class ExecutableDebugAdapter extends StreamDebugAdapter {
return
result
;
}
public
static
platformAdapterExecutable
(
extensionDescriptions
:
IExtensionDescription
[],
debugType
:
string
):
IDebugAdapterExecutable
{
static
platformAdapterExecutable
(
extensionDescriptions
:
IExtensionDescription
[],
debugType
:
string
):
IDebugAdapterExecutable
{
const
result
:
IDebuggerContribution
=
Object
.
create
(
null
);
debugType
=
debugType
.
toLowerCase
();
...
...
src/vs/workbench/parts/debug/node/debugger.ts
浏览文件 @
cc80ec81
...
...
@@ -41,7 +41,7 @@ export class Debugger implements IDebugger {
}
public
createDebugAdapter
(
session
:
IDebugSession
,
root
:
IWorkspaceFolder
,
config
:
IConfig
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
{
createDebugAdapter
(
session
:
IDebugSession
,
root
:
IWorkspaceFolder
,
config
:
IConfig
,
outputService
:
IOutputService
):
Promise
<
IDebugAdapter
>
{
if
(
this
.
inExtHost
())
{
return
Promise
.
resolve
(
this
.
configurationManager
.
createDebugAdapter
(
session
,
root
,
config
));
}
else
{
...
...
@@ -92,7 +92,7 @@ export class Debugger implements IDebugger {
});
}
public
substituteVariables
(
folder
:
IWorkspaceFolder
,
config
:
IConfig
):
Thenable
<
IConfig
>
{
substituteVariables
(
folder
:
IWorkspaceFolder
,
config
:
IConfig
):
Thenable
<
IConfig
>
{
if
(
this
.
inExtHost
())
{
return
this
.
configurationManager
.
substituteVariables
(
this
.
type
,
folder
,
config
).
then
(
config
=>
{
return
this
.
configurationResolverService
.
resolveWithCommands
(
folder
,
config
,
this
.
variables
);
...
...
@@ -102,7 +102,7 @@ export class Debugger implements IDebugger {
}
}
public
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
void
>
{
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
):
Promise
<
void
>
{
const
config
=
this
.
configurationService
.
getValue
<
ITerminalSettings
>
(
'
terminal
'
);
return
this
.
configurationManager
.
runInTerminal
(
this
.
inExtHost
()
?
this
.
type
:
'
*
'
,
args
,
config
);
}
...
...
@@ -112,27 +112,27 @@ export class Debugger implements IDebugger {
return
debugConfigs
.
extensionHostDebugAdapter
||
this
.
configurationManager
.
needsToRunInExtHost
(
this
.
type
)
||
this
.
extensionDescription
.
extensionLocation
.
scheme
!==
'
file
'
;
}
public
get
label
():
string
{
get
label
():
string
{
return
this
.
debuggerContribution
.
label
||
this
.
debuggerContribution
.
type
;
}
public
get
type
():
string
{
get
type
():
string
{
return
this
.
debuggerContribution
.
type
;
}
public
get
variables
():
{
[
key
:
string
]:
string
}
{
get
variables
():
{
[
key
:
string
]:
string
}
{
return
this
.
debuggerContribution
.
variables
;
}
public
get
configurationSnippets
():
IJSONSchemaSnippet
[]
{
get
configurationSnippets
():
IJSONSchemaSnippet
[]
{
return
this
.
debuggerContribution
.
configurationSnippets
;
}
public
get
languages
():
string
[]
{
get
languages
():
string
[]
{
return
this
.
debuggerContribution
.
languages
;
}
public
merge
(
secondRawAdapter
:
IDebuggerContribution
,
extensionDescription
:
IExtensionDescription
):
void
{
merge
(
secondRawAdapter
:
IDebuggerContribution
,
extensionDescription
:
IExtensionDescription
):
void
{
// remember all ext descriptions that are the source of this debugger
this
.
mergedExtensionDescriptions
.
push
(
extensionDescription
);
...
...
@@ -144,15 +144,15 @@ export class Debugger implements IDebugger {
objects
.
mixin
(
this
.
debuggerContribution
,
secondRawAdapter
,
extensionDescription
.
isBuiltin
);
}
public
hasInitialConfiguration
():
boolean
{
hasInitialConfiguration
():
boolean
{
return
!!
this
.
debuggerContribution
.
initialConfigurations
;
}
public
hasConfigurationProvider
()
{
hasConfigurationProvider
():
boolean
{
return
this
.
configurationManager
.
hasDebugConfigurationProvider
(
this
.
type
);
}
public
getInitialConfigurationContent
(
initialConfigs
?:
IConfig
[]):
Promise
<
string
>
{
getInitialConfigurationContent
(
initialConfigs
?:
IConfig
[]):
Promise
<
string
>
{
// at this point we got some configs from the package.json and/or from registered DebugConfigurationProviders
let
initialConfigurations
=
this
.
debuggerContribution
.
initialConfigurations
||
[];
if
(
initialConfigs
)
{
...
...
@@ -185,7 +185,7 @@ export class Debugger implements IDebugger {
}
@
memoize
public
getCustomTelemetryService
():
Thenable
<
TelemetryService
>
{
getCustomTelemetryService
():
Thenable
<
TelemetryService
>
{
if
(
!
this
.
debuggerContribution
.
aiKey
)
{
return
Promise
.
resolve
(
undefined
);
}
...
...
@@ -217,7 +217,7 @@ export class Debugger implements IDebugger {
});
}
public
getSchemaAttributes
():
IJSONSchema
[]
{
getSchemaAttributes
():
IJSONSchema
[]
{
if
(
!
this
.
debuggerContribution
.
configurationAttributes
)
{
return
null
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录