Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
2579db23
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,发现更多精彩内容 >>
提交
2579db23
编写于
8月 22, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused IFileService#resolveContents, #29194
上级
1b05f83b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
2 addition
and
43 deletion
+2
-43
src/vs/platform/files/common/files.ts
src/vs/platform/files/common/files.ts
+1
-6
src/vs/workbench/services/files/electron-browser/fileService.ts
.../workbench/services/files/electron-browser/fileService.ts
+0
-4
src/vs/workbench/services/files/node/fileService.ts
src/vs/workbench/services/files/node/fileService.ts
+1
-15
src/vs/workbench/services/files/test/node/fileService.test.ts
...vs/workbench/services/files/test/node/fileService.test.ts
+0
-14
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+0
-4
未找到文件。
src/vs/platform/files/common/files.ts
浏览文件 @
2579db23
...
@@ -68,11 +68,6 @@ export interface IFileService {
...
@@ -68,11 +68,6 @@ export interface IFileService {
*/
*/
resolveStreamContent
(
resource
:
URI
,
options
?:
IResolveContentOptions
):
TPromise
<
IStreamContent
>
;
resolveStreamContent
(
resource
:
URI
,
options
?:
IResolveContentOptions
):
TPromise
<
IStreamContent
>
;
/**
* Returns the contents of all files by the given array of file resources.
*/
resolveContents
(
resources
:
URI
[]):
TPromise
<
IContent
[]
>
;
/**
/**
* Updates the content replacing its previous value.
* Updates the content replacing its previous value.
*/
*/
...
@@ -793,4 +788,4 @@ export enum FileKind {
...
@@ -793,4 +788,4 @@ export enum FileKind {
FILE
,
FILE
,
FOLDER
,
FOLDER
,
ROOT_FOLDER
ROOT_FOLDER
}
}
\ No newline at end of file
src/vs/workbench/services/files/electron-browser/fileService.ts
浏览文件 @
2579db23
...
@@ -212,10 +212,6 @@ export class FileService implements IFileService {
...
@@ -212,10 +212,6 @@ export class FileService implements IFileService {
return
this
.
raw
.
resolveStreamContent
(
resource
,
options
);
return
this
.
raw
.
resolveStreamContent
(
resource
,
options
);
}
}
public
resolveContents
(
resources
:
uri
[]):
TPromise
<
IContent
[]
>
{
return
this
.
raw
.
resolveContents
(
resources
);
}
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
return
this
.
raw
.
updateContent
(
resource
,
value
,
options
);
return
this
.
raw
.
updateContent
(
resource
,
value
,
options
);
}
}
...
...
src/vs/workbench/services/files/node/fileService.ts
浏览文件 @
2579db23
...
@@ -20,7 +20,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
...
@@ -20,7 +20,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
import
types
=
require
(
'
vs/base/common/types
'
);
import
types
=
require
(
'
vs/base/common/types
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
objects
=
require
(
'
vs/base/common/objects
'
);
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
extfs
=
require
(
'
vs/base/node/extfs
'
);
import
{
nfcall
,
Limiter
,
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
{
nfcall
,
ThrottledDelayer
}
from
'
vs/base/common/async
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
uri
from
'
vs/base/common/uri
'
;
import
nls
=
require
(
'
vs/nls
'
);
import
nls
=
require
(
'
vs/nls
'
);
import
{
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
import
{
isWindows
,
isLinux
}
from
'
vs/base/common/platform
'
;
...
@@ -75,7 +75,6 @@ export class FileService implements IFileService {
...
@@ -75,7 +75,6 @@ export class FileService implements IFileService {
private
static
FS_EVENT_DELAY
=
50
;
// aggregate and only emit events when changes have stopped for this duration (in ms)
private
static
FS_EVENT_DELAY
=
50
;
// aggregate and only emit events when changes have stopped for this duration (in ms)
private
static
FS_REWATCH_DELAY
=
300
;
// delay to rewatch a file that was renamed or deleted (in ms)
private
static
FS_REWATCH_DELAY
=
300
;
// delay to rewatch a file that was renamed or deleted (in ms)
private
static
MAX_DEGREE_OF_PARALLEL_FS_OPS
=
10
;
// degree of parallel fs calls that we accept at the same time
private
tmpPath
:
string
;
private
tmpPath
:
string
;
private
options
:
IFileServiceOptions
;
private
options
:
IFileServiceOptions
;
...
@@ -302,19 +301,6 @@ export class FileService implements IFileService {
...
@@ -302,19 +301,6 @@ export class FileService implements IFileService {
});
});
}
}
public
resolveContents
(
resources
:
uri
[]):
TPromise
<
IContent
[]
>
{
const
limiter
=
new
Limiter
(
FileService
.
MAX_DEGREE_OF_PARALLEL_FS_OPS
);
const
contentPromises
=
<
TPromise
<
IContent
>
[]
>
[];
resources
.
forEach
(
resource
=>
{
contentPromises
.
push
(
limiter
.
queue
(()
=>
this
.
resolve
(
resource
).
then
(
model
=>
this
.
resolveFileContent
(
model
)).
then
(
content
=>
content
,
error
=>
TPromise
.
as
(
null
/* ignore errors gracefully */
))));
});
return
TPromise
.
join
(
contentPromises
).
then
(
contents
=>
{
return
arrays
.
coalesce
(
contents
);
});
}
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
public
updateContent
(
resource
:
uri
,
value
:
string
,
options
:
IUpdateContentOptions
=
Object
.
create
(
null
)):
TPromise
<
IFileStat
>
{
const
absolutePath
=
this
.
toAbsolutePath
(
resource
);
const
absolutePath
=
this
.
toAbsolutePath
(
resource
);
...
...
src/vs/workbench/services/files/test/node/fileService.test.ts
浏览文件 @
2579db23
...
@@ -48,20 +48,6 @@ suite('FileService', () => {
...
@@ -48,20 +48,6 @@ suite('FileService', () => {
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
extfs
.
del
(
parentDir
,
os
.
tmpdir
(),
()
=>
{
},
done
);
});
});
test
(
'
resolveContents
'
,
function
(
done
:
()
=>
void
)
{
service
.
resolveContents
([
uri
.
file
(
path
.
join
(
testDir
,
'
index.html
'
)),
uri
.
file
(
path
.
join
(
testDir
,
'
404.html
'
)),
uri
.
file
(
path
.
join
(
testDir
,
'
deep
'
,
'
company.js
'
)),
]).
done
(
r
=>
{
assert
.
equal
(
r
.
length
,
2
);
assert
.
equal
(
r
.
some
(
c
=>
c
.
name
===
'
index.html
'
),
true
);
assert
.
equal
(
r
.
some
(
c
=>
c
.
name
===
'
company.js
'
),
true
);
done
();
});
});
test
(
'
createFile
'
,
function
(
done
:
()
=>
void
)
{
test
(
'
createFile
'
,
function
(
done
:
()
=>
void
)
{
let
event
:
FileOperationEvent
;
let
event
:
FileOperationEvent
;
const
toDispose
=
service
.
onAfterOperation
(
e
=>
{
const
toDispose
=
service
.
onAfterOperation
(
e
=>
{
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
2579db23
...
@@ -707,10 +707,6 @@ export class TestFileService implements IFileService {
...
@@ -707,10 +707,6 @@ export class TestFileService implements IFileService {
});
});
}
}
resolveContents
(
resources
:
URI
[]):
TPromise
<
IContent
[]
>
{
return
TPromise
.
as
(
null
);
}
updateContent
(
resource
:
URI
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
updateContent
(
resource
:
URI
,
value
:
string
,
options
?:
IUpdateContentOptions
):
TPromise
<
IFileStat
>
{
return
TPromise
.
timeout
(
1
).
then
(()
=>
{
return
TPromise
.
timeout
(
1
).
then
(()
=>
{
return
{
return
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录