Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
65270230
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,发现更多精彩内容 >>
提交
65270230
编写于
7月 09, 2019
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tweak options for delete and write, #48034
上级
a4fc9bb8
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
12 addition
and
14 deletion
+12
-14
extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts
...ode-api-tests/src/singlefolder-tests/workspace.fs.test.ts
+2
-2
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+3
-4
src/vs/workbench/api/browser/mainThreadFileSystem.ts
src/vs/workbench/api/browser/mainThreadFileSystem.ts
+2
-3
src/vs/workbench/api/common/extHost.protocol.ts
src/vs/workbench/api/common/extHost.protocol.ts
+1
-1
src/vs/workbench/api/common/extHostFileSystem.ts
src/vs/workbench/api/common/extHostFileSystem.ts
+4
-4
未找到文件。
extensions/vscode-api-tests/src/singlefolder-tests/workspace.fs.test.ts
浏览文件 @
65270230
...
...
@@ -83,7 +83,7 @@ suite('workspace-fs', () => {
// ensure non empty folder cannot be deleted
try
{
await
vscode
.
workspace
.
fs
.
delete
(
folder
,
{
recursive
:
false
});
await
vscode
.
workspace
.
fs
.
delete
(
folder
,
{
recursive
:
false
,
useTrash
:
false
});
assert
.
ok
(
false
);
}
catch
{
await
vscode
.
workspace
.
fs
.
stat
(
folder
);
...
...
@@ -100,7 +100,7 @@ suite('workspace-fs', () => {
}
// delete non empty folder with recursive-flag
await
vscode
.
workspace
.
fs
.
delete
(
folder
,
{
recursive
:
true
});
await
vscode
.
workspace
.
fs
.
delete
(
folder
,
{
recursive
:
true
,
useTrash
:
false
});
// esnure folder/file are gone
try
{
...
...
src/vs/vscode.proposed.d.ts
浏览文件 @
65270230
...
...
@@ -1638,17 +1638,16 @@ declare module 'vscode' {
*
* @param uri The uri of the file.
* @param content The new content of the file.
* @param options Defines if missing files should or must be created.
*/
writeFile
(
uri
:
Uri
,
content
:
Uint8Array
,
options
?:
{
create
:
boolean
,
overwrite
:
boolean
}
):
Thenable
<
void
>
;
writeFile
(
uri
:
Uri
,
content
:
Uint8Array
):
Thenable
<
void
>
;
/**
* Delete a file.
*
* @param uri The resource that is to be deleted.
* @param options Defines if
deletion of folders is recursive.
* @param options Defines if
trash can should be used and if deletion of folders is recursive
*/
delete
(
uri
:
Uri
,
options
?:
{
recursive
:
boolean
}):
Thenable
<
void
>
;
delete
(
uri
:
Uri
,
options
?:
{
recursive
:
boolean
,
useTrash
:
boolean
}):
Thenable
<
void
>
;
/**
* Rename a file or folder.
...
...
src/vs/workbench/api/browser/mainThreadFileSystem.ts
浏览文件 @
65270230
...
...
@@ -79,9 +79,8 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
return
this
.
_fileService
.
readFile
(
URI
.
revive
(
uri
)).
then
(
file
=>
file
.
value
).
catch
(
MainThreadFileSystem
.
_handleError
);
}
$writeFile
(
uri
:
UriComponents
,
content
:
VSBuffer
,
opts
:
FileWriteOptions
):
Promise
<
void
>
{
//todo@joh honor opts
return
this
.
_fileService
.
writeFile
(
URI
.
revive
(
uri
),
content
,
{}).
catch
(
MainThreadFileSystem
.
_handleError
);
$writeFile
(
uri
:
UriComponents
,
content
:
VSBuffer
):
Promise
<
void
>
{
return
this
.
_fileService
.
writeFile
(
URI
.
revive
(
uri
),
content
).
catch
(
MainThreadFileSystem
.
_handleError
);
}
$rename
(
source
:
UriComponents
,
target
:
UriComponents
,
opts
:
FileOverwriteOptions
):
Promise
<
void
>
{
...
...
src/vs/workbench/api/common/extHost.protocol.ts
浏览文件 @
65270230
...
...
@@ -612,7 +612,7 @@ export interface MainThreadFileSystemShape extends IDisposable {
$stat
(
uri
:
UriComponents
):
Promise
<
files
.
IStat
>
;
$readdir
(
resource
:
UriComponents
):
Promise
<
[
string
,
files
.
FileType
][]
>
;
$readFile
(
resource
:
UriComponents
):
Promise
<
VSBuffer
>
;
$writeFile
(
resource
:
UriComponents
,
content
:
VSBuffer
,
opts
:
files
.
FileWriteOptions
):
Promise
<
void
>
;
$writeFile
(
resource
:
UriComponents
,
content
:
VSBuffer
):
Promise
<
void
>
;
$rename
(
resource
:
UriComponents
,
target
:
UriComponents
,
opts
:
files
.
FileOverwriteOptions
):
Promise
<
void
>
;
$copy
(
resource
:
UriComponents
,
target
:
UriComponents
,
opts
:
files
.
FileOverwriteOptions
):
Promise
<
void
>
;
$mkdir
(
resource
:
UriComponents
):
Promise
<
void
>
;
...
...
src/vs/workbench/api/common/extHostFileSystem.ts
浏览文件 @
65270230
...
...
@@ -119,11 +119,11 @@ class ConsumerFileSystem implements vscode.FileSystem {
async
readFile
(
uri
:
vscode
.
Uri
):
Promise
<
Uint8Array
>
{
return
this
.
_proxy
.
$readFile
(
uri
).
then
(
buff
=>
buff
.
buffer
).
catch
(
ConsumerFileSystem
.
_handleError
);
}
writeFile
(
uri
:
vscode
.
Uri
,
content
:
Uint8Array
,
options
:
{
create
:
boolean
;
overwrite
:
boolean
;
}
=
{
create
:
true
,
overwrite
:
true
}
):
Promise
<
void
>
{
return
this
.
_proxy
.
$writeFile
(
uri
,
VSBuffer
.
wrap
(
content
)
,
options
).
catch
(
ConsumerFileSystem
.
_handleError
);
writeFile
(
uri
:
vscode
.
Uri
,
content
:
Uint8Array
):
Promise
<
void
>
{
return
this
.
_proxy
.
$writeFile
(
uri
,
VSBuffer
.
wrap
(
content
)).
catch
(
ConsumerFileSystem
.
_handleError
);
}
delete
(
uri
:
vscode
.
Uri
,
options
:
{
recursive
:
boolean
;
}
=
{
recursive
:
false
}):
Promise
<
void
>
{
return
this
.
_proxy
.
$delete
(
uri
,
{
...
options
,
useTrash
:
false
}).
catch
(
ConsumerFileSystem
.
_handleError
);
//todo@joh useTrash
delete
(
uri
:
vscode
.
Uri
,
options
:
{
recursive
:
boolean
;
useTrash
:
boolean
;
}
=
{
recursive
:
false
,
useTrash
:
false
}):
Promise
<
void
>
{
return
this
.
_proxy
.
$delete
(
uri
,
options
).
catch
(
ConsumerFileSystem
.
_handleError
);
}
rename
(
oldUri
:
vscode
.
Uri
,
newUri
:
vscode
.
Uri
,
options
:
{
overwrite
:
boolean
;
}
=
{
overwrite
:
false
}):
Promise
<
void
>
{
return
this
.
_proxy
.
$rename
(
oldUri
,
newUri
,
options
).
catch
(
ConsumerFileSystem
.
_handleError
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录