Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
eeaaa17d
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,发现更多精彩内容 >>
提交
eeaaa17d
编写于
3月 05, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
- show resolved content on click
- action to show full content
上级
d23e8a3c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
16 deletion
+60
-16
src/vs/platform/userDataSync/common/extensionsSync.ts
src/vs/platform/userDataSync/common/extensionsSync.ts
+15
-0
src/vs/platform/userDataSync/common/globalStateSync.ts
src/vs/platform/userDataSync/common/globalStateSync.ts
+15
-0
src/vs/workbench/contrib/userDataSync/browser/userDataSyncHistory.ts
...bench/contrib/userDataSync/browser/userDataSyncHistory.ts
+30
-16
未找到文件。
src/vs/platform/userDataSync/common/extensionsSync.ts
浏览文件 @
eeaaa17d
...
...
@@ -120,6 +120,21 @@ export class ExtensionsSynchroniser extends AbstractSynchroniser implements IUse
async
stop
():
Promise
<
void
>
{
}
async
getRemoteContent
(
ref
?:
string
,
fragment
?:
string
):
Promise
<
string
|
null
>
{
const
content
=
await
super
.
getRemoteContent
(
ref
);
if
(
content
!==
null
&&
fragment
)
{
const
syncData
=
this
.
parseSyncData
(
content
);
if
(
syncData
)
{
switch
(
fragment
)
{
case
'
extensions
'
:
return
syncData
.
content
;
}
}
return
null
;
}
return
content
;
}
accept
(
content
:
string
):
Promise
<
void
>
{
throw
new
Error
(
'
Extensions: Conflicts should not occur
'
);
}
...
...
src/vs/platform/userDataSync/common/globalStateSync.ts
浏览文件 @
eeaaa17d
...
...
@@ -104,6 +104,21 @@ export class GlobalStateSynchroniser extends AbstractSynchroniser implements IUs
async
stop
():
Promise
<
void
>
{
}
async
getRemoteContent
(
ref
?:
string
,
fragment
?:
string
):
Promise
<
string
|
null
>
{
let
content
=
await
super
.
getRemoteContent
(
ref
);
if
(
content
!==
null
&&
fragment
)
{
const
syncData
=
this
.
parseSyncData
(
content
);
if
(
syncData
)
{
switch
(
fragment
)
{
case
'
globalState
'
:
return
syncData
.
content
;
}
}
return
null
;
}
return
content
;
}
accept
(
content
:
string
):
Promise
<
void
>
{
throw
new
Error
(
'
UI State: Conflicts should not occur
'
);
}
...
...
src/vs/workbench/contrib/userDataSync/browser/userDataSyncHistory.ts
浏览文件 @
eeaaa17d
...
...
@@ -81,13 +81,34 @@ export class UserDataSyncHistoryViewContribution implements IWorkbenchContributi
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
'
workbench.actions.
open
Ref
'
,
title
:
localize
(
'
workbench.action
.openRef
'
,
"
Open
Ref
"
),
id
:
'
workbench.actions.
sync.resolveResource
Ref
'
,
title
:
localize
(
'
workbench.action
s.sync.resolveResourceRef
'
,
"
Resolve Resource
Ref
"
),
});
}
async
run
(
accessor
:
ServicesAccessor
,
resource
:
URI
):
Promise
<
void
>
{
async
run
(
accessor
:
ServicesAccessor
,
handle
:
TreeViewItemHandleArg
):
Promise
<
void
>
{
const
editorService
=
accessor
.
get
(
IEditorService
);
let
resource
=
URI
.
parse
(
handle
.
$treeItemHandle
);
const
result
=
resolveSyncResource
(
resource
);
if
(
result
)
{
resource
=
resource
.
with
({
fragment
:
result
.
resourceKey
});
await
editorService
.
openEditor
({
resource
});
}
}
});
registerAction2
(
class
extends
Action2
{
constructor
()
{
super
({
id
:
'
workbench.actions.sync.resolveResourceRefCompletely
'
,
title
:
localize
(
'
workbench.actions.sync.resolveResourceRefCompletely
'
,
"
Show full content
"
),
menu
:
{
id
:
MenuId
.
ViewItemContext
,
when
:
ContextKeyExpr
.
and
(
ContextKeyEqualsExpr
.
create
(
'
view
'
,
that
.
viewId
),
ContextKeyExpr
.
regex
(
'
viewItem
'
,
/syncref-.*/i
))
},
});
}
async
run
(
accessor
:
ServicesAccessor
,
handle
:
TreeViewItemHandleArg
):
Promise
<
void
>
{
const
editorService
=
accessor
.
get
(
IEditorService
);
await
editorService
.
openEditor
({
resource
});
await
editorService
.
openEditor
({
resource
:
URI
.
parse
(
handle
.
$treeItemHandle
)
});
}
});
registerAction2
(
class
extends
Action2
{
...
...
@@ -107,15 +128,8 @@ export class UserDataSyncHistoryViewContribution implements IWorkbenchContributi
const
resource
=
URI
.
parse
(
handle
.
$treeItemHandle
);
const
result
=
resolveSyncResource
(
resource
);
if
(
result
)
{
let
leftResource
:
URI
;
let
rightResource
:
URI
;
if
(
result
.
resourceKey
===
'
settings
'
)
{
leftResource
=
resource
.
with
({
fragment
:
'
settings
'
});
rightResource
=
environmentService
.
settingsResource
;
}
else
{
leftResource
=
resource
.
with
({
fragment
:
'
keybindings
'
});
rightResource
=
environmentService
.
keybindingsResource
;
}
const
leftResource
:
URI
=
resource
.
with
({
fragment
:
result
.
resourceKey
});
const
rightResource
:
URI
=
result
.
resourceKey
===
'
settings
'
?
environmentService
.
settingsResource
:
environmentService
.
keybindingsResource
;
await
editorService
.
openEditor
({
leftResource
,
rightResource
,
...
...
@@ -157,12 +171,12 @@ class UserDataSyncHistoryViewDataProvider implements ITreeViewDataProvider {
if
(
resourceKey
)
{
const
refs
=
await
this
.
userDataSyncStoreService
.
getAllRefs
(
resourceKey
);
return
refs
.
map
(
ref
=>
{
const
resourceUri
=
toSyncResource
(
resourceKey
,
ref
);
const
handle
=
toSyncResource
(
resourceKey
,
ref
).
toString
(
);
return
{
handle
:
resourceUri
.
toString
()
,
handle
,
collapsibleState
:
TreeItemCollapsibleState
.
None
,
label
:
{
label
:
ref
},
command
:
{
id
:
'
workbench.actions.
openRef
'
,
title
:
''
,
arguments
:
[
resourceUri
]
},
command
:
{
id
:
'
workbench.actions.
sync.resolveResourceRef
'
,
title
:
''
,
arguments
:
[
<
TreeViewItemHandleArg
>
{
$treeItemHandle
:
handle
,
$treeViewId
:
''
}
]
},
themeIcon
:
FileThemeIcon
,
contextValue
:
`syncref-
${
resourceKey
}
`
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录