Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
53df86ad
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,发现更多精彩内容 >>
提交
53df86ad
编写于
2月 08, 2018
作者:
A
Alex Dima
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use URI for the SCM part of the protocol
上级
40e59c8d
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
17 addition
and
17 deletion
+17
-17
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
+6
-6
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
+8
-8
未找到文件。
src/vs/workbench/api/electron-browser/mainThreadSCM.ts
浏览文件 @
53df86ad
...
...
@@ -6,7 +6,7 @@
'
use strict
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
Event
,
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
IDisposable
,
dispose
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -212,7 +212,7 @@ class MainThreadSCMProvider implements ISCMProvider {
this
.
handle
,
groupHandle
,
handle
,
URI
.
pars
e
(
sourceUri
),
URI
.
reviv
e
(
sourceUri
),
group
,
decorations
);
...
...
@@ -241,8 +241,8 @@ class MainThreadSCMProvider implements ISCMProvider {
return
TPromise
.
as
(
null
);
}
return
this
.
proxy
.
$provideOriginalResource
(
this
.
handle
,
uri
.
toString
()
)
.
then
(
result
=>
result
&&
URI
.
pars
e
(
result
));
return
this
.
proxy
.
$provideOriginalResource
(
this
.
handle
,
uri
)
.
then
(
result
=>
result
&&
URI
.
reviv
e
(
result
));
}
toJSON
():
any
{
...
...
@@ -284,8 +284,8 @@ export class MainThreadSCM implements MainThreadSCMShape {
this
.
_disposables
=
dispose
(
this
.
_disposables
);
}
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
,
rootUri
:
string
|
undefined
):
void
{
const
provider
=
new
MainThreadSCMProvider
(
this
.
_proxy
,
handle
,
id
,
label
,
rootUri
&&
URI
.
pars
e
(
rootUri
),
this
.
scmService
);
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
,
rootUri
:
UriComponents
|
undefined
):
void
{
const
provider
=
new
MainThreadSCMProvider
(
this
.
_proxy
,
handle
,
id
,
label
,
rootUri
&&
URI
.
reviv
e
(
rootUri
),
this
.
scmService
);
const
repository
=
this
.
scmService
.
registerSCMProvider
(
provider
);
this
.
_repositories
[
handle
]
=
repository
;
...
...
src/vs/workbench/api/node/extHost.protocol.ts
浏览文件 @
53df86ad
...
...
@@ -395,7 +395,7 @@ export interface SCMGroupFeatures {
export
type
SCMRawResource
=
[
number
/*handle*/
,
string
/*resourceUri*/
,
UriComponents
/*resourceUri*/
,
string
[]
/*icons: light, dark*/
,
string
/*tooltip*/
,
boolean
/*strike through*/
,
...
...
@@ -418,7 +418,7 @@ export type SCMRawResourceSplices = [
];
export
interface
MainThreadSCMShape
extends
IDisposable
{
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
,
rootUri
:
string
|
undefined
):
void
;
$registerSourceControl
(
handle
:
number
,
id
:
string
,
label
:
string
,
rootUri
:
UriComponents
|
undefined
):
void
;
$updateSourceControl
(
handle
:
number
,
features
:
SCMProviderFeatures
):
void
;
$unregisterSourceControl
(
handle
:
number
):
void
;
...
...
@@ -691,7 +691,7 @@ export interface ExtHostTerminalServiceShape {
}
export
interface
ExtHostSCMShape
{
$provideOriginalResource
(
sourceControlHandle
:
number
,
uri
:
string
):
TPromise
<
string
>
;
$provideOriginalResource
(
sourceControlHandle
:
number
,
uri
:
UriComponents
):
TPromise
<
UriComponents
>
;
$onInputBoxValueChange
(
sourceControlHandle
:
number
,
value
:
string
):
TPromise
<
void
>
;
$executeResourceCommand
(
sourceControlHandle
:
number
,
groupHandle
:
number
,
handle
:
number
):
TPromise
<
void
>
;
$validateInput
(
sourceControlHandle
:
number
,
value
:
string
,
cursorPosition
:
number
):
TPromise
<
[
string
,
number
]
|
undefined
>
;
...
...
src/vs/workbench/api/node/extHostSCM.ts
浏览文件 @
53df86ad
...
...
@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
URI
,
{
UriComponents
}
from
'
vs/base/common/uri
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
Event
,
{
Emitter
,
once
}
from
'
vs/base/common/event
'
;
import
{
debounce
}
from
'
vs/base/common/decorators
'
;
...
...
@@ -256,7 +256,7 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const
handle
=
this
.
_resourceHandlePool
++
;
this
.
_resourceStatesMap
.
set
(
handle
,
r
);
const
sourceUri
=
r
.
resourceUri
.
toString
()
;
const
sourceUri
=
r
.
resourceUri
;
const
iconPath
=
getIconPath
(
r
.
decorations
);
const
lightIconPath
=
r
.
decorations
&&
getIconPath
(
r
.
decorations
.
light
)
||
iconPath
;
const
darkIconPath
=
r
.
decorations
&&
getIconPath
(
r
.
decorations
.
dark
)
||
iconPath
;
...
...
@@ -282,7 +282,7 @@ class ExtHostSourceControlResourceGroup implements vscode.SourceControlResourceG
const
letter
=
r
.
decorations
&&
r
.
decorations
.
letter
||
undefined
;
const
color
=
r
.
decorations
&&
r
.
decorations
.
color
||
undefined
;
const
rawResource
=
[
handle
,
sourceUri
,
icons
,
tooltip
,
strikeThrough
,
faded
,
source
,
letter
,
color
]
as
SCMRawResource
;
const
rawResource
=
[
handle
,
<
UriComponents
>
sourceUri
,
icons
,
tooltip
,
strikeThrough
,
faded
,
source
,
letter
,
color
]
as
SCMRawResource
;
return
{
rawResource
,
handle
};
});
...
...
@@ -406,7 +406,7 @@ class ExtHostSourceControl implements vscode.SourceControl {
private
_rootUri
?:
vscode
.
Uri
)
{
this
.
_inputBox
=
new
ExtHostSCMInputBox
(
_extension
,
this
.
_proxy
,
this
.
handle
);
this
.
_proxy
.
$registerSourceControl
(
this
.
handle
,
_id
,
_label
,
_rootUri
&&
_rootUri
.
toString
()
);
this
.
_proxy
.
$registerSourceControl
(
this
.
handle
,
_id
,
_label
,
_rootUri
);
}
private
updatedResourceGroups
=
new
Set
<
ExtHostSourceControlResourceGroup
>
();
...
...
@@ -542,8 +542,9 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
inputBox
;
}
$provideOriginalResource
(
sourceControlHandle
:
number
,
uriString
:
string
):
TPromise
<
string
>
{
this
.
logService
.
trace
(
'
ExtHostSCM#$provideOriginalResource
'
,
sourceControlHandle
,
uriString
);
$provideOriginalResource
(
sourceControlHandle
:
number
,
uriComponents
:
UriComponents
):
TPromise
<
UriComponents
>
{
const
uri
=
URI
.
revive
(
uriComponents
);
this
.
logService
.
trace
(
'
ExtHostSCM#$provideOriginalResource
'
,
sourceControlHandle
,
uri
.
toString
());
const
sourceControl
=
this
.
_sourceControls
.
get
(
sourceControlHandle
);
...
...
@@ -551,8 +552,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
return
TPromise
.
as
(
null
);
}
return
asWinJsPromise
(
token
=>
sourceControl
.
quickDiffProvider
.
provideOriginalResource
(
URI
.
parse
(
uriString
),
token
))
.
then
(
result
=>
result
&&
result
.
toString
());
return
asWinJsPromise
(
token
=>
sourceControl
.
quickDiffProvider
.
provideOriginalResource
(
uri
,
token
));
}
$onInputBoxValueChange
(
sourceControlHandle
:
number
,
value
:
string
):
TPromise
<
void
>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录