Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
c7da35f1
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,发现更多精彩内容 >>
提交
c7da35f1
编写于
1月 20, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first cut stream support for updateContent
上级
b618e4a2
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
94 addition
and
33 deletion
+94
-33
src/typings/iconv-lite.d.ts
src/typings/iconv-lite.d.ts
+3
-3
src/vs/base/node/encoding.ts
src/vs/base/node/encoding.ts
+7
-3
src/vs/base/node/extfs.ts
src/vs/base/node/extfs.ts
+5
-6
src/vs/base/node/pfs.ts
src/vs/base/node/pfs.ts
+1
-2
src/vs/base/test/node/extfs/extfs.test.ts
src/vs/base/test/node/extfs/extfs.test.ts
+2
-1
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+14
-1
src/vs/workbench/common/editor/textEditorModel.ts
src/vs/workbench/common/editor/textEditorModel.ts
+10
-0
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+2
-2
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
...ench/services/files/electron-browser/remoteFileService.ts
+5
-4
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+42
-8
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+1
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+2
-2
未找到文件。
src/typings/iconv-lite.d.ts
浏览文件 @
c7da35f1
...
...
@@ -6,13 +6,13 @@
/// <reference path='./node.d.ts'/>
declare
module
'
iconv-lite
'
{
export
function
decode
(
buffer
:
NodeBuffer
,
encoding
:
string
,
options
?:
any
):
string
;
export
function
decode
(
buffer
:
NodeBuffer
,
encoding
:
string
):
string
;
export
function
encode
(
content
:
string
,
encoding
:
string
,
options
?:
any
):
NodeBuffer
;
export
function
encode
(
content
:
string
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}
):
NodeBuffer
;
export
function
encodingExists
(
encoding
:
string
):
boolean
;
export
function
decodeStream
(
encoding
:
string
):
NodeJS
.
ReadWriteStream
;
export
function
encodeStream
(
encoding
:
string
):
NodeJS
.
ReadWriteStream
;
export
function
encodeStream
(
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}
):
NodeJS
.
ReadWriteStream
;
}
\ No newline at end of file
src/vs/base/node/encoding.ts
浏览文件 @
c7da35f1
...
...
@@ -28,11 +28,11 @@ export function bomLength(encoding: string): number {
return
0
;
}
export
function
decode
(
buffer
:
NodeBuffer
,
encoding
:
string
,
options
?:
any
):
string
{
return
iconv
.
decode
(
buffer
,
toNodeEncoding
(
encoding
)
,
options
);
export
function
decode
(
buffer
:
NodeBuffer
,
encoding
:
string
):
string
{
return
iconv
.
decode
(
buffer
,
toNodeEncoding
(
encoding
));
}
export
function
encode
(
content
:
string
,
encoding
:
string
,
options
?:
any
):
NodeBuffer
{
export
function
encode
(
content
:
string
,
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}
):
NodeBuffer
{
return
iconv
.
encode
(
content
,
toNodeEncoding
(
encoding
),
options
);
}
...
...
@@ -44,6 +44,10 @@ export function decodeStream(encoding: string): NodeJS.ReadWriteStream {
return
iconv
.
decodeStream
(
toNodeEncoding
(
encoding
));
}
export
function
encodeStream
(
encoding
:
string
,
options
?:
{
addBOM
?:
boolean
}):
NodeJS
.
ReadWriteStream
{
return
iconv
.
encodeStream
(
toNodeEncoding
(
encoding
),
options
);
}
function
toNodeEncoding
(
enc
:
string
):
string
{
if
(
enc
===
UTF8_with_bom
)
{
return
UTF8
;
// iconv does not distinguish UTF 8 with or without BOM, so we need to help it
...
...
src/vs/base/node/extfs.ts
浏览文件 @
c7da35f1
...
...
@@ -14,7 +14,6 @@ import * as fs from 'fs';
import
*
as
paths
from
'
path
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
nfcall
}
from
'
vs/base/common/async
'
;
import
{
Readable
}
from
'
stream
'
;
const
loop
=
flow
.
loop
;
...
...
@@ -321,17 +320,17 @@ export function mv(source: string, target: string, callback: (error: Error) => v
}
let
canFlush
=
true
;
export
function
writeFileAndFlush
(
path
:
string
,
data
:
string
|
NodeBuffer
|
Readable
,
options
:
{
mode
?:
number
;
flag
?:
string
;
},
callback
:
(
error
?:
Error
)
=>
void
):
void
{
export
function
writeFileAndFlush
(
path
:
string
,
data
:
string
|
NodeBuffer
|
NodeJS
.
ReadableStream
,
options
:
{
mode
?:
number
;
flag
?:
string
;
},
callback
:
(
error
?:
Error
)
=>
void
):
void
{
options
=
ensureOptions
(
options
);
if
(
data
instanceof
Readable
)
{
doWriteFileStreamAndFlush
(
path
,
data
,
options
,
callback
);
}
else
{
if
(
typeof
data
===
'
string
'
||
Buffer
.
isBuffer
(
data
))
{
doWriteFileAndFlush
(
path
,
data
,
options
,
callback
);
}
else
{
doWriteFileStreamAndFlush
(
path
,
data
,
options
,
callback
);
}
}
function
doWriteFileStreamAndFlush
(
path
:
string
,
reader
:
Readable
,
options
:
{
mode
?:
number
;
flag
?:
string
;
},
callback
:
(
error
?:
Error
)
=>
void
):
void
{
function
doWriteFileStreamAndFlush
(
path
:
string
,
reader
:
NodeJS
.
ReadableStream
,
options
:
{
mode
?:
number
;
flag
?:
string
;
},
callback
:
(
error
?:
Error
)
=>
void
):
void
{
// finish only once
let
finished
=
false
;
...
...
src/vs/base/node/pfs.ts
浏览文件 @
c7da35f1
...
...
@@ -13,7 +13,6 @@ import * as fs from 'fs';
import
*
as
os
from
'
os
'
;
import
*
as
platform
from
'
vs/base/common/platform
'
;
import
{
once
}
from
'
vs/base/common/event
'
;
import
{
Readable
}
from
'
stream
'
;
export
function
readdir
(
path
:
string
):
TPromise
<
string
[]
>
{
return
nfcall
(
extfs
.
readdir
,
path
);
...
...
@@ -102,7 +101,7 @@ const writeFilePathQueue: { [path: string]: Queue<void> } = Object.create(null);
export
function
writeFile
(
path
:
string
,
data
:
string
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
NodeBuffer
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
Readable
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
NodeJS
.
ReadableStream
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
void
>
;
export
function
writeFile
(
path
:
string
,
data
:
any
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
void
>
{
let
queueKey
=
toQueueKey
(
path
);
...
...
src/vs/base/test/node/extfs/extfs.test.ts
浏览文件 @
c7da35f1
...
...
@@ -50,7 +50,8 @@ function toReadable(value: string, throwError?: boolean): Readable {
if
(
!
res
)
{
this
.
push
(
null
);
}
}
},
encoding
:
'
utf8
'
});
}
...
...
src/vs/platform/files/common/files.ts
浏览文件 @
c7da35f1
...
...
@@ -83,7 +83,7 @@ export interface IFileService {
/**
* Updates the content replacing its previous value.
*/
updateContent
(
resource
:
URI
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
;
updateContent
(
resource
:
URI
,
value
:
string
|
ITextSnapshot
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
;
/**
* Moves the file to a new path identified by the resource.
...
...
@@ -468,6 +468,19 @@ export interface ITextSnapshot {
read
():
string
;
}
/**
* Helper method to convert a snapshot into its full string form.
*/
export
function
snapshotToString
(
snapshot
:
ITextSnapshot
):
string
{
const
chunks
:
string
[]
=
[];
let
chunk
:
string
;
while
(
typeof
(
chunk
=
snapshot
.
read
())
===
'
string
'
)
{
chunks
.
push
(
chunk
);
}
return
chunks
.
join
(
''
);
}
/**
* Streamable content and meta information of a file.
*/
...
...
src/vs/workbench/common/editor/textEditorModel.ts
浏览文件 @
c7da35f1
...
...
@@ -13,6 +13,7 @@ import { ITextEditorModel } from 'vs/editor/common/services/resolverService';
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
ITextSnapshot
}
from
'
vs/platform/files/common/files
'
;
/**
* The base text editor model leverages the code editor model. This class is only intended to be subclassed and not instantiated.
...
...
@@ -142,6 +143,15 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd
return
null
;
}
public
createSnapshot
():
ITextSnapshot
{
const
model
=
this
.
textEditorModel
;
if
(
model
)
{
return
model
.
createSnapshot
(
true
/* Preserve BOM */
);
}
return
null
;
}
public
isResolved
():
boolean
{
return
!!
this
.
textEditorModelHandle
;
}
...
...
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
c7da35f1
...
...
@@ -11,7 +11,7 @@ import paths = require('vs/base/common/paths');
import
encoding
=
require
(
'
vs/base/node/encoding
'
);
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
uri
from
'
vs/base/common/uri
'
;
import
{
FileOperation
,
FileOperationEvent
,
IFileService
,
IFilesConfiguration
,
IResolveFileOptions
,
IFileStat
,
IResolveFileResult
,
IContent
,
IStreamContent
,
IImportResult
,
IResolveContentOptions
,
IUpdateContentOptions
,
FileChangesEvent
,
ICreateFileOptions
}
from
'
vs/platform/files/common/files
'
;
import
{
FileOperation
,
FileOperationEvent
,
IFileService
,
IFilesConfiguration
,
IResolveFileOptions
,
IFileStat
,
IResolveFileResult
,
IContent
,
IStreamContent
,
IImportResult
,
IResolveContentOptions
,
IUpdateContentOptions
,
FileChangesEvent
,
ICreateFileOptions
,
ITextSnapshot
}
from
'
vs/platform/files/common/files
'
;
import
{
FileService
as
NodeFileService
,
IFileServiceOptions
,
IEncodingOverride
}
from
'
vs/workbench/services/files/node/fileService
'
;
import
{
IConfigurationService
,
IConfigurationChangeEvent
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
...
...
@@ -181,7 +181,7 @@ export class FileService implements IFileService {
return
this
.
raw
.
resolveStreamContent
(
resource
,
options
);
}
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
public
updateContent
(
resource
:
uri
,
value
:
string
|
ITextSnapshot
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
return
this
.
raw
.
updateContent
(
resource
,
value
,
options
);
}
...
...
src/vs/workbench/services/files/electron-browser/remoteFileService.ts
浏览文件 @
c7da35f1
...
...
@@ -6,7 +6,7 @@
import
URI
from
'
vs/base/common/uri
'
;
import
{
FileService
}
from
'
vs/workbench/services/files/electron-browser/fileService
'
;
import
{
IContent
,
IStreamContent
,
IFileStat
,
IResolveContentOptions
,
IUpdateContentOptions
,
IResolveFileOptions
,
IResolveFileResult
,
FileOperationEvent
,
FileOperation
,
IFileSystemProvider
,
IStat
,
FileType
,
IImportResult
,
FileChangesEvent
,
ICreateFileOptions
,
FileOperationError
,
FileOperationResult
}
from
'
vs/platform/files/common/files
'
;
import
{
IContent
,
IStreamContent
,
IFileStat
,
IResolveContentOptions
,
IUpdateContentOptions
,
IResolveFileOptions
,
IResolveFileResult
,
FileOperationEvent
,
FileOperation
,
IFileSystemProvider
,
IStat
,
FileType
,
IImportResult
,
FileChangesEvent
,
ICreateFileOptions
,
FileOperationError
,
FileOperationResult
,
ITextSnapshot
,
snapshotToString
}
from
'
vs/platform/files/common/files
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
basename
,
join
}
from
'
path
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
...
...
@@ -351,7 +351,7 @@ export class RemoteFileService extends FileService {
}
}
updateContent
(
resource
:
URI
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
updateContent
(
resource
:
URI
,
value
:
string
|
ITextSnapshot
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
if
(
resource
.
scheme
===
Schemas
.
file
)
{
return
super
.
updateContent
(
resource
,
value
,
options
);
}
else
{
...
...
@@ -361,9 +361,10 @@ export class RemoteFileService extends FileService {
}
}
private
_doUpdateContent
(
provider
:
IFileSystemProvider
,
resource
:
URI
,
content
:
string
,
options
:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
private
_doUpdateContent
(
provider
:
IFileSystemProvider
,
resource
:
URI
,
content
:
string
|
ITextSnapshot
,
options
:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
const
encoding
=
this
.
getEncoding
(
resource
,
options
.
encoding
);
return
provider
.
write
(
resource
,
encode
(
content
,
encoding
)).
then
(()
=>
{
// TODO@Joh support streaming API for remote file system writes
return
provider
.
write
(
resource
,
encode
(
typeof
content
===
'
string
'
?
content
:
snapshotToString
(
content
),
encoding
)).
then
(()
=>
{
return
this
.
resolveFile
(
resource
);
});
}
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
c7da35f1
...
...
@@ -11,7 +11,7 @@ import os = require('os');
import
crypto
=
require
(
'
crypto
'
);
import
assert
=
require
(
'
assert
'
);
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveFileResult
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
FileOperationError
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
FileChangesEvent
,
ICreateFileOptions
,
IContentData
}
from
'
vs/platform/files/common/files
'
;
import
{
isParent
,
FileOperation
,
FileOperationEvent
,
IContent
,
IFileService
,
IResolveFileOptions
,
IResolveFileResult
,
IResolveContentOptions
,
IFileStat
,
IStreamContent
,
FileOperationError
,
FileOperationResult
,
IUpdateContentOptions
,
FileChangeType
,
IImportResult
,
FileChangesEvent
,
ICreateFileOptions
,
IContentData
,
ITextSnapshot
,
snapshotToString
}
from
'
vs/platform/files/common/files
'
;
import
{
MAX_FILE_SIZE
}
from
'
vs/platform/files/node/files
'
;
import
{
isEqualOrParent
}
from
'
vs/base/common/paths
'
;
import
{
ResourceMap
}
from
'
vs/base/common/map
'
;
...
...
@@ -41,6 +41,7 @@ import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cance
import
{
ILifecycleService
,
LifecyclePhase
}
from
'
vs/platform/lifecycle/common/lifecycle
'
;
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
assign
}
from
'
vs/base/common/objects
'
;
import
{
Readable
}
from
'
stream
'
;
export
interface
IEncodingOverride
{
resource
:
uri
;
...
...
@@ -505,15 +506,16 @@ export class FileService implements IFileService {
});
}
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
public
updateContent
(
resource
:
uri
,
value
:
string
|
ITextSnapshot
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
if
(
this
.
options
.
elevationSupport
&&
options
.
writeElevated
)
{
return
this
.
doUpdateContentElevated
(
resource
,
value
,
options
);
// We can currently only write strings elevated, so we need to convert snapshots properly
return
this
.
doUpdateContentElevated
(
resource
,
typeof
value
===
'
string
'
?
value
:
snapshotToString
(
value
),
options
);
}
return
this
.
doUpdateContent
(
resource
,
value
,
options
);
}
private
doUpdateContent
(
resource
:
uri
,
value
:
string
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
private
doUpdateContent
(
resource
:
uri
,
value
:
string
|
ITextSnapshot
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
const
absolutePath
=
this
.
toAbsolutePath
(
resource
);
// 1.) check file
...
...
@@ -579,18 +581,25 @@ export class FileService implements IFileService {
});
}
private
doSetContentsAndResolve
(
resource
:
uri
,
absolutePath
:
string
,
value
:
string
,
addBOM
:
boolean
,
encodingToWrite
:
string
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
IFileStat
>
{
private
doSetContentsAndResolve
(
resource
:
uri
,
absolutePath
:
string
,
value
:
string
|
ITextSnapshot
,
addBOM
:
boolean
,
encodingToWrite
:
string
,
options
?:
{
mode
?:
number
;
flag
?:
string
;
}):
TPromise
<
IFileStat
>
{
let
writeFilePromise
:
TPromise
<
void
>
;
// Write fast if we do UTF 8 without BOM
if
(
!
addBOM
&&
encodingToWrite
===
encoding
.
UTF8
)
{
if
(
typeof
value
===
'
string
'
)
{
writeFilePromise
=
pfs
.
writeFile
(
absolutePath
,
value
,
options
);
}
else
{
writeFilePromise
=
pfs
.
writeFile
(
absolutePath
,
this
.
snapshotToReadableStream
(
value
),
options
);
}
}
// Otherwise use encoding lib
else
{
const
encoded
=
encoding
.
encode
(
value
,
encodingToWrite
,
{
addBOM
});
writeFilePromise
=
pfs
.
writeFile
(
absolutePath
,
encoded
,
options
);
if
(
typeof
value
===
'
string
'
)
{
writeFilePromise
=
pfs
.
writeFile
(
absolutePath
,
encoding
.
encode
(
value
,
encodingToWrite
,
{
addBOM
}),
options
);
}
else
{
writeFilePromise
=
pfs
.
writeFile
(
absolutePath
,
this
.
snapshotToReadableStream
(
value
).
pipe
(
encoding
.
encodeStream
(
encodingToWrite
,
{
addBOM
})),
options
);
}
}
// set contents
...
...
@@ -601,6 +610,31 @@ export class FileService implements IFileService {
});
}
private
snapshotToReadableStream
(
snapshot
:
ITextSnapshot
):
NodeJS
.
ReadableStream
{
return
new
Readable
({
read
:
function
()
{
try
{
let
chunk
:
string
;
let
canPush
=
true
;
// Push all chunks as long as we can push and as long as
// the underlying snapshot returns strings to us
while
(
canPush
&&
typeof
(
chunk
=
snapshot
.
read
())
===
'
string
'
)
{
canPush
=
this
.
push
(
chunk
);
}
// Signal EOS by pushing NULL
if
(
typeof
chunk
!==
'
string
'
)
{
this
.
push
(
null
);
}
}
catch
(
error
)
{
this
.
emit
(
'
error
'
,
error
);
}
},
encoding
:
encoding
.
UTF8
// very important, so that strings are passed around and not buffers!
});
}
private
doUpdateContentElevated
(
resource
:
uri
,
value
:
string
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
const
absolutePath
=
this
.
toAbsolutePath
(
resource
);
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
c7da35f1
...
...
@@ -702,7 +702,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
// Save to Disk
// mark the save operation as currently pending with the versionId (it might have changed from a save participant triggering)
diag
(
`doSave(
${
versionId
}
) - before updateContent()`
,
this
.
resource
,
new
Date
());
return
this
.
saveSequentializer
.
setPending
(
newVersionId
,
this
.
fileService
.
updateContent
(
this
.
lastResolvedDiskStat
.
resource
,
this
.
getValue
(),
{
return
this
.
saveSequentializer
.
setPending
(
newVersionId
,
this
.
fileService
.
updateContent
(
this
.
lastResolvedDiskStat
.
resource
,
this
.
createSnapshot
(),
{
overwriteReadonly
:
options
.
overwriteReadonly
,
overwriteEncoding
:
options
.
overwriteEncoding
,
mtime
:
this
.
lastResolvedDiskStat
.
mtime
,
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
c7da35f1
...
...
@@ -33,7 +33,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import
{
InstantiationService
}
from
'
vs/platform/instantiation/common/instantiationService
'
;
import
{
IEditorGroupService
,
GroupArrangement
,
GroupOrientation
,
IEditorTabOptions
,
IMoveOptions
}
from
'
vs/workbench/services/group/common/groupService
'
;
import
{
TextFileService
}
from
'
vs/workbench/services/textfile/common/textFileService
'
;
import
{
FileOperationEvent
,
IFileService
,
IResolveContentOptions
,
FileOperationError
,
IFileStat
,
IResolveFileResult
,
IImportResult
,
FileChangesEvent
,
IResolveFileOptions
,
IContent
,
IUpdateContentOptions
,
IStreamContent
,
ICreateFileOptions
}
from
'
vs/platform/files/common/files
'
;
import
{
FileOperationEvent
,
IFileService
,
IResolveContentOptions
,
FileOperationError
,
IFileStat
,
IResolveFileResult
,
IImportResult
,
FileChangesEvent
,
IResolveFileOptions
,
IContent
,
IUpdateContentOptions
,
IStreamContent
,
ICreateFileOptions
,
ITextSnapshot
}
from
'
vs/platform/files/common/files
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
ModeServiceImpl
}
from
'
vs/editor/common/services/modeServiceImpl
'
;
import
{
ModelServiceImpl
}
from
'
vs/editor/common/services/modelServiceImpl
'
;
...
...
@@ -755,7 +755,7 @@ export class TestFileService implements IFileService {
});
}
updateContent
(
resource
:
URI
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
updateContent
(
resource
:
URI
,
value
:
string
|
ITextSnapshot
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
return
TPromise
.
timeout
(
1
).
then
(()
=>
{
return
{
resource
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录