Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
8fe9f631
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,发现更多精彩内容 >>
提交
8fe9f631
编写于
10月 27, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unused argument, #30010
上级
1420d41b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
13 deletion
+13
-13
src/vs/editor/common/services/editorSimpleWorker.ts
src/vs/editor/common/services/editorSimpleWorker.ts
+1
-1
src/vs/editor/common/services/editorWorkerService.ts
src/vs/editor/common/services/editorWorkerService.ts
+1
-1
src/vs/editor/common/services/editorWorkerServiceImpl.ts
src/vs/editor/common/services/editorWorkerServiceImpl.ts
+4
-4
src/vs/editor/contrib/format/browser/formatActions.ts
src/vs/editor/contrib/format/browser/formatActions.ts
+3
-3
src/vs/editor/test/common/services/editorSimpleWorker.test.ts
...vs/editor/test/common/services/editorSimpleWorker.test.ts
+4
-4
未找到文件。
src/vs/editor/common/services/editorSimpleWorker.ts
浏览文件 @
8fe9f631
...
...
@@ -344,7 +344,7 @@ export abstract class BaseEditorSimpleWorker {
private
static
_diffLimit
=
10000
;
public
computeMoreMinimalEdits
(
modelUrl
:
string
,
edits
:
TextEdit
[]
,
ranges
:
IRange
[]
):
TPromise
<
TextEdit
[]
>
{
public
computeMoreMinimalEdits
(
modelUrl
:
string
,
edits
:
TextEdit
[]):
TPromise
<
TextEdit
[]
>
{
const
model
=
this
.
_getModel
(
modelUrl
);
if
(
!
model
)
{
return
TPromise
.
as
(
edits
);
...
...
src/vs/editor/common/services/editorWorkerService.ts
浏览文件 @
8fe9f631
...
...
@@ -23,7 +23,7 @@ export interface IEditorWorkerService {
canComputeDirtyDiff
(
original
:
URI
,
modified
:
URI
):
boolean
;
computeDirtyDiff
(
original
:
URI
,
modified
:
URI
,
ignoreTrimWhitespace
:
boolean
):
TPromise
<
IChange
[]
>
;
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
TextEdit
[]
,
ranges
:
IRange
[]
):
TPromise
<
TextEdit
[]
>
;
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
TextEdit
[]):
TPromise
<
TextEdit
[]
>
;
canNavigateValueSet
(
resource
:
URI
):
boolean
;
navigateValueSet
(
resource
:
URI
,
range
:
IRange
,
up
:
boolean
):
TPromise
<
IInplaceReplaceSupportResult
>
;
...
...
src/vs/editor/common/services/editorWorkerServiceImpl.ts
浏览文件 @
8fe9f631
...
...
@@ -90,14 +90,14 @@ export class EditorWorkerServiceImpl extends Disposable implements IEditorWorker
return
this
.
_workerManager
.
withWorker
().
then
(
client
=>
client
.
computeDirtyDiff
(
original
,
modified
,
ignoreTrimWhitespace
));
}
public
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
modes
.
TextEdit
[]
,
ranges
:
IRange
[]
):
TPromise
<
modes
.
TextEdit
[]
>
{
public
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
modes
.
TextEdit
[]):
TPromise
<
modes
.
TextEdit
[]
>
{
if
(
!
Array
.
isArray
(
edits
)
||
edits
.
length
===
0
)
{
return
TPromise
.
as
(
edits
);
}
else
{
if
(
!
canSyncModel
(
this
.
_modelService
,
resource
))
{
return
TPromise
.
as
(
edits
);
// File too large
}
return
this
.
_workerManager
.
withWorker
().
then
(
client
=>
client
.
computeMoreMinimalEdits
(
resource
,
edits
,
ranges
));
return
this
.
_workerManager
.
withWorker
().
then
(
client
=>
client
.
computeMoreMinimalEdits
(
resource
,
edits
));
}
}
...
...
@@ -395,9 +395,9 @@ export class EditorWorkerClient extends Disposable {
});
}
public
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
modes
.
TextEdit
[]
,
ranges
:
IRange
[]
):
TPromise
<
modes
.
TextEdit
[]
>
{
public
computeMoreMinimalEdits
(
resource
:
URI
,
edits
:
modes
.
TextEdit
[]):
TPromise
<
modes
.
TextEdit
[]
>
{
return
this
.
_withSyncedResources
([
resource
]).
then
(
proxy
=>
{
return
proxy
.
computeMoreMinimalEdits
(
resource
.
toString
(),
edits
,
ranges
);
return
proxy
.
computeMoreMinimalEdits
(
resource
.
toString
(),
edits
);
});
}
...
...
src/vs/editor/contrib/format/browser/formatActions.ts
浏览文件 @
8fe9f631
...
...
@@ -151,7 +151,7 @@ class FormatOnType implements editorCommon.IEditorContribution {
tabSize
:
modelOpts
.
tabSize
,
insertSpaces
:
modelOpts
.
insertSpaces
}).
then
(
edits
=>
{
return
this
.
workerService
.
computeMoreMinimalEdits
(
model
.
uri
,
edits
,
[]
);
return
this
.
workerService
.
computeMoreMinimalEdits
(
model
.
uri
,
edits
);
}).
then
(
edits
=>
{
unbind
.
dispose
();
...
...
@@ -239,7 +239,7 @@ class FormatOnPaste implements editorCommon.IEditorContribution {
const
state
=
new
EditorState
(
this
.
editor
,
CodeEditorStateFlag
.
Value
|
CodeEditorStateFlag
.
Position
);
getDocumentRangeFormattingEdits
(
model
,
range
,
{
tabSize
,
insertSpaces
}).
then
(
edits
=>
{
return
this
.
workerService
.
computeMoreMinimalEdits
(
model
.
uri
,
edits
,
[]
);
return
this
.
workerService
.
computeMoreMinimalEdits
(
model
.
uri
,
edits
);
}).
then
(
edits
=>
{
if
(
!
state
.
validate
(
this
.
editor
)
||
isFalsyOrEmpty
(
edits
))
{
return
;
...
...
@@ -275,7 +275,7 @@ export abstract class AbstractFormatAction extends EditorAction {
const
state
=
new
EditorState
(
editor
,
CodeEditorStateFlag
.
Value
|
CodeEditorStateFlag
.
Position
);
// Receive formatted value from worker
return
formattingPromise
.
then
(
edits
=>
workerService
.
computeMoreMinimalEdits
(
editor
.
getModel
().
uri
,
edits
,
editor
.
getSelections
()
)).
then
(
edits
=>
{
return
formattingPromise
.
then
(
edits
=>
workerService
.
computeMoreMinimalEdits
(
editor
.
getModel
().
uri
,
edits
)).
then
(
edits
=>
{
if
(
!
state
.
validate
(
editor
)
||
isFalsyOrEmpty
(
edits
))
{
return
;
}
...
...
src/vs/editor/test/common/services/editorSimpleWorker.test.ts
浏览文件 @
8fe9f631
...
...
@@ -88,7 +88,7 @@ suite('EditorSimpleWorker', () => {
test
(
'
MoreMinimal
'
,
function
()
{
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
This is line One
'
,
range
:
new
Range
(
1
,
1
,
1
,
17
)
}]
,
[]
).
then
(
edits
=>
{
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
This is line One
'
,
range
:
new
Range
(
1
,
1
,
1
,
17
)
}]).
then
(
edits
=>
{
assert
.
equal
(
edits
.
length
,
1
);
const
[
first
]
=
edits
;
assert
.
equal
(
first
.
text
,
'
O
'
);
...
...
@@ -104,7 +104,7 @@ suite('EditorSimpleWorker', () => {
'
}
'
],
'
\n
'
);
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
{
\r\n\t
"a":1
\r\n
}
'
,
range
:
new
Range
(
1
,
1
,
3
,
2
)
}]
,
[]
).
then
(
edits
=>
{
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
{
\r\n\t
"a":1
\r\n
}
'
,
range
:
new
Range
(
1
,
1
,
3
,
2
)
}]).
then
(
edits
=>
{
assert
.
equal
(
edits
.
length
,
0
);
});
});
...
...
@@ -117,7 +117,7 @@ suite('EditorSimpleWorker', () => {
'
}
'
],
'
\n
'
);
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
{
\r\n\t
"b":1
\r\n
}
'
,
range
:
new
Range
(
1
,
1
,
3
,
2
)
}]
,
[]
).
then
(
edits
=>
{
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
{
\r\n\t
"b":1
\r\n
}
'
,
range
:
new
Range
(
1
,
1
,
3
,
2
)
}]).
then
(
edits
=>
{
assert
.
equal
(
edits
.
length
,
1
);
const
[
first
]
=
edits
;
assert
.
equal
(
first
.
text
,
'
b
'
);
...
...
@@ -133,7 +133,7 @@ suite('EditorSimpleWorker', () => {
'
}
'
// 3
]);
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
\n
'
,
range
:
new
Range
(
3
,
2
,
4
,
1000
)
}]
,
[]
).
then
(
edits
=>
{
return
worker
.
computeMoreMinimalEdits
(
model
.
uri
.
toString
(),
[{
text
:
'
\n
'
,
range
:
new
Range
(
3
,
2
,
4
,
1000
)
}]).
then
(
edits
=>
{
assert
.
equal
(
edits
.
length
,
1
);
const
[
first
]
=
edits
;
assert
.
equal
(
first
.
text
,
'
\n
'
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录