Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
d7b9db88
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,发现更多精彩内容 >>
提交
d7b9db88
编写于
2月 15, 2019
作者:
M
Matt Bierner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Strict null supressions in extHostLanguageFeatures.test
上级
fe6bd12a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
28 deletion
+27
-28
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
...test/electron-browser/api/extHostLanguageFeatures.test.ts
+27
-28
未找到文件。
src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts
浏览文件 @
d7b9db88
...
...
@@ -49,6 +49,7 @@ import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/smartSelec
import
{
NullTelemetryService
}
from
'
vs/platform/telemetry/common/telemetryUtils
'
;
import
{
mock
}
from
'
vs/workbench/test/electron-browser/api/mock
'
;
import
{
IEditorWorkerService
}
from
'
vs/editor/common/services/editorWorkerService
'
;
import
{
dispose
}
from
'
vs/base/common/lifecycle
'
;
const
defaultSelector
=
{
scheme
:
'
far
'
};
const
model
:
ITextModel
=
EditorModel
.
createFromString
(
...
...
@@ -127,10 +128,8 @@ suite('ExtHostLanguageFeatures', function () {
mainThread
.
dispose
();
});
teardown
(
function
()
{
while
(
disposables
.
length
)
{
disposables
.
pop
().
dispose
();
}
teardown
(()
=>
{
disposables
=
dispose
(
disposables
);
return
rpcProtocol
.
sync
();
});
...
...
@@ -219,10 +218,10 @@ suite('ExtHostLanguageFeatures', function () {
await
rpcProtocol
.
sync
();
const
value
=
await
getCodeLensData
(
model
,
CancellationToken
.
None
);
assert
.
equal
(
value
.
length
,
1
);
le
t
data
=
value
[
0
];
const
symbol
=
await
Promise
.
resolve
(
data
.
provider
.
resolveCodeLens
(
model
,
data
.
symbol
,
CancellationToken
.
None
));
assert
.
equal
(
symbol
.
command
.
id
,
'
id
'
);
assert
.
equal
(
symbol
.
command
.
title
,
'
Title
'
);
cons
t
data
=
value
[
0
];
const
symbol
=
await
Promise
.
resolve
(
data
.
provider
.
resolveCodeLens
!
(
model
,
data
.
symbol
,
CancellationToken
.
None
));
assert
.
equal
(
symbol
!
.
command
!
.
id
,
'
id
'
);
assert
.
equal
(
symbol
!
.
command
!
.
title
,
'
Title
'
);
});
test
(
'
CodeLens, missing command
'
,
async
()
=>
{
...
...
@@ -237,9 +236,9 @@ suite('ExtHostLanguageFeatures', function () {
const
value
=
await
getCodeLensData
(
model
,
CancellationToken
.
None
);
assert
.
equal
(
value
.
length
,
1
);
let
data
=
value
[
0
];
const
symbol
=
await
Promise
.
resolve
(
data
.
provider
.
resolveCodeLens
(
model
,
data
.
symbol
,
CancellationToken
.
None
));
assert
.
equal
(
symbol
.
command
.
id
,
'
missing
'
);
assert
.
equal
(
symbol
.
command
.
title
,
'
!!MISSING: command!!
'
);
const
symbol
=
await
Promise
.
resolve
(
data
.
provider
.
resolveCodeLens
!
(
model
,
data
.
symbol
,
CancellationToken
.
None
));
assert
.
equal
(
symbol
!
.
command
!
.
id
,
'
missing
'
);
assert
.
equal
(
symbol
!
.
command
!
.
title
,
'
!!MISSING: command!!
'
);
});
// --- definition
...
...
@@ -461,9 +460,9 @@ suite('ExtHostLanguageFeatures', function () {
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getOccurrencesAtPosition
(
model
,
new
EditorPosition
(
1
,
2
),
CancellationToken
.
None
)
;
const
value
=
(
await
getOccurrencesAtPosition
(
model
,
new
EditorPosition
(
1
,
2
),
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
1
);
le
t
[
entry
]
=
value
;
cons
t
[
entry
]
=
value
;
assert
.
deepEqual
(
entry
.
range
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
5
});
assert
.
equal
(
entry
.
kind
,
modes
.
DocumentHighlightKind
.
Text
);
});
...
...
@@ -482,9 +481,9 @@ suite('ExtHostLanguageFeatures', function () {
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getOccurrencesAtPosition
(
model
,
new
EditorPosition
(
1
,
2
),
CancellationToken
.
None
)
;
const
value
=
(
await
getOccurrencesAtPosition
(
model
,
new
EditorPosition
(
1
,
2
),
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
1
);
le
t
[
entry
]
=
value
;
cons
t
[
entry
]
=
value
;
assert
.
deepEqual
(
entry
.
range
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
5
});
assert
.
equal
(
entry
.
kind
,
modes
.
DocumentHighlightKind
.
Text
);
});
...
...
@@ -526,7 +525,7 @@ suite('ExtHostLanguageFeatures', function () {
await
rpcProtocol
.
sync
();
const
value
=
await
getOccurrencesAtPosition
(
model
,
new
EditorPosition
(
1
,
2
),
CancellationToken
.
None
);
assert
.
equal
(
value
.
length
,
1
);
assert
.
equal
(
value
!
.
length
,
1
);
});
// --- references
...
...
@@ -605,9 +604,9 @@ suite('ExtHostLanguageFeatures', function () {
assert
.
equal
(
value
.
length
,
2
);
const
[
first
,
second
]
=
value
;
assert
.
equal
(
first
.
title
,
'
Testing1
'
);
assert
.
equal
(
first
.
command
.
id
,
'
test1
'
);
assert
.
equal
(
first
.
command
!
.
id
,
'
test1
'
);
assert
.
equal
(
second
.
title
,
'
Testing2
'
);
assert
.
equal
(
second
.
command
.
id
,
'
test2
'
);
assert
.
equal
(
second
.
command
!
.
id
,
'
test2
'
);
});
test
(
'
Quick Fix, code action data conversion
'
,
async
()
=>
{
...
...
@@ -629,8 +628,8 @@ suite('ExtHostLanguageFeatures', function () {
assert
.
equal
(
value
.
length
,
1
);
const
[
first
]
=
value
;
assert
.
equal
(
first
.
title
,
'
Testing1
'
);
assert
.
equal
(
first
.
command
.
title
,
'
Testing1Command
'
);
assert
.
equal
(
first
.
command
.
id
,
'
test1
'
);
assert
.
equal
(
first
.
command
!
.
title
,
'
Testing1Command
'
);
assert
.
equal
(
first
.
command
!
.
id
,
'
test1
'
);
assert
.
equal
(
first
.
kind
,
'
test.scope
'
);
});
...
...
@@ -925,7 +924,7 @@ suite('ExtHostLanguageFeatures', function () {
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getDocumentFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
)
;
let
value
=
(
await
getDocumentFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
2
);
let
[
first
,
second
]
=
value
;
assert
.
equal
(
first
.
text
,
'
testing
'
);
...
...
@@ -967,7 +966,7 @@ suite('ExtHostLanguageFeatures', function () {
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getDocumentFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
)
;
let
value
=
(
await
getDocumentFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
1
);
let
[
first
]
=
value
;
assert
.
equal
(
first
.
text
,
'
testing
'
);
...
...
@@ -982,9 +981,9 @@ suite('ExtHostLanguageFeatures', function () {
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getDocumentRangeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorRange
(
1
,
1
,
1
,
1
),
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
)
;
const
value
=
(
await
getDocumentRangeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorRange
(
1
,
1
,
1
,
1
),
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
1
);
le
t
[
first
]
=
value
;
cons
t
[
first
]
=
value
;
assert
.
equal
(
first
.
text
,
'
testing
'
);
assert
.
deepEqual
(
first
.
range
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
});
});
...
...
@@ -1006,9 +1005,9 @@ suite('ExtHostLanguageFeatures', function () {
}
}));
await
rpcProtocol
.
sync
();
let
value
=
await
getDocumentRangeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorRange
(
1
,
1
,
1
,
1
),
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
)
;
const
value
=
(
await
getDocumentRangeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorRange
(
1
,
1
,
1
,
1
),
{
insertSpaces
:
true
,
tabSize
:
4
},
FormatMode
.
Auto
,
CancellationToken
.
None
))
!
;
assert
.
equal
(
value
.
length
,
1
);
le
t
[
first
]
=
value
;
cons
t
[
first
]
=
value
;
assert
.
equal
(
first
.
text
,
'
range2
'
);
assert
.
equal
(
first
.
range
.
startLineNumber
,
3
);
assert
.
equal
(
first
.
range
.
startColumn
,
4
);
...
...
@@ -1036,9 +1035,9 @@ suite('ExtHostLanguageFeatures', function () {
},
[
'
;
'
]));
await
rpcProtocol
.
sync
();
let
value
=
await
getOnTypeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorPosition
(
1
,
1
),
'
;
'
,
{
insertSpaces
:
true
,
tabSize
:
2
})
;
const
value
=
(
await
getOnTypeFormattingEdits
(
NullTelemetryService
,
NullWorkerService
,
model
,
new
EditorPosition
(
1
,
1
),
'
;
'
,
{
insertSpaces
:
true
,
tabSize
:
2
}))
!
;
assert
.
equal
(
value
.
length
,
1
);
le
t
[
first
]
=
value
;
cons
t
[
first
]
=
value
;
assert
.
equal
(
first
.
text
,
'
;
'
);
assert
.
deepEqual
(
first
.
range
,
{
startLineNumber
:
1
,
startColumn
:
1
,
endLineNumber
:
1
,
endColumn
:
1
});
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录