Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
245ce3ae
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,发现更多精彩内容 >>
提交
245ce3ae
编写于
3月 21, 2019
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
files - proper size for content
上级
bc0574de
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
30 addition
and
18 deletion
+30
-18
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+9
-8
src/vs/workbench/browser/nodeless.simpleservices.ts
src/vs/workbench/browser/nodeless.simpleservices.ts
+5
-2
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+2
-0
src/vs/workbench/services/files/node/remoteFileService.ts
src/vs/workbench/services/files/node/remoteFileService.ts
+3
-1
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
...workbench/services/textfile/common/textFileEditorModel.ts
+3
-2
src/vs/workbench/services/textfile/common/textFileService.ts
src/vs/workbench/services/textfile/common/textFileService.ts
+3
-3
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+5
-2
未找到文件。
src/vs/platform/files/common/files.ts
浏览文件 @
245ce3ae
...
...
@@ -499,6 +499,14 @@ interface IBaseStat {
*/
name
:
string
;
/**
* The size of the file.
*
* The value may or may not be resolved as
* it is optional.
*/
size
?:
number
;
/**
* The last modifictaion date represented
* as millis from unix epoch.
...
...
@@ -526,6 +534,7 @@ interface IBaseStat {
export
interface
IBaseStatWithMetadata
extends
IBaseStat
{
mtime
:
number
;
etag
:
string
;
size
:
number
;
}
/**
...
...
@@ -548,14 +557,6 @@ export interface IFileStat extends IBaseStat {
* The children of the file stat or undefined if none.
*/
children
?:
IFileStat
[];
/**
* The size of the file.
*
* The value may or may not be resolved as
* it is optional.
*/
size
?:
number
;
}
export
interface
IFileStatWithMetadata
extends
IFileStat
,
IBaseStatWithMetadata
{
...
...
src/vs/workbench/browser/nodeless.simpleservices.ts
浏览文件 @
245ce3ae
...
...
@@ -736,7 +736,9 @@ export class SimpleRemoteFileService implements IFileService {
// @ts-ignore
mtime
:
content
.
mtime
,
// @ts-ignore
name
:
content
.
name
name
:
content
.
name
,
// @ts-ignore
size
:
content
.
size
};
});
}
...
...
@@ -860,7 +862,8 @@ function initFakeFileSystem(): void {
mtime
:
Date
.
now
(),
isDirectory
:
true
,
name
:
basename
(
workspaceResource
.
fsPath
),
children
:
[]
children
:
[],
size
:
0
};
fileMap
.
set
(
root
.
resource
,
root
);
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
245ce3ae
...
...
@@ -228,6 +228,7 @@ export class FileService extends Disposable implements ILegacyFileService, IFile
etag
:
streamContent
.
etag
,
encoding
:
streamContent
.
encoding
,
isReadonly
:
streamContent
.
isReadonly
,
size
:
streamContent
.
size
,
value
:
''
};
...
...
@@ -279,6 +280,7 @@ export class FileService extends Disposable implements ILegacyFileService, IFile
result
.
name
=
stat
.
name
;
result
.
mtime
=
stat
.
mtime
;
result
.
etag
=
stat
.
etag
;
result
.
size
=
stat
.
size
;
// Return early if resource is a directory
if
(
stat
.
isDirectory
)
{
...
...
src/vs/workbench/services/files/node/remoteFileService.ts
浏览文件 @
245ce3ae
...
...
@@ -324,7 +324,8 @@ export class RemoteFileService extends FileService {
name
:
fileStat
.
name
,
etag
:
fileStat
.
etag
,
mtime
:
fileStat
.
mtime
,
isReadonly
:
fileStat
.
isReadonly
isReadonly
:
fileStat
.
isReadonly
,
size
:
fileStat
.
size
};
});
});
...
...
@@ -418,6 +419,7 @@ export class RemoteFileService extends FileService {
value
:
''
,
encoding
:
content
.
encoding
,
etag
:
content
.
etag
,
size
:
content
.
size
,
mtime
:
content
.
mtime
,
name
:
content
.
name
,
resource
:
content
.
resource
,
...
...
src/vs/workbench/services/textfile/common/textFileEditorModel.ts
浏览文件 @
245ce3ae
...
...
@@ -270,6 +270,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
resource
:
this
.
resource
,
name
:
basename
(
this
.
resource
),
mtime
:
Date
.
now
(),
size
:
0
,
etag
:
etag
(
Date
.
now
(),
0
),
value
:
createTextBufferFactory
(
''
),
/* will be filled later from backup */
encoding
:
this
.
fileService
.
encoding
.
getWriteEncoding
(
this
.
resource
,
this
.
preferredEncoding
).
encoding
,
...
...
@@ -349,6 +350,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
private
loadWithContent
(
content
:
IRawTextContent
,
options
?:
ILoadOptions
,
backup
?:
URI
):
Promise
<
TextFileEditorModel
>
{
return
this
.
doLoadWithContent
(
content
,
backup
).
then
(
model
=>
{
// Telemetry: We log the fileGet telemetry event after the model has been loaded to ensure a good mimetype
const
settingsType
=
this
.
getTypeIfSettings
();
if
(
settingsType
)
{
...
...
@@ -381,11 +383,10 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil
resource
:
this
.
resource
,
name
:
content
.
name
,
mtime
:
content
.
mtime
,
size
:
-
1
,
size
:
content
.
size
,
etag
:
content
.
etag
,
isDirectory
:
false
,
isSymbolicLink
:
false
,
children
:
undefined
,
isReadonly
:
content
.
isReadonly
});
...
...
src/vs/workbench/services/textfile/common/textFileService.ts
浏览文件 @
245ce3ae
...
...
@@ -109,16 +109,16 @@ export class TextFileService extends Disposable implements ITextFileService {
resolveTextContent
(
resource
:
URI
,
options
?:
IResolveContentOptions
):
Promise
<
IRawTextContent
>
{
return
this
.
fileService
.
resolveStreamContent
(
resource
,
options
).
then
(
streamContent
=>
{
return
createTextBufferFactoryFromStream
(
streamContent
.
value
).
then
(
res
=>
{
const
r
:
IRawTextContent
=
{
return
{
resource
:
streamContent
.
resource
,
name
:
streamContent
.
name
,
mtime
:
streamContent
.
mtime
,
etag
:
streamContent
.
etag
,
encoding
:
streamContent
.
encoding
,
isReadonly
:
streamContent
.
isReadonly
,
size
:
streamContent
.
size
,
value
:
res
};
return
r
;
}
as
IRawTextContent
;
});
});
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
245ce3ae
...
...
@@ -251,7 +251,8 @@ export class TestTextFileService extends TextFileService {
mtime
:
content
.
mtime
,
etag
:
content
.
etag
,
encoding
:
content
.
encoding
,
value
:
createTextBufferFactory
(
content
.
value
)
value
:
createTextBufferFactory
(
content
.
value
),
size
:
content
.
value
.
length
};
});
}
...
...
@@ -961,7 +962,8 @@ export class TestFileService implements IFileService {
etag
:
'
index.txt
'
,
encoding
:
'
utf8
'
,
mtime
:
Date
.
now
(),
name
:
resources
.
basename
(
resource
)
name
:
resources
.
basename
(
resource
),
size
:
1
});
}
...
...
@@ -981,6 +983,7 @@ export class TestFileService implements IFileService {
etag
:
'
index.txt
'
,
encoding
:
'
utf8
'
,
mtime
:
Date
.
now
(),
size
:
1
,
name
:
resources
.
basename
(
resource
)
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录