Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
433006eb
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,发现更多精彩内容 >>
提交
433006eb
编写于
4月 19, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add (empty) option bags to provider function to be save for the future, #47475
上级
54583ac6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
15 deletion
+21
-15
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+15
-9
src/vs/workbench/api/node/extHostFileSystem.ts
src/vs/workbench/api/node/extHostFileSystem.ts
+6
-6
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
433006eb
...
...
@@ -132,7 +132,7 @@ declare module 'vscode' {
*/
export
interface
FileSystemProvider2
{
_version
:
7
;
_version
:
8
;
/**
* An event to signal that a resource has been created, changed, or deleted. This
...
...
@@ -149,13 +149,14 @@ declare module 'vscode' {
watch
(
uri
:
Uri
,
options
:
{
recursive
?:
boolean
;
excludes
?:
string
[]
}):
Disposable
;
/**
* Retrieve metadata about a file.
* Retrieve metadata about a file. Throw an [`EntryNotFound`](#FileError.EntryNotFound)-error
* in case the file does not exist.
*
* @param uri The uri of the file to retrieve meta data about.
* @param token A cancellation token.
* @return The file metadata about the file.
*/
stat
(
uri
:
Uri
,
token
:
CancellationToken
):
FileStat2
|
Thenable
<
FileStat2
>
;
stat
(
uri
:
Uri
,
options
:
{
/*future: followSymlinks*/
},
token
:
CancellationToken
):
FileStat2
|
Thenable
<
FileStat2
>
;
/**
* Retrieve the meta data of all entries of a [directory](#FileType2.Directory)
...
...
@@ -164,7 +165,7 @@ declare module 'vscode' {
* @param token A cancellation token.
* @return A thenable that resolves to an array of tuples of file names and files stats.
*/
readDirectory
(
uri
:
Uri
,
token
:
CancellationToken
):
[
string
,
FileStat2
][]
|
Thenable
<
[
string
,
FileStat2
][]
>
;
readDirectory
(
uri
:
Uri
,
options
:
{
/*future: onlyType?*/
},
token
:
CancellationToken
):
[
string
,
FileStat2
][]
|
Thenable
<
[
string
,
FileStat2
][]
>
;
/**
* Create a new directory. *Note* that new files are created via `write`-calls.
...
...
@@ -172,7 +173,7 @@ declare module 'vscode' {
* @param uri The uri of the *new* folder.
* @param token A cancellation token.
*/
createDirectory
(
uri
:
Uri
,
token
:
CancellationToken
):
FileStat2
|
Thenable
<
FileStat2
>
;
createDirectory
(
uri
:
Uri
,
options
:
{
/*future: permissions?*/
},
token
:
CancellationToken
):
FileStat2
|
Thenable
<
FileStat2
>
;
/**
* Read the entire contents of a file.
...
...
@@ -192,6 +193,15 @@ declare module 'vscode' {
*/
writeFile
(
uri
:
Uri
,
content
:
Uint8Array
,
options
:
{
flags
:
FileOpenFlags
},
token
:
CancellationToken
):
void
|
Thenable
<
void
>
;
/**
* Delete a file or folder from the underlying storage.
*
* @param uri The resource that is to be deleted
* @param options Options bag for future use
* @param token A cancellation token.
*/
delete
(
uri
:
Uri
,
options
:
{
/*future: useTrash?, followSymlinks?*/
},
token
:
CancellationToken
):
void
|
Thenable
<
void
>
;
/**
* Rename a file or folder.
*
...
...
@@ -210,10 +220,6 @@ declare module 'vscode' {
* @param token A cancellation token.
*/
copy
?(
uri
:
Uri
,
target
:
Uri
,
options
:
{
flags
:
FileOpenFlags
},
token
:
CancellationToken
):
FileStat2
|
Thenable
<
FileStat2
>
;
// todo@remote
// ? useTrash, expose trash
delete
(
uri
:
Uri
,
token
:
CancellationToken
):
void
|
Thenable
<
void
>
;
}
export
namespace
workspace
{
...
...
src/vs/workbench/api/node/extHostFileSystem.ts
浏览文件 @
433006eb
...
...
@@ -59,7 +59,7 @@ class FsLinkProvider implements vscode.DocumentLinkProvider {
class
FileSystemProviderShim
implements
vscode
.
FileSystemProvider2
{
_version
:
7
=
7
;
_version
:
8
=
8
;
onDidChangeFile
:
vscode
.
Event
<
vscode
.
FileChange2
[]
>
;
...
...
@@ -189,7 +189,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
}
registerFileSystemProvider
(
scheme
:
string
,
provider
:
vscode
.
FileSystemProvider
,
newProvider
:
vscode
.
FileSystemProvider2
)
{
if
(
newProvider
&&
newProvider
.
_version
===
7
)
{
if
(
newProvider
&&
newProvider
.
_version
===
8
)
{
return
this
.
_doRegisterFileSystemProvider
(
scheme
,
newProvider
);
}
else
if
(
provider
)
{
return
this
.
_doRegisterFileSystemProvider
(
scheme
,
new
FileSystemProviderShim
(
provider
));
...
...
@@ -248,11 +248,11 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
}
$stat
(
handle
:
number
,
resource
:
UriComponents
):
TPromise
<
files
.
IStat
,
any
>
{
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
stat
(
URI
.
revive
(
resource
),
token
));
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
stat
(
URI
.
revive
(
resource
),
{},
token
));
}
$readdir
(
handle
:
number
,
resource
:
UriComponents
):
TPromise
<
[
string
,
files
.
IStat
][],
any
>
{
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
readDirectory
(
URI
.
revive
(
resource
),
token
));
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
readDirectory
(
URI
.
revive
(
resource
),
{},
token
));
}
$readFile
(
handle
:
number
,
resource
:
UriComponents
,
flags
:
files
.
FileOpenFlags
):
TPromise
<
string
>
{
...
...
@@ -268,7 +268,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
}
$delete
(
handle
:
number
,
resource
:
UriComponents
):
TPromise
<
void
,
any
>
{
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
delete
(
URI
.
revive
(
resource
),
token
));
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
delete
(
URI
.
revive
(
resource
),
{},
token
));
}
$rename
(
handle
:
number
,
oldUri
:
UriComponents
,
newUri
:
UriComponents
,
flags
:
files
.
FileOpenFlags
):
TPromise
<
files
.
IStat
,
any
>
{
...
...
@@ -280,7 +280,7 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape {
}
$mkdir
(
handle
:
number
,
resource
:
UriComponents
):
TPromise
<
files
.
IStat
,
any
>
{
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
createDirectory
(
URI
.
revive
(
resource
),
token
));
return
asWinJsPromise
(
token
=>
this
.
_fsProvider
.
get
(
handle
).
createDirectory
(
URI
.
revive
(
resource
),
{},
token
));
}
$watch
(
handle
:
number
,
session
:
number
,
resource
:
UriComponents
,
opts
:
files
.
IWatchOptions
):
void
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录