Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
bbf7f6ce
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,发现更多精彩内容 >>
提交
bbf7f6ce
编写于
3月 25, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
storage sync - adopt a few to be syced (#93332)
上级
daa4a618
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
22 addition
and
6 deletion
+22
-6
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
+7
-1
src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts
...contrib/files/browser/editors/textFileSaveErrorHandler.ts
+6
-1
src/vs/workbench/services/workspaces/browser/workspacesService.ts
...orkbench/services/workspaces/browser/workspacesService.ts
+9
-4
未找到文件。
src/vs/platform/quickinput/browser/commandsQuickAccess.ts
浏览文件 @
bbf7f6ce
...
...
@@ -21,6 +21,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import
{
isPromiseCanceledError
}
from
'
vs/base/common/errors
'
;
import
{
INotificationService
}
from
'
vs/platform/notification/common/notification
'
;
import
{
toErrorMessage
}
from
'
vs/base/common/errorMessage
'
;
import
{
IStorageKeysSyncRegistryService
}
from
'
vs/platform/userDataSync/common/storageKeys
'
;
export
interface
ICommandQuickPick
extends
IPickerQuickAccessItem
{
commandId
:
string
;
...
...
@@ -202,10 +203,15 @@ export class CommandsHistory extends Disposable {
constructor
(
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
@
IConfigurationService
private
readonly
configurationService
:
IConfigurationService
,
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
)
{
super
();
// opt-in to syncing
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
CommandsHistory
.
PREF_KEY_CACHE
,
version
:
1
});
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
CommandsHistory
.
PREF_KEY_COUNTER
,
version
:
1
});
this
.
updateConfiguration
();
this
.
load
();
...
...
src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.ts
浏览文件 @
bbf7f6ce
...
...
@@ -32,6 +32,7 @@ import { isWindows } from 'vs/base/common/platform';
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
IPreferencesService
}
from
'
vs/workbench/services/preferences/common/preferences
'
;
import
{
SaveReason
}
from
'
vs/workbench/common/editor
'
;
import
{
IStorageKeysSyncRegistryService
}
from
'
vs/platform/userDataSync/common/storageKeys
'
;
export
const
CONFLICT_RESOLUTION_CONTEXT
=
'
saveConflictResolutionContext
'
;
export
const
CONFLICT_RESOLUTION_SCHEME
=
'
conflictResolution
'
;
...
...
@@ -53,10 +54,14 @@ export class TextFileSaveErrorHandler extends Disposable implements ISaveErrorHa
@
IEditorService
private
readonly
editorService
:
IEditorService
,
@
ITextModelService
textModelService
:
ITextModelService
,
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
@
IStorageService
private
readonly
storageService
:
IStorageService
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
)
{
super
();
// opt-in to syncing
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
LEARN_MORE_DIRTY_WRITE_IGNORE_KEY
,
version
:
1
});
this
.
messages
=
new
ResourceMap
<
INotificationHandle
>
();
this
.
conflictResolutionContext
=
new
RawContextKey
<
boolean
>
(
CONFLICT_RESOLUTION_CONTEXT
,
false
).
bindTo
(
contextKeyService
);
...
...
src/vs/workbench/services/workspaces/browser/workspacesService.ts
浏览文件 @
bbf7f6ce
...
...
@@ -6,7 +6,7 @@
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
IWorkspacesService
,
IWorkspaceFolderCreationData
,
IWorkspaceIdentifier
,
IEnterWorkspaceResult
,
IRecentlyOpened
,
restoreRecentlyOpened
,
IRecent
,
isRecentFile
,
isRecentFolder
,
toStoreData
,
IStoredWorkspaceFolder
,
getStoredWorkspaceFolder
,
WORKSPACE_EXTENSION
,
IStoredWorkspace
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
URI
}
from
'
vs/base/common/uri
'
;
import
{
E
vent
,
E
mitter
}
from
'
vs/base/common/event
'
;
import
{
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IStorageService
,
StorageScope
}
from
'
vs/platform/storage/common/storage
'
;
import
{
IWorkspaceContextService
,
WorkbenchState
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
ILogService
}
from
'
vs/platform/log/common/log
'
;
...
...
@@ -16,6 +16,7 @@ import { IFileService, FileOperationError, FileOperationResult } from 'vs/platfo
import
{
IWorkbenchEnvironmentService
}
from
'
vs/workbench/services/environment/common/environmentService
'
;
import
{
joinPath
}
from
'
vs/base/common/resources
'
;
import
{
VSBuffer
}
from
'
vs/base/common/buffer
'
;
import
{
IStorageKeysSyncRegistryService
}
from
'
vs/platform/userDataSync/common/storageKeys
'
;
export
class
BrowserWorkspacesService
extends
Disposable
implements
IWorkspacesService
{
...
...
@@ -23,18 +24,22 @@ export class BrowserWorkspacesService extends Disposable implements IWorkspacesS
_serviceBrand
:
undefined
;
private
readonly
_onRecentlyOpenedChange
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onRecentlyOpenedChange
:
Event
<
void
>
=
this
.
_onRecentlyOpenedChange
.
event
;
private
readonly
_onRecentlyOpenedChange
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onRecentlyOpenedChange
=
this
.
_onRecentlyOpenedChange
.
event
;
constructor
(
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IWorkspaceContextService
private
readonly
workspaceService
:
IWorkspaceContextService
,
@
ILogService
private
readonly
logService
:
ILogService
,
@
IFileService
private
readonly
fileService
:
IFileService
,
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
@
IWorkbenchEnvironmentService
private
readonly
environmentService
:
IWorkbenchEnvironmentService
,
@
IStorageKeysSyncRegistryService
storageKeysSyncRegistryService
:
IStorageKeysSyncRegistryService
)
{
super
();
// opt-in to syncing
storageKeysSyncRegistryService
.
registerStorageKey
({
key
:
BrowserWorkspacesService
.
RECENTLY_OPENED_KEY
,
version
:
1
});
// Opening a workspace should push it as most
// recently used to the workspaces history
this
.
addWorkspaceToRecentlyOpened
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录