Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
9cdacb46
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,发现更多精彩内容 >>
提交
9cdacb46
编写于
3月 11, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null supressions in tests
上级
3b228755
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
13 deletion
+13
-13
src/vs/workbench/common/editor/textEditorModel.ts
src/vs/workbench/common/editor/textEditorModel.ts
+2
-2
src/vs/workbench/services/editor/test/browser/editorService.test.ts
...kbench/services/editor/test/browser/editorService.test.ts
+5
-5
src/vs/workbench/test/common/editor/resourceEditorInput.test.ts
.../workbench/test/common/editor/resourceEditorInput.test.ts
+2
-2
src/vs/workbench/test/common/editor/untitledEditor.test.ts
src/vs/workbench/test/common/editor/untitledEditor.test.ts
+1
-1
src/vs/workbench/test/workbenchTestServices.ts
src/vs/workbench/test/workbenchTestServices.ts
+3
-3
未找到文件。
src/vs/workbench/common/editor/textEditorModel.ts
浏览文件 @
9cdacb46
...
...
@@ -68,14 +68,14 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd
/**
* Creates the text editor model with the provided value, modeId (can be comma separated for multiple values) and optional resource URL.
*/
protected
createTextEditorModel
(
value
:
ITextBufferFactory
,
resource
:
URI
,
modeId
?:
string
):
EditorModel
{
protected
createTextEditorModel
(
value
:
ITextBufferFactory
,
resource
:
URI
|
undefined
,
modeId
?:
string
):
EditorModel
{
const
firstLineText
=
this
.
getFirstLineText
(
value
);
const
languageSelection
=
this
.
getOrCreateMode
(
this
.
modeService
,
modeId
,
firstLineText
);
return
this
.
doCreateTextEditorModel
(
value
,
languageSelection
,
resource
);
}
private
doCreateTextEditorModel
(
value
:
ITextBufferFactory
,
languageSelection
:
ILanguageSelection
,
resource
:
URI
):
EditorModel
{
private
doCreateTextEditorModel
(
value
:
ITextBufferFactory
,
languageSelection
:
ILanguageSelection
,
resource
:
URI
|
undefined
):
EditorModel
{
let
model
=
resource
&&
this
.
modelService
.
getModel
(
resource
);
if
(
!
model
)
{
model
=
this
.
modelService
.
createModel
(
value
,
languageSelection
,
resource
);
...
...
src/vs/workbench/services/editor/test/browser/editorService.test.ts
浏览文件 @
9cdacb46
...
...
@@ -52,7 +52,7 @@ export class TestEditorInput extends EditorInput implements IFileEditorInput {
resolve
():
Promise
<
IEditorModel
>
{
return
!
this
.
fails
?
Promise
.
resolve
(
null
)
:
Promise
.
reject
(
new
Error
(
'
fails
'
));
}
matches
(
other
:
TestEditorInput
):
boolean
{
return
other
&&
other
.
resource
&&
this
.
resource
.
toString
()
===
other
.
resource
.
toString
()
&&
other
instanceof
TestEditorInput
;
}
setEncoding
(
encoding
:
string
)
{
}
getEncoding
():
string
{
return
null
;
}
getEncoding
():
string
{
return
null
!
;
}
setPreferredEncoding
(
encoding
:
string
)
{
}
getResource
():
URI
{
return
this
.
resource
;
}
setForceOpenAsBinary
():
void
{
}
...
...
@@ -120,7 +120,7 @@ suite('Editor service', () => {
assert
.
equal
(
visibleEditorChangeEventCounter
,
1
);
// Close input
return
editor
.
group
!
.
closeEditor
(
input
).
then
(()
=>
{
return
editor
!
.
group
!
.
closeEditor
(
input
).
then
(()
=>
{
assert
.
equal
(
didCloseEditorListenerCounter
,
1
);
assert
.
equal
(
activeEditorChangeEventCounter
,
2
);
assert
.
equal
(
visibleEditorChangeEventCounter
,
2
);
...
...
@@ -347,13 +347,13 @@ suite('Editor service', () => {
return
service
.
openEditor
(
input1
,
{
pinned
:
true
,
preserveFocus
:
true
},
SIDE_GROUP
).
then
(
editor
=>
{
assert
.
equal
(
part
.
activeGroup
,
rootGroup
);
assert
.
equal
(
part
.
count
,
2
);
assert
.
equal
(
editor
.
group
,
part
.
groups
[
1
]);
assert
.
equal
(
editor
!
.
group
,
part
.
groups
[
1
]);
// Open to the side uses existing neighbour group if any
return
service
.
openEditor
(
input2
,
{
pinned
:
true
,
preserveFocus
:
true
},
SIDE_GROUP
).
then
(
editor
=>
{
assert
.
equal
(
part
.
activeGroup
,
rootGroup
);
assert
.
equal
(
part
.
count
,
2
);
assert
.
equal
(
editor
.
group
,
part
.
groups
[
1
]);
assert
.
equal
(
editor
!
.
group
,
part
.
groups
[
1
]);
});
});
});
...
...
@@ -403,7 +403,7 @@ suite('Editor service', () => {
// 1.) open, open same, open other, close
let
editor
=
await
service
.
openEditor
(
input
,
{
pinned
:
true
});
const
group
=
editor
.
group
!
;
const
group
=
editor
!
.
group
!
;
assertActiveEditorChangedEvent
(
true
);
assertVisibleEditorsChangedEvent
(
true
);
...
...
src/vs/workbench/test/common/editor/resourceEditorInput.test.ts
浏览文件 @
9cdacb46
...
...
@@ -36,9 +36,9 @@ suite('Workbench resource editor input', () => {
accessor
.
modelService
.
createModel
(
'
function test() {}
'
,
accessor
.
modeService
.
create
(
'
text
'
),
resource
);
let
input
:
ResourceEditorInput
=
instantiationService
.
createInstance
(
ResourceEditorInput
,
'
The Name
'
,
'
The Description
'
,
resource
);
return
input
.
resolve
().
then
(
(
model
:
ResourceEditorModel
)
=>
{
return
input
.
resolve
().
then
(
model
=>
{
assert
.
ok
(
model
);
assert
.
equal
(
snapshotToString
(
model
.
createSnapshot
()
),
'
function test() {}
'
);
assert
.
equal
(
snapshotToString
(
(
model
as
ResourceEditorModel
).
createSnapshot
()
!
),
'
function test() {}
'
);
});
});
});
\ No newline at end of file
src/vs/workbench/test/common/editor/untitledEditor.test.ts
浏览文件 @
9cdacb46
...
...
@@ -18,7 +18,7 @@ import { snapshotToString } from 'vs/platform/files/common/files';
import
{
timeout
}
from
'
vs/base/common/async
'
;
export
class
TestUntitledEditorService
extends
UntitledEditorService
{
get
(
resource
:
URI
)
:
UntitledEditorInput
{
return
super
.
get
(
resource
);
}
get
(
resource
:
URI
)
{
return
super
.
get
(
resource
);
}
getAll
(
resources
?:
URI
[]):
UntitledEditorInput
[]
{
return
super
.
getAll
(
resources
);
}
}
...
...
src/vs/workbench/test/workbenchTestServices.ts
浏览文件 @
9cdacb46
...
...
@@ -601,7 +601,7 @@ export class TestViewletService implements IViewletService {
public
hideActiveViewlet
():
void
{
}
public
getLastActiveViewletId
():
string
{
return
undefined
;
return
undefined
!
;
}
}
...
...
@@ -639,7 +639,7 @@ export class TestPanelService implements IPanelService {
public
hideActivePanel
():
void
{
}
public
getLastActivePanelId
():
string
{
return
undefined
;
return
undefined
!
;
}
}
...
...
@@ -847,7 +847,7 @@ export class TestEditorService implements EditorServiceImpl {
activeTextEditorWidget
:
any
;
activeEditor
:
IEditorInput
;
editors
:
ReadonlyArray
<
IEditorInput
>
=
[];
visibleControls
:
ReadonlyArray
<
IEditor
>
=
[];
visibleControls
:
ReadonlyArray
<
I
Visible
Editor
>
=
[];
visibleTextEditorWidgets
=
[];
visibleEditors
:
ReadonlyArray
<
IEditorInput
>
=
[];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录