Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
2b960fb0
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,发现更多精彩内容 >>
提交
2b960fb0
编写于
9月 06, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - remove TPromise from ExtHostDebug
上级
5c5877d6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
22 deletion
+22
-22
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
.../workbench/api/electron-browser/mainThreadDebugService.ts
+7
-7
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+7
-8
src/vs/workbench/api/node/extHostDebugService.ts
src/vs/workbench/api/node/extHostDebugService.ts
+8
-7
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadDebugService.ts
浏览文件 @
2b960fb0
...
...
@@ -68,11 +68,11 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
}
substituteVariables
(
folder
:
IWorkspaceFolder
,
config
:
IConfig
):
TPromise
<
IConfig
>
{
return
this
.
_proxy
.
$substituteVariables
(
folder
?
folder
.
uri
:
undefined
,
config
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$substituteVariables
(
folder
?
folder
.
uri
:
undefined
,
config
)
);
}
runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
TPromise
<
void
>
{
return
this
.
_proxy
.
$runInTerminal
(
args
,
config
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$runInTerminal
(
args
,
config
)
);
}
public
dispose
():
void
{
...
...
@@ -184,17 +184,17 @@ export class MainThreadDebugService implements MainThreadDebugServiceShape, IDeb
};
if
(
hasProvide
)
{
provider
.
provideDebugConfigurations
=
folder
=>
{
return
this
.
_proxy
.
$provideDebugConfigurations
(
handle
,
folder
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$provideDebugConfigurations
(
handle
,
folder
)
);
};
}
if
(
hasResolve
)
{
provider
.
resolveDebugConfiguration
=
(
folder
,
debugConfiguration
)
=>
{
return
this
.
_proxy
.
$resolveDebugConfiguration
(
handle
,
folder
,
debugConfiguration
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$resolveDebugConfiguration
(
handle
,
folder
,
debugConfiguration
)
);
};
}
if
(
hasDebugAdapterExecutable
)
{
provider
.
debugAdapterExecutable
=
(
folder
)
=>
{
return
this
.
_proxy
.
$debugAdapterExecutable
(
handle
,
folder
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$debugAdapterExecutable
(
handle
,
folder
)
);
};
}
this
.
debugService
.
getConfigurationManager
().
registerDebugConfigurationProvider
(
handle
,
provider
);
...
...
@@ -275,7 +275,7 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
}
public
startSession
():
TPromise
<
void
>
{
return
this
.
_proxy
.
$startDASession
(
this
.
_handle
,
this
.
_debugType
,
this
.
_adapterExecutable
,
this
.
_debugPort
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$startDASession
(
this
.
_handle
,
this
.
_debugType
,
this
.
_adapterExecutable
,
this
.
_debugPort
)
);
}
public
sendMessage
(
message
:
DebugProtocol
.
ProtocolMessage
):
void
{
...
...
@@ -292,6 +292,6 @@ class ExtensionHostDebugAdapter extends AbstractDebugAdapter {
}
public
stopSession
():
TPromise
<
void
>
{
return
this
.
_proxy
.
$stopDASession
(
this
.
_handle
);
return
TPromise
.
wrap
(
this
.
_proxy
.
$stopDASession
(
this
.
_handle
)
);
}
}
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
2b960fb0
...
...
@@ -8,7 +8,6 @@ import { SerializedError } from 'vs/base/common/errors';
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
Severity
from
'
vs/base/common/severity
'
;
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
TextEditorCursorStyle
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
IPosition
}
from
'
vs/editor/common/core/position
'
;
import
{
IRange
}
from
'
vs/editor/common/core/range
'
;
...
...
@@ -944,14 +943,14 @@ export interface ISourceMultiBreakpointDto {
}
export
interface
ExtHostDebugServiceShape
{
$substituteVariables
(
folder
:
UriComponents
|
undefined
,
config
:
IConfig
):
T
Promis
e
<
IConfig
>
;
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
T
Promis
e
<
void
>
;
$startDASession
(
handle
:
number
,
debugType
:
string
,
adapterExecutableInfo
:
IAdapterExecutable
|
null
,
debugPort
:
number
):
T
Promis
e
<
void
>
;
$stopDASession
(
handle
:
number
):
T
Promis
e
<
void
>
;
$substituteVariables
(
folder
:
UriComponents
|
undefined
,
config
:
IConfig
):
T
henabl
e
<
IConfig
>
;
$runInTerminal
(
args
:
DebugProtocol
.
RunInTerminalRequestArguments
,
config
:
ITerminalSettings
):
T
henabl
e
<
void
>
;
$startDASession
(
handle
:
number
,
debugType
:
string
,
adapterExecutableInfo
:
IAdapterExecutable
|
null
,
debugPort
:
number
):
T
henabl
e
<
void
>
;
$stopDASession
(
handle
:
number
):
T
henabl
e
<
void
>
;
$sendDAMessage
(
handle
:
number
,
message
:
DebugProtocol
.
ProtocolMessage
):
void
;
$resolveDebugConfiguration
(
handle
:
number
,
folder
:
UriComponents
|
undefined
,
debugConfiguration
:
IConfig
):
T
Promis
e
<
IConfig
>
;
$provideDebugConfigurations
(
handle
:
number
,
folder
:
UriComponents
|
undefined
):
T
Promis
e
<
IConfig
[]
>
;
$debugAdapterExecutable
(
handle
:
number
,
folder
:
UriComponents
|
undefined
):
T
Promis
e
<
IAdapterExecutable
>
;
$resolveDebugConfiguration
(
handle
:
number
,
folder
:
UriComponents
|
undefined
,
debugConfiguration
:
IConfig
):
T
henabl
e
<
IConfig
>
;
$provideDebugConfigurations
(
handle
:
number
,
folder
:
UriComponents
|
undefined
):
T
henabl
e
<
IConfig
[]
>
;
$debugAdapterExecutable
(
handle
:
number
,
folder
:
UriComponents
|
undefined
):
T
henabl
e
<
IAdapterExecutable
>
;
$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
;
...
...
src/vs/workbench/api/node/extHostDebugService.ts
浏览文件 @
2b960fb0
...
...
@@ -9,7 +9,7 @@ import { Schemas } from 'vs/base/common/network';
import
{
URI
,
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
as
WinJsPromis
e
}
from
'
vs/base/common/async
'
;
import
{
as
Thenabl
e
}
from
'
vs/base/common/async
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
MainContext
,
MainThreadDebugServiceShape
,
ExtHostDebugServiceShape
,
DebugSessionUUID
,
...
...
@@ -31,6 +31,7 @@ import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/co
import
{
ExtHostTerminalService
}
from
'
vs/workbench/api/node/extHostTerminalService
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IConfigurationResolverService
}
from
'
vs/workbench/services/configurationResolver/common/configurationResolver
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
export
class
ExtHostDebugService
implements
ExtHostDebugServiceShape
{
...
...
@@ -451,7 +452,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
});
}
public
$provideDebugConfigurations
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
):
T
Promis
e
<
vscode
.
DebugConfiguration
[]
>
{
public
$provideDebugConfigurations
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
):
T
henabl
e
<
vscode
.
DebugConfiguration
[]
>
{
let
handler
=
this
.
_handlers
.
get
(
handle
);
if
(
!
handler
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
[]
>
(
new
Error
(
'
no handler found
'
));
...
...
@@ -459,10 +460,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
if
(
!
handler
.
provideDebugConfigurations
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
[]
>
(
new
Error
(
'
handler has no method provideDebugConfigurations
'
));
}
return
as
WinJsPromise
(
token
=>
handler
.
provideDebugConfigurations
(
this
.
getFolder
(
folderUri
),
token
));
return
as
Thenable
(()
=>
handler
.
provideDebugConfigurations
(
this
.
getFolder
(
folderUri
),
CancellationToken
.
None
));
}
public
$resolveDebugConfiguration
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
,
debugConfiguration
:
vscode
.
DebugConfiguration
):
T
Promis
e
<
vscode
.
DebugConfiguration
>
{
public
$resolveDebugConfiguration
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
,
debugConfiguration
:
vscode
.
DebugConfiguration
):
T
henabl
e
<
vscode
.
DebugConfiguration
>
{
let
handler
=
this
.
_handlers
.
get
(
handle
);
if
(
!
handler
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
>
(
new
Error
(
'
no handler found
'
));
...
...
@@ -470,10 +471,10 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
if
(
!
handler
.
resolveDebugConfiguration
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugConfiguration
>
(
new
Error
(
'
handler has no method resolveDebugConfiguration
'
));
}
return
as
WinJsPromise
(
token
=>
handler
.
resolveDebugConfiguration
(
this
.
getFolder
(
folderUri
),
debugConfiguration
,
token
));
return
as
Thenable
(()
=>
handler
.
resolveDebugConfiguration
(
this
.
getFolder
(
folderUri
),
debugConfiguration
,
CancellationToken
.
None
));
}
public
$debugAdapterExecutable
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
):
T
Promis
e
<
vscode
.
DebugAdapterExecutable
>
{
public
$debugAdapterExecutable
(
handle
:
number
,
folderUri
:
UriComponents
|
undefined
):
T
henabl
e
<
vscode
.
DebugAdapterExecutable
>
{
let
handler
=
this
.
_handlers
.
get
(
handle
);
if
(
!
handler
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugAdapterExecutable
>
(
new
Error
(
'
no handler found
'
));
...
...
@@ -481,7 +482,7 @@ export class ExtHostDebugService implements ExtHostDebugServiceShape {
if
(
!
handler
.
debugAdapterExecutable
)
{
return
TPromise
.
wrapError
<
vscode
.
DebugAdapterExecutable
>
(
new
Error
(
'
handler has no method debugAdapterExecutable
'
));
}
return
as
WinJsPromise
(
token
=>
handler
.
debugAdapterExecutable
(
this
.
getFolder
(
folderUri
),
token
));
return
as
Thenable
(()
=>
handler
.
debugAdapterExecutable
(
this
.
getFolder
(
folderUri
),
CancellationToken
.
None
));
}
public
startDebugging
(
folder
:
vscode
.
WorkspaceFolder
|
undefined
,
nameOrConfig
:
string
|
vscode
.
DebugConfiguration
):
Thenable
<
boolean
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录