Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e037cdbd
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,发现更多精彩内容 >>
提交
e037cdbd
编写于
6月 18, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add proposed api for #10659
上级
2d3f51ad
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
30 deletion
+39
-30
src/vs/vscode.proposed.d.ts
src/vs/vscode.proposed.d.ts
+10
-0
src/vs/workbench/api/node/extHostTypeConverters.ts
src/vs/workbench/api/node/extHostTypeConverters.ts
+7
-7
src/vs/workbench/api/node/extHostTypes.ts
src/vs/workbench/api/node/extHostTypes.ts
+22
-23
未找到文件。
src/vs/vscode.proposed.d.ts
浏览文件 @
e037cdbd
...
...
@@ -482,6 +482,16 @@ declare module 'vscode' {
//#endregion
//#region joh: https://github.com/Microsoft/vscode/issues/10659
export
interface
WorkspaceEdit
{
createFile
(
uri
:
Uri
):
void
;
deleteFile
(
uri
:
Uri
):
void
;
renameFile
(
oldUri
:
Uri
,
newUri
:
Uri
):
void
;
}
//#endregion
//#region mjbvz: Unused diagnostics
/**
* Additional metadata about the type of diagnostic.
...
...
src/vs/workbench/api/node/extHostTypeConverters.ts
浏览文件 @
e037cdbd
...
...
@@ -21,7 +21,7 @@ import { ISelection } from 'vs/editor/common/core/selection';
import
*
as
htmlContent
from
'
vs/base/common/htmlContent
'
;
import
{
IRelativePattern
}
from
'
vs/base/common/glob
'
;
import
*
as
languageSelector
from
'
vs/editor/common/modes/languageSelector
'
;
import
{
WorkspaceEditDto
,
ResourceTextEditDto
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
WorkspaceEditDto
,
ResourceTextEditDto
,
ResourceFileEditDto
}
from
'
vs/workbench/api/node/extHost.protocol
'
;
import
{
MarkerSeverity
,
IRelatedInformation
,
IMarkerData
,
MarkerTag
}
from
'
vs/platform/markers/common/markers
'
;
import
{
ACTIVE_GROUP
,
SIDE_GROUP
}
from
'
vs/workbench/services/editor/common/editorService
'
;
...
...
@@ -273,7 +273,7 @@ export namespace WorkspaceEdit {
const
result
:
modes
.
WorkspaceEdit
=
{
edits
:
[]
};
for
(
const
entry
of
value
.
e
ntries
())
{
for
(
const
entry
of
(
value
as
types
.
WorkspaceEdit
).
allE
ntries
())
{
const
[
uri
,
uriOrEdits
]
=
entry
;
if
(
Array
.
isArray
(
uriOrEdits
))
{
// text edits
...
...
@@ -294,11 +294,11 @@ export namespace WorkspaceEdit {
URI
.
revive
((
<
ResourceTextEditDto
>
edit
).
resource
),
<
types
.
TextEdit
[]
>
(
<
ResourceTextEditDto
>
edit
).
edits
.
map
(
TextEdit
.
to
)
);
//
} else {
// result.renameResourc
e(
//
URI.revive((<ResourceFileEditDto>edit).oldUri),
//
URI.revive((<ResourceFileEditDto>edit).newUri)
//
);
}
else
{
result
.
renameFil
e
(
URI
.
revive
((
<
ResourceFileEditDto
>
edit
).
oldUri
),
URI
.
revive
((
<
ResourceFileEditDto
>
edit
).
newUri
)
);
}
}
return
result
;
...
...
src/vs/workbench/api/node/extHostTypes.ts
浏览文件 @
e037cdbd
...
...
@@ -499,17 +499,17 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
private
_resourceEdits
:
{
seq
:
number
,
from
:
URI
,
to
:
URI
}[]
=
[];
private
_textEdits
=
new
Map
<
string
,
{
seq
:
number
,
uri
:
URI
,
edits
:
TextEdit
[]
}
>
();
// createResourc
e(uri: vscode.Uri): void {
// this.renameResourc
e(undefined, uri);
//
}
createFil
e
(
uri
:
vscode
.
Uri
):
void
{
this
.
renameFil
e
(
undefined
,
uri
);
}
// deleteResourc
e(uri: vscode.Uri): void {
// this.renameResourc
e(uri, undefined);
//
}
deleteFil
e
(
uri
:
vscode
.
Uri
):
void
{
this
.
renameFil
e
(
uri
,
undefined
);
}
// renameResourc
e(from: vscode.Uri, to: vscode.Uri): void {
//
this._resourceEdits.push({ seq: this._seqPool++, from, to });
//
}
renameFil
e
(
from
:
vscode
.
Uri
,
to
:
vscode
.
Uri
):
void
{
this
.
_resourceEdits
.
push
({
seq
:
this
.
_seqPool
++
,
from
,
to
});
}
// resourceEdits(): [vscode.Uri, vscode.Uri][] {
// return this._resourceEdits.map(({ from, to }) => (<[vscode.Uri, vscode.Uri]>[from, to]));
...
...
@@ -566,20 +566,19 @@ export class WorkspaceEdit implements vscode.WorkspaceEdit {
}
allEntries
():
([
URI
,
TextEdit
[]]
|
[
URI
,
URI
])[]
{
return
this
.
entries
();
// // use the 'seq' the we have assigned when inserting
// // the operation and use that order in the resulting
// // array
// const res: ([URI, TextEdit[]] | [URI, URI])[] = [];
// this._textEdits.forEach(value => {
// const { seq, uri, edits } = value;
// res[seq] = [uri, edits];
// });
// this._resourceEdits.forEach(value => {
// const { seq, from, to } = value;
// res[seq] = [from, to];
// });
// return res;
// use the 'seq' the we have assigned when inserting
// the operation and use that order in the resulting
// array
const
res
:
([
URI
,
TextEdit
[]]
|
[
URI
,
URI
])[]
=
[];
this
.
_textEdits
.
forEach
(
value
=>
{
const
{
seq
,
uri
,
edits
}
=
value
;
res
[
seq
]
=
[
uri
,
edits
];
});
this
.
_resourceEdits
.
forEach
(
value
=>
{
const
{
seq
,
from
,
to
}
=
value
;
res
[
seq
]
=
[
from
,
to
];
});
return
res
;
}
get
size
():
number
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录