Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
d589f2f1
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,发现更多精彩内容 >>
提交
d589f2f1
编写于
12月 14, 2017
作者:
A
Andre Weinand
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove usage of CustomMarshaller for DebugService (#40169)
上级
475ac42d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
15 deletion
+19
-15
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+3
-2
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+7
-6
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+9
-7
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
d589f2f1
...
...
@@ -143,8 +143,9 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape {
return
TPromise
.
wrap
<
void
>
(
undefined
);
}
public
$startDebugging
(
folderUri
:
uri
|
undefined
,
nameOrConfiguration
:
string
|
IConfig
):
TPromise
<
boolean
>
{
const
folder
=
folderUri
?
this
.
contextService
.
getWorkspace
().
folders
.
filter
(
wf
=>
wf
.
uri
.
toString
()
===
folderUri
.
toString
()).
pop
()
:
undefined
;
public
$startDebugging
(
_folderUri
:
uri
|
undefined
,
nameOrConfiguration
:
string
|
IConfig
):
TPromise
<
boolean
>
{
const
folderUriString
=
_folderUri
?
uri
.
revive
(
_folderUri
).
toString
()
:
undefined
;
const
folder
=
folderUriString
?
this
.
contextService
.
getWorkspace
().
folders
.
filter
(
wf
=>
wf
.
uri
.
toString
()
===
folderUriString
).
pop
()
:
undefined
;
return
this
.
debugService
.
startDebugging
(
folder
,
nameOrConfiguration
).
then
(
x
=>
{
return
true
;
},
err
=>
{
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
d589f2f1
...
...
@@ -31,6 +31,7 @@ import * as modes from 'vs/editor/common/modes';
import
{
ITextSource
}
from
'
vs/editor/common/model/textSource
'
;
import
{
IConfigurationData
,
ConfigurationTarget
,
IConfigurationModel
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IConfig
}
from
'
vs/workbench/parts/debug/common/debug
'
;
import
{
IPickOpenEntry
,
IPickOptions
}
from
'
vs/platform/quickOpen/common/quickOpen
'
;
import
{
SaveReason
}
from
'
vs/workbench/services/textfile/common/textfiles
'
;
...
...
@@ -446,7 +447,7 @@ export type DebugSessionUUID = string;
export
interface
MainThreadDebugServiceShape
extends
IDisposable
{
$registerDebugConfigurationProvider
(
type
:
string
,
hasProvideMethod
:
boolean
,
hasResolveMethod
:
boolean
,
handle
:
number
):
TPromise
<
any
>
;
$unregisterDebugConfigurationProvider
(
handle
:
number
):
TPromise
<
any
>
;
$startDebugging
(
folder
:
U
RI
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
):
TPromise
<
boolean
>
;
$startDebugging
(
folder
:
U
riComponents
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
):
TPromise
<
boolean
>
;
$customDebugAdapterRequest
(
id
:
DebugSessionUUID
,
command
:
string
,
args
:
any
):
TPromise
<
any
>
;
$appendDebugConsole
(
value
:
string
):
TPromise
<
any
>
;
$startBreakpointEvents
():
TPromise
<
any
>
;
...
...
@@ -691,7 +692,7 @@ export interface IBreakpointData {
export
interface
ISourceBreakpointData
extends
IBreakpointData
{
type
:
'
source
'
;
uri
:
U
RI
;
uri
:
U
riComponents
;
line
:
number
;
character
:
number
;
}
...
...
@@ -708,8 +709,8 @@ export interface IBreakpointsDelta {
}
export
interface
ExtHostDebugServiceShape
{
$resolveDebugConfiguration
(
handle
:
number
,
folder
:
U
RI
|
undefined
,
debugConfiguration
:
any
):
TPromise
<
any
>
;
$provideDebugConfigurations
(
handle
:
number
,
folder
:
U
RI
|
undefined
):
TPromise
<
any
[]
>
;
$resolveDebugConfiguration
(
handle
:
number
,
folder
:
U
riComponents
|
undefined
,
debugConfiguration
:
IConfig
):
TPromise
<
IConfig
>
;
$provideDebugConfigurations
(
handle
:
number
,
folder
:
U
riComponents
|
undefined
):
TPromise
<
IConfig
[]
>
;
$acceptDebugSessionStarted
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
;
$acceptDebugSessionTerminated
(
id
:
DebugSessionUUID
,
type
:
string
,
name
:
string
):
void
;
$acceptDebugSessionActiveChanged
(
id
:
DebugSessionUUID
|
undefined
,
type
?:
string
,
name
?:
string
):
void
;
...
...
@@ -733,7 +734,7 @@ export interface ExtHostWindowShape {
export
const
MainContext
=
{
MainThreadCommands
:
<
ProxyIdentifier
<
MainThreadCommandsShape
>>
createMainId
<
MainThreadCommandsShape
>
(
'
MainThreadCommands
'
),
MainThreadConfiguration
:
createMainId
<
MainThreadConfigurationShape
>
(
'
MainThreadConfiguration
'
,
ProxyType
.
CustomMarshaller
),
MainThreadDebugService
:
createMainId
<
MainThreadDebugServiceShape
>
(
'
MainThreadDebugService
'
,
ProxyType
.
CustomMarshaller
),
MainThreadDebugService
:
createMainId
<
MainThreadDebugServiceShape
>
(
'
MainThreadDebugService
'
),
MainThreadDecorations
:
createMainId
<
MainThreadDecorationsShape
>
(
'
MainThreadDecorations
'
),
MainThreadDiagnostics
:
createMainId
<
MainThreadDiagnosticsShape
>
(
'
MainThreadDiagnostics
'
),
MainThreadDialogs
:
createMainId
<
MainThreadDiaglogsShape
>
(
'
MainThreadDiaglogs
'
),
...
...
@@ -764,7 +765,7 @@ export const ExtHostContext = {
ExtHostCommands
:
createExtId
<
ExtHostCommandsShape
>
(
'
ExtHostCommands
'
),
ExtHostConfiguration
:
createExtId
<
ExtHostConfigurationShape
>
(
'
ExtHostConfiguration
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDiagnostics
:
createExtId
<
ExtHostDiagnosticsShape
>
(
'
ExtHostDiagnostics
'
),
ExtHostDebugService
:
createExtId
<
ExtHostDebugServiceShape
>
(
'
ExtHostDebugService
'
,
ProxyType
.
CustomMarshaller
),
ExtHostDebugService
:
createExtId
<
ExtHostDebugServiceShape
>
(
'
ExtHostDebugService
'
),
ExtHostDecorations
:
createExtId
<
ExtHostDecorationsShape
>
(
'
ExtHostDecorations
'
),
ExtHostDocumentsAndEditors
:
createExtId
<
ExtHostDocumentsAndEditorsShape
>
(
'
ExtHostDocumentsAndEditors
'
),
ExtHostDocuments
:
createExtId
<
ExtHostDocumentsShape
>
(
'
ExtHostDocuments
'
),
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
d589f2f1
...
...
@@ -11,7 +11,7 @@ import { MainContext, MainThreadDebugServiceShape, ExtHostDebugServiceShape, Deb
import
{
ExtHostWorkspace
}
from
'
vs/workbench/api/node/extHostWorkspace
'
;
import
*
as
vscode
from
'
vscode
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
Disposable
,
Position
,
Location
,
SourceBreakpoint
,
FunctionBreakpoint
}
from
'
vs/workbench/api/node/extHostTypes
'
;
...
...
@@ -138,7 +138,8 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
if
(
bp
.
type
===
'
function
'
)
{
return
new
FunctionBreakpoint
(
bp
.
enabled
,
bp
.
condition
,
bp
.
hitCondition
,
bp
.
functionName
);
}
return
new
SourceBreakpoint
(
bp
.
enabled
,
bp
.
condition
,
bp
.
hitCondition
,
new
Location
(
bp
.
uri
,
new
Position
(
bp
.
line
,
bp
.
character
)));
const
uri
=
URI
.
revive
(
bp
.
uri
);
return
new
SourceBreakpoint
(
bp
.
enabled
,
bp
.
condition
,
bp
.
hitCondition
,
new
Location
(
uri
,
new
Position
(
bp
.
line
,
bp
.
character
)));
}
public
registerDebugConfigurationProvider
(
type
:
string
,
provider
:
vscode
.
DebugConfigurationProvider
):
vscode
.
Disposable
{
...
...
@@ -156,7 +157,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
});
}
public
$provideDebugConfigurations
(
handle
:
number
,
folderUri
:
U
RI
|
undefined
):
TPromise
<
vscode
.
DebugConfiguration
[]
>
{
public
$provideDebugConfigurations
(
handle
:
number
,
folderUri
:
U
riComponents
|
undefined
):
TPromise
<
vscode
.
DebugConfiguration
[]
>
{
let
handler
=
this
.
_handlers
.
get
(
handle
);
if
(
!
handler
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
[]
>
(
new
Error
(
'
no handler found
'
));
...
...
@@ -167,7 +168,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
return
asWinJsPromise
(
token
=>
handler
.
provideDebugConfigurations
(
this
.
getFolder
(
folderUri
),
token
));
}
public
$resolveDebugConfiguration
(
handle
:
number
,
folderUri
:
U
RI
|
undefined
,
debugConfiguration
:
vscode
.
DebugConfiguration
):
TPromise
<
vscode
.
DebugConfiguration
>
{
public
$resolveDebugConfiguration
(
handle
:
number
,
folderUri
:
U
riComponents
|
undefined
,
debugConfiguration
:
vscode
.
DebugConfiguration
):
TPromise
<
vscode
.
DebugConfiguration
>
{
let
handler
=
this
.
_handlers
.
get
(
handle
);
if
(
!
handler
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
>
(
new
Error
(
'
no handler found
'
));
...
...
@@ -232,10 +233,11 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
this
.
_onDidReceiveDebugSessionCustomEvent
.
fire
(
ee
);
}
private
getFolder
(
folderUri
:
URI
|
undefined
)
{
if
(
folderUri
)
{
private
getFolder
(
_folderUri
:
UriComponents
|
undefined
)
{
if
(
_folderUri
)
{
const
folderUriString
=
URI
.
revive
(
_folderUri
).
toString
();
const
folders
=
this
.
_workspace
.
getWorkspaceFolders
();
const
found
=
folders
.
filter
(
f
=>
f
.
uri
.
toString
()
===
folderUri
.
toString
()
);
const
found
=
folders
.
filter
(
f
=>
f
.
uri
.
toString
()
===
folderUri
String
);
if
(
found
&&
found
.
length
>
0
)
{
return
found
[
0
];
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录