Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
891b722e
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,体验更适合开发者的 AI 搜索 >>
提交
891b722e
编写于
12月 07, 2016
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Backup files when autoSaveDelay is > 1500ms
Part of #16509
上级
1b6dd428
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
6 deletion
+16
-6
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+2
-0
src/vs/workbench/common/editor/untitledEditorModel.ts
src/vs/workbench/common/editor/untitledEditorModel.ts
+2
-2
src/vs/workbench/parts/backup/common/backupModelTracker.ts
src/vs/workbench/parts/backup/common/backupModelTracker.ts
+10
-2
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+2
-2
未找到文件。
src/vs/platform/files/common/files.ts
浏览文件 @
891b722e
...
...
@@ -464,6 +464,8 @@ export const AutoSaveConfiguration = {
ON_WINDOW_CHANGE
:
'
onWindowChange
'
};
export
const
CONTENT_CHANGE_EVENT_BUFFER_DELAY
=
1000
;
export
interface
IFilesConfiguration
{
files
:
{
associations
:
{
[
filepattern
:
string
]:
string
};
...
...
src/vs/workbench/common/editor/untitledEditorModel.ts
浏览文件 @
891b722e
...
...
@@ -11,7 +11,7 @@ import { StringEditorModel } from 'vs/workbench/common/editor/stringEditorModel'
import
URI
from
'
vs/base/common/uri
'
;
import
{
PLAINTEXT_MODE_ID
}
from
'
vs/editor/common/modes/modesRegistry
'
;
import
{
EndOfLinePreference
}
from
'
vs/editor/common/editorCommon
'
;
import
{
IFilesConfiguration
}
from
'
vs/platform/files/common/files
'
;
import
{
IFilesConfiguration
,
CONTENT_CHANGE_EVENT_BUFFER_DELAY
}
from
'
vs/platform/files/common/files
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
...
...
@@ -23,7 +23,7 @@ import { ITextFileService } from 'vs/workbench/services/textfile/common/textfile
export
class
UntitledEditorModel
extends
StringEditorModel
implements
IEncodingSupport
{
public
static
DEFAULT_CONTENT_CHANGE_BUFFER_DELAY
=
1000
;
public
static
DEFAULT_CONTENT_CHANGE_BUFFER_DELAY
=
CONTENT_CHANGE_EVENT_BUFFER_DELAY
;
private
textModelChangeListener
:
IDisposable
;
private
configurationChangeListener
:
IDisposable
;
...
...
src/vs/workbench/parts/backup/common/backupModelTracker.ts
浏览文件 @
891b722e
...
...
@@ -14,7 +14,9 @@ import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/un
import
{
IEnvironmentService
}
from
'
vs/platform/environment/common/environment
'
;
import
{
IWorkbenchContribution
}
from
'
vs/workbench/common/contributions
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IFilesConfiguration
,
AutoSaveConfiguration
}
from
'
vs/platform/files/common/files
'
;
import
{
IFilesConfiguration
,
AutoSaveConfiguration
,
CONTENT_CHANGE_EVENT_BUFFER_DELAY
}
from
'
vs/platform/files/common/files
'
;
const
AUTO_SAVE_AFTER_DELAY_DISABLED_TIME
=
CONTENT_CHANGE_EVENT_BUFFER_DELAY
+
500
;
export
class
BackupModelTracker
implements
IWorkbenchContribution
{
...
...
@@ -54,7 +56,13 @@ export class BackupModelTracker implements IWorkbenchContribution {
}
private
onConfigurationChange
(
configuration
:
IFilesConfiguration
):
void
{
this
.
configuredAutoSaveAfterDelay
=
configuration
&&
configuration
.
files
&&
configuration
.
files
.
autoSave
===
AutoSaveConfiguration
.
AFTER_DELAY
;
if
(
!
configuration
||
!
configuration
.
files
)
{
this
.
configuredAutoSaveAfterDelay
=
false
;
return
;
}
this
.
configuredAutoSaveAfterDelay
=
(
configuration
.
files
.
autoSave
===
AutoSaveConfiguration
.
AFTER_DELAY
&&
configuration
.
files
.
autoSaveDelay
<=
AUTO_SAVE_AFTER_DELAY_DISABLED_TIME
);
}
private
onTextFileModelChanged
(
event
:
TextFileModelChangeEvent
):
void
{
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
891b722e
...
...
@@ -23,7 +23,7 @@ import { ITextFileService, IAutoSaveConfiguration, ModelState, ITextFileEditorMo
import
{
EncodingMode
,
EditorModel
}
from
'
vs/workbench/common/editor
'
;
import
{
BaseTextEditorModel
}
from
'
vs/workbench/common/editor/textEditorModel
'
;
import
{
IBackupFileService
,
BACKUP_FILE_RESOLVE_OPTIONS
}
from
'
vs/workbench/services/backup/common/backup
'
;
import
{
IFileService
,
IFileStat
,
IFileOperationResult
,
FileOperationResult
,
IContent
}
from
'
vs/platform/files/common/files
'
;
import
{
IFileService
,
IFileStat
,
IFileOperationResult
,
FileOperationResult
,
IContent
,
CONTENT_CHANGE_EVENT_BUFFER_DELAY
}
from
'
vs/platform/files/common/files
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IMessageService
,
Severity
}
from
'
vs/platform/message/common/message
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
...
...
@@ -38,7 +38,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
public
static
ID
=
'
workbench.editors.files.textFileEditorModel
'
;
public
static
DEFAULT_CONTENT_CHANGE_BUFFER_DELAY
=
1000
;
public
static
DEFAULT_CONTENT_CHANGE_BUFFER_DELAY
=
CONTENT_CHANGE_EVENT_BUFFER_DELAY
;
private
static
saveErrorHandler
:
ISaveErrorHandler
;
private
static
saveParticipant
:
ISaveParticipant
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录