Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
4419709b
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,发现更多精彩内容 >>
提交
4419709b
编写于
9月 06, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - remove TPromise from ExtHostSCM and MainThreadSCM
上级
c2c5819f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
17 deletion
+19
-17
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+5
-4
src/vs/workbench/api/node/extHost.protocol.ts
src/vs/workbench/api/node/extHost.protocol.ts
+3
-3
src/vs/workbench/api/node/extHostSCM.ts
src/vs/workbench/api/node/extHostSCM.ts
+10
-9
src/vs/workbench/services/scm/common/scm.ts
src/vs/workbench/services/scm/common/scm.ts
+1
-1
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
4419709b
...
...
@@ -15,6 +15,7 @@ import { ExtHostContext, MainThreadSCMShape, ExtHostSCMShape, SCMProviderFeature
import
{
Command
}
from
'
vs/editor/common/modes
'
;
import
{
extHostNamedCustomer
}
from
'
vs/workbench/api/electron-browser/extHostCustomers
'
;
import
{
ISplice
,
Sequence
}
from
'
vs/base/common/sequence
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
class
MainThreadSCMResourceGroup
implements
ISCMResourceGroup
{
...
...
@@ -73,7 +74,7 @@ class MainThreadSCMResource implements ISCMResource {
public
decorations
:
ISCMResourceDecorations
)
{
}
open
():
T
Promis
e
<
void
>
{
open
():
T
henabl
e
<
void
>
{
return
this
.
proxy
.
$executeResourceCommand
(
this
.
sourceControlHandle
,
this
.
groupHandle
,
this
.
handle
);
}
...
...
@@ -241,7 +242,7 @@ class MainThreadSCMProvider implements ISCMProvider {
return
TPromise
.
as
(
null
);
}
return
this
.
proxy
.
$provideOriginalResource
(
this
.
handle
,
uri
)
return
TPromise
.
wrap
(
this
.
proxy
.
$provideOriginalResource
(
this
.
handle
,
uri
,
CancellationToken
.
None
)
)
.
then
(
result
=>
result
&&
URI
.
revive
(
result
));
}
...
...
@@ -405,7 +406,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
if
(
enabled
)
{
repository
.
input
.
validateInput
=
(
value
,
pos
):
TPromise
<
IInputValidation
|
undefined
>
=>
{
return
this
.
_proxy
.
$validateInput
(
sourceControlHandle
,
value
,
pos
).
then
(
result
=>
{
return
TPromise
.
wrap
(
this
.
_proxy
.
$validateInput
(
sourceControlHandle
,
value
,
pos
).
then
(
result
=>
{
if
(
!
result
)
{
return
undefined
;
}
...
...
@@ -414,7 +415,7 @@ export class MainThreadSCM implements MainThreadSCMShape {
message
:
result
[
0
],
type
:
result
[
1
]
};
});
})
)
;
};
}
else
{
repository
.
input
.
validateInput
=
()
=>
TPromise
.
as
(
undefined
);
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
4419709b
...
...
@@ -886,10 +886,10 @@ export interface ExtHostTerminalServiceShape {
}
export
interface
ExtHostSCMShape
{
$provideOriginalResource
(
sourceControlHandle
:
number
,
uri
:
UriComponents
):
TPromis
e
<
UriComponents
>
;
$provideOriginalResource
(
sourceControlHandle
:
number
,
uri
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
UriComponents
>
;
$onInputBoxValueChange
(
sourceControlHandle
:
number
,
value
:
string
):
void
;
$executeResourceCommand
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
handle
:
number
):
T
Promis
e
<
void
>
;
$validateInput
(
sourceControlHandle
:
number
,
value
:
string
,
cursorPosition
:
number
):
T
Promis
e
<
[
string
,
number
]
|
undefined
>
;
$executeResourceCommand
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
handle
:
number
):
T
henabl
e
<
void
>
;
$validateInput
(
sourceControlHandle
:
number
,
value
:
string
,
cursorPosition
:
number
):
T
henabl
e
<
[
string
,
number
]
|
undefined
>
;
$setSelectedSourceControls
(
selectedSourceControlHandles
:
number
[]):
Thenable
<
void
>
;
}
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
4419709b
...
...
@@ -9,7 +9,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
{
Event
,
Emitter
,
once
}
from
'
vs/base/common/event
'
;
import
{
debounce
}
from
'
vs/base/common/decorators
'
;
import
{
dispose
,
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
as
WinJsPromis
e
}
from
'
vs/base/common/async
'
;
import
{
as
Thenabl
e
}
from
'
vs/base/common/async
'
;
import
{
IExtensionDescription
}
from
'
vs/workbench/services/extensions/common/extensions
'
;
import
{
ExtHostCommands
}
from
'
vs/workbench/api/node/extHostCommands
'
;
import
{
MainContext
,
MainThreadSCMShape
,
SCMRawResource
,
SCMRawResourceSplice
,
SCMRawResourceSplices
,
IMainContext
,
ExtHostSCMShape
}
from
'
./extHost.protocol
'
;
...
...
@@ -18,6 +18,7 @@ import { comparePaths } from 'vs/base/common/comparers';
import
*
as
vscode
from
'
vscode
'
;
import
{
ISplice
}
from
'
vs/base/common/sequence
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
import
{
CancellationToken
}
from
'
vs/base/common/cancellation
'
;
type
ProviderHandle
=
number
;
type
GroupHandle
=
number
;
...
...
@@ -237,14 +238,14 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
return
this
.
_resourceStatesMap
.
get
(
handle
);
}
$executeResourceCommand
(
handle
:
number
):
T
Promis
e
<
void
>
{
$executeResourceCommand
(
handle
:
number
):
T
henabl
e
<
void
>
{
const
command
=
this
.
_resourceStatesCommandsMap
.
get
(
handle
);
if
(
!
command
)
{
return
TPromise
.
as
(
null
);
return
Promise
.
resolve
(
null
);
}
return
as
WinJsPromise
(
_
=>
this
.
_commands
.
executeCommand
(
command
.
command
,
...
command
.
arguments
));
return
as
Thenable
(()
=>
this
.
_commands
.
executeCommand
(
command
.
command
,
...
command
.
arguments
));
}
_takeResourceStateSnapshot
():
SCMRawResourceSplice
[]
{
...
...
@@ -558,7 +559,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
inputBox
;
}
$provideOriginalResource
(
sourceControlHandle
:
number
,
uriComponents
:
UriComponents
):
TPromis
e
<
UriComponents
>
{
$provideOriginalResource
(
sourceControlHandle
:
number
,
uriComponents
:
UriComponents
,
token
:
CancellationToken
):
Thenabl
e
<
UriComponents
>
{
const
uri
=
URI
.
revive
(
uriComponents
);
this
.
logService
.
trace
(
'
ExtHostSCM#$provideOriginalResource
'
,
sourceControlHandle
,
uri
.
toString
());
...
...
@@ -568,7 +569,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
TPromise
.
as
(
null
);
}
return
as
WinJsPromise
(
token
=>
sourceControl
.
quickDiffProvider
.
provideOriginalResource
(
uri
,
token
));
return
as
Thenable
(()
=>
sourceControl
.
quickDiffProvider
.
provideOriginalResource
(
uri
,
token
));
}
$onInputBoxValueChange
(
sourceControlHandle
:
number
,
value
:
string
):
TPromise
<
void
>
{
...
...
@@ -584,7 +585,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
TPromise
.
as
(
null
);
}
$executeResourceCommand
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
handle
:
number
):
T
Promis
e
<
void
>
{
$executeResourceCommand
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
handle
:
number
):
T
henabl
e
<
void
>
{
this
.
logService
.
trace
(
'
ExtHostSCM#$executeResourceCommand
'
,
sourceControlHandle
,
groupHandle
,
handle
);
const
sourceControl
=
this
.
_sourceControls
.
get
(
sourceControlHandle
);
...
...
@@ -602,7 +603,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
group
.
$executeResourceCommand
(
handle
);
}
$validateInput
(
sourceControlHandle
:
number
,
value
:
string
,
cursorPosition
:
number
):
T
Promis
e
<
[
string
,
number
]
|
undefined
>
{
$validateInput
(
sourceControlHandle
:
number
,
value
:
string
,
cursorPosition
:
number
):
T
henabl
e
<
[
string
,
number
]
|
undefined
>
{
this
.
logService
.
trace
(
'
ExtHostSCM#$validateInput
'
,
sourceControlHandle
);
const
sourceControl
=
this
.
_sourceControls
.
get
(
sourceControlHandle
);
...
...
@@ -615,7 +616,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
TPromise
.
as
(
undefined
);
}
return
as
WinJsPromise
(
_
=>
Promise
.
resolve
(
sourceControl
.
inputBox
.
validateInput
(
value
,
cursorPosition
)
)).
then
(
result
=>
{
return
as
Thenable
(()
=>
sourceControl
.
inputBox
.
validateInput
(
value
,
cursorPosition
)).
then
(
result
=>
{
if
(
!
result
)
{
return
TPromise
.
as
(
undefined
);
}
...
...
src/vs/workbench/services/scm/common/scm.ts
浏览文件 @
4419709b
...
...
@@ -36,7 +36,7 @@ export interface ISCMResource {
readonly
resourceGroup
:
ISCMResourceGroup
;
readonly
sourceUri
:
URI
;
readonly
decorations
:
ISCMResourceDecorations
;
open
():
T
Promis
e
<
void
>
;
open
():
T
henabl
e
<
void
>
;
}
export
interface
ISCMResourceGroup
extends
ISequence
<
ISCMResource
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录