Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
67bd821c
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,发现更多精彩内容 >>
提交
67bd821c
编写于
9月 16, 2020
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
control selecting settings service through canSwitch property
上级
f3bf1d17
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
27 addition
and
16 deletion
+27
-16
src/vs/platform/product/common/productService.ts
src/vs/platform/product/common/productService.ts
+3
-2
src/vs/platform/userDataSync/common/userDataSync.ts
src/vs/platform/userDataSync/common/userDataSync.ts
+3
-2
src/vs/platform/userDataSync/common/userDataSyncStoreService.ts
.../platform/userDataSync/common/userDataSyncStoreService.ts
+8
-6
src/vs/platform/userDataSync/test/common/userDataSyncClient.ts
...s/platform/userDataSync/test/common/userDataSyncClient.ts
+3
-0
src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts
...userDataSync/test/common/userDataSyncStoreService.test.ts
+6
-2
src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts
...vs/workbench/contrib/userDataSync/browser/userDataSync.ts
+2
-2
src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts
...ices/userDataSync/browser/userDataSyncWorkbenchService.ts
+1
-2
src/vs/workbench/services/userDataSync/electron-browser/userDataSyncStoreManagementService.ts
...nc/electron-browser/userDataSyncStoreManagementService.ts
+1
-0
未找到文件。
src/vs/platform/product/common/productService.ts
浏览文件 @
67bd821c
...
...
@@ -24,8 +24,9 @@ export interface IBuiltInExtension {
export
type
ConfigurationSyncStore
=
{
url
:
string
,
insidersUrl
?:
string
,
stableUrl
?:
string
,
insidersUrl
:
string
,
stableUrl
:
string
,
canSwitch
:
boolean
,
authenticationProviders
:
IStringDictionary
<
{
scopes
:
string
[]
}
>
};
...
...
src/vs/platform/userDataSync/common/userDataSync.ts
浏览文件 @
67bd821c
...
...
@@ -120,8 +120,9 @@ export type IAuthenticationProvider = { id: string, scopes: string[] };
export
interface
IUserDataSyncStore
{
readonly
url
:
URI
;
readonly
defaultUrl
:
URI
;
readonly
stableUrl
:
URI
|
undefined
;
readonly
insidersUrl
:
URI
|
undefined
;
readonly
stableUrl
:
URI
;
readonly
insidersUrl
:
URI
;
readonly
canSwitch
:
boolean
;
readonly
authenticationProviders
:
IAuthenticationProvider
[];
}
...
...
src/vs/platform/userDataSync/common/userDataSyncStoreService.ts
浏览文件 @
67bd821c
...
...
@@ -57,15 +57,17 @@ export abstract class AbstractUserDataSyncStoreManagementService extends Disposa
const
syncStore
=
value
as
ConfigurationSyncStore
;
const
type
:
UserDataSyncStoreType
|
undefined
=
this
.
storageService
.
get
(
SYNC_SERVICE_URL_TYPE
,
StorageScope
.
GLOBAL
)
as
UserDataSyncStoreType
|
undefined
;
const
url
=
configuredStore
?.
url
||
(
type
===
'
insiders
'
?
syncStore
.
insidersUrl
:
type
===
'
stable
'
?
syncStore
.
stableUrl
:
undefined
)
||
syncStore
.
url
;
||
type
===
'
insiders
'
?
syncStore
.
insidersUrl
:
type
===
'
stable
'
?
syncStore
.
stableUrl
:
syncStore
.
url
;
return
{
url
:
URI
.
parse
(
url
),
type
,
defaultType
:
syncStore
.
url
===
syncStore
.
insidersUrl
?
'
insiders
'
:
syncStore
.
url
===
syncStore
.
stableUrl
?
'
stable
'
:
undefined
,
defaultUrl
:
URI
.
parse
(
syncStore
.
url
),
stableUrl
:
syncStore
.
stableUrl
?
URI
.
parse
(
syncStore
.
stableUrl
)
:
undefined
,
insidersUrl
:
syncStore
.
insidersUrl
?
URI
.
parse
(
syncStore
.
insidersUrl
)
:
undefined
,
stableUrl
:
URI
.
parse
(
syncStore
.
stableUrl
),
insidersUrl
:
URI
.
parse
(
syncStore
.
insidersUrl
),
canSwitch
:
!!
syncStore
.
canSwitch
,
authenticationProviders
:
Object
.
keys
(
syncStore
.
authenticationProviders
).
reduce
<
IAuthenticationProvider
[]
>
((
result
,
id
)
=>
{
result
.
push
({
id
,
scopes
:
syncStore
!
.
authenticationProviders
[
id
].
scopes
});
return
result
;
...
...
@@ -110,8 +112,8 @@ export class UserDataSyncStoreManagementService extends AbstractUserDataSyncStor
}
async
switch
(
type
:
UserDataSyncStoreType
):
Promise
<
void
>
{
if
(
t
ype
!==
this
.
userDataSyncStore
?
.
type
)
{
if
(
type
===
this
.
userDataSyncStore
?
.
defaultType
)
{
if
(
t
his
.
userDataSyncStore
?.
canSwitch
&&
type
!==
this
.
userDataSyncStore
.
type
)
{
if
(
type
===
this
.
userDataSyncStore
.
defaultType
)
{
this
.
storageService
.
remove
(
SYNC_SERVICE_URL_TYPE
,
StorageScope
.
GLOBAL
);
}
else
{
this
.
storageService
.
store
(
SYNC_SERVICE_URL_TYPE
,
type
,
StorageScope
.
GLOBAL
);
...
...
src/vs/platform/userDataSync/test/common/userDataSyncClient.ts
浏览文件 @
67bd821c
...
...
@@ -69,6 +69,9 @@ export class UserDataSyncClient extends Disposable {
_serviceBrand
:
undefined
,
...
product
,
...{
'
configurationSync.store
'
:
{
url
:
this
.
testServer
.
url
,
stableUrl
:
this
.
testServer
.
url
,
insidersUrl
:
this
.
testServer
.
url
,
canSwitch
:
false
,
authenticationProviders
:
{
'
test
'
:
{
scopes
:
[]
}
}
}
}
...
...
src/vs/platform/userDataSync/test/common/userDataSyncStoreService.test.ts
浏览文件 @
67bd821c
...
...
@@ -39,6 +39,9 @@ suite('UserDataSyncStoreManagementService', () => {
const
configuredStore
:
ConfigurationSyncStore
=
{
url
:
'
http://configureHost:3000
'
,
stableUrl
:
'
http://configureHost:3000
'
,
insidersUrl
:
'
http://configureHost:3000
'
,
canSwitch
:
false
,
authenticationProviders
:
{
'
configuredAuthProvider
'
:
{
scopes
:
[]
}
}
};
await
client
.
instantiationService
.
get
(
IFileService
).
writeFile
(
client
.
instantiationService
.
get
(
IEnvironmentService
).
settingsResource
,
VSBuffer
.
fromString
(
JSON
.
stringify
({
...
...
@@ -49,8 +52,9 @@ suite('UserDataSyncStoreManagementService', () => {
const
expected
:
IUserDataSyncStore
=
{
url
:
URI
.
parse
(
'
http://configureHost:3000
'
),
defaultUrl
:
URI
.
parse
(
'
http://configureHost:3000
'
),
stableUrl
:
undefined
,
insidersUrl
:
undefined
,
stableUrl
:
URI
.
parse
(
'
http://configureHost:3000
'
),
insidersUrl
:
URI
.
parse
(
'
http://configureHost:3000
'
),
canSwitch
:
false
,
authenticationProviders
:
[{
id
:
'
configuredAuthProvider
'
,
scopes
:
[]
}]
};
...
...
src/vs/workbench/contrib/userDataSync/browser/userDataSync.ts
浏览文件 @
67bd821c
...
...
@@ -676,7 +676,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
private
async
switchSyncService
():
Promise
<
void
>
{
const
userDataSyncStore
=
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
;
if
(
userDataSyncStore
?.
insidersUrl
&&
userDataSyncStore
?.
stableUrl
&&
!
[
userDataSyncStore
.
insidersUrl
,
userDataSyncStore
.
stableUrl
].
includes
(
userDataSyncStore
.
url
))
{
if
(
userDataSyncStore
?.
canSwitch
&&
!
[
userDataSyncStore
.
insidersUrl
,
userDataSyncStore
.
stableUrl
].
includes
(
userDataSyncStore
.
url
))
{
return
new
Promise
<
void
>
((
c
,
e
)
=>
{
const
disposables
:
DisposableStore
=
new
DisposableStore
();
const
quickPick
=
disposables
.
add
(
this
.
quickInputService
.
createQuickPick
<
{
id
:
UserDataSyncStoreType
,
label
:
string
,
description
?:
string
}
>
());
...
...
@@ -1120,7 +1120,7 @@ export class UserDataSyncWorkbenchContribution extends Disposable implements IWo
private
registerSwitchSyncServiceAction
():
void
{
const
that
=
this
;
const
userDataSyncStore
=
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
;
if
(
userDataSyncStore
?.
insidersUrl
&&
userDataSyncStore
?.
stableUrl
&&
!
[
userDataSyncStore
.
insidersUrl
,
userDataSyncStore
.
stableUrl
].
includes
(
userDataSyncStore
.
url
))
{
if
(
userDataSyncStore
?.
canSwitch
&&
!
[
userDataSyncStore
.
insidersUrl
,
userDataSyncStore
.
stableUrl
].
includes
(
userDataSyncStore
.
url
))
{
this
.
_register
(
registerAction2
(
class
ShowSyncSettingsAction
extends
Action2
{
constructor
()
{
super
({
...
...
src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts
浏览文件 @
67bd821c
...
...
@@ -446,8 +446,7 @@ export class UserDataSyncWorkbenchService extends Disposable implements IUserDat
async
switchSyncService
(
type
:
UserDataSyncStoreType
):
Promise
<
void
>
{
if
(
!
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
||
!
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
.
insidersUrl
||
!
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
.
stableUrl
)
{
||
!
this
.
userDataSyncStoreManagementService
.
userDataSyncStore
.
canSwitch
)
{
return
;
}
await
this
.
userDataSyncStoreManagementService
.
switch
(
type
);
...
...
src/vs/workbench/services/userDataSync/electron-browser/userDataSyncStoreManagementService.ts
浏览文件 @
67bd821c
...
...
@@ -42,6 +42,7 @@ class UserDataSyncStoreManagementService extends AbstractUserDataSyncStoreManage
defaultUrl
:
URI
.
revive
(
userDataSyncStore
.
defaultUrl
),
insidersUrl
:
URI
.
revive
(
userDataSyncStore
.
insidersUrl
),
stableUrl
:
URI
.
revive
(
userDataSyncStore
.
stableUrl
),
canSwitch
:
userDataSyncStore
.
canSwitch
,
authenticationProviders
:
userDataSyncStore
.
authenticationProviders
,
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录