Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
c2398f8f
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c2398f8f
编写于
7月 07, 2021
作者:
C
Connor Peet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
testing: sort by status or location, not name
Fixes #126620 Fixes #127122
上级
583f6d14
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
19 deletion
+16
-19
src/vs/workbench/contrib/testing/browser/testExplorerActions.ts
.../workbench/contrib/testing/browser/testExplorerActions.ts
+7
-7
src/vs/workbench/contrib/testing/browser/testingExplorerView.ts
.../workbench/contrib/testing/browser/testingExplorerView.ts
+8
-11
src/vs/workbench/contrib/testing/common/constants.ts
src/vs/workbench/contrib/testing/common/constants.ts
+1
-1
未找到文件。
src/vs/workbench/contrib/testing/browser/testExplorerActions.ts
浏览文件 @
c2398f8f
...
...
@@ -411,14 +411,14 @@ export class TestingViewAsTreeAction extends ViewAction<TestingExplorerView> {
}
export
class
TestingSortBy
Name
Action
extends
ViewAction
<
TestingExplorerView
>
{
public
static
readonly
ID
=
'
testing.sortBy
Name
'
;
export
class
TestingSortBy
Status
Action
extends
ViewAction
<
TestingExplorerView
>
{
public
static
readonly
ID
=
'
testing.sortBy
Status
'
;
constructor
()
{
super
({
id
:
TestingSortBy
Name
Action
.
ID
,
id
:
TestingSortBy
Status
Action
.
ID
,
viewId
:
Testing
.
ExplorerViewId
,
title
:
localize
(
'
testing.sortBy
Name
'
,
"
Sort by Name
"
),
toggled
:
TestingContextKeys
.
viewSorting
.
isEqualTo
(
TestExplorerViewSorting
.
By
Name
),
title
:
localize
(
'
testing.sortBy
Status
'
,
"
Sort by Status
"
),
toggled
:
TestingContextKeys
.
viewSorting
.
isEqualTo
(
TestExplorerViewSorting
.
By
Status
),
menu
:
{
id
:
MenuId
.
ViewTitle
,
order
:
ActionOrder
.
Sort
,
...
...
@@ -432,7 +432,7 @@ export class TestingSortByNameAction extends ViewAction<TestingExplorerView> {
* @override
*/
public
runInView
(
_accessor
:
ServicesAccessor
,
view
:
TestingExplorerView
)
{
view
.
viewModel
.
viewSorting
=
TestExplorerViewSorting
.
By
Name
;
view
.
viewModel
.
viewSorting
=
TestExplorerViewSorting
.
By
Status
;
}
}
...
...
@@ -1182,7 +1182,7 @@ export const allTestActions = [
SearchForTestExtension
,
ShowMostRecentOutputAction
,
TestingSortByLocationAction
,
TestingSortBy
Name
Action
,
TestingSortBy
Status
Action
,
TestingViewAsListAction
,
TestingViewAsTreeAction
,
UnhideTestAction
,
...
...
src/vs/workbench/contrib/testing/browser/testingExplorerView.ts
浏览文件 @
c2398f8f
...
...
@@ -252,7 +252,7 @@ export class TestingExplorerViewModel extends Disposable {
public
get
viewSorting
()
{
return
this
.
_viewSorting
.
get
()
??
TestExplorerViewSorting
.
By
Location
;
return
this
.
_viewSorting
.
get
()
??
TestExplorerViewSorting
.
By
Status
;
}
public
set
viewSorting
(
newSorting
:
TestExplorerViewSorting
)
{
...
...
@@ -714,18 +714,15 @@ class TreeSorter implements ITreeSorter<TestExplorerTreeElement> {
return
(
a
instanceof
TestTreeErrorMessage
?
-
1
:
0
)
+
(
b
instanceof
TestTreeErrorMessage
?
1
:
0
);
}
let
d
elta
=
cmpPriority
(
a
.
state
,
b
.
state
);
if
(
d
elta
!==
0
)
{
return
d
elta
;
const
stateD
elta
=
cmpPriority
(
a
.
state
,
b
.
state
);
if
(
this
.
viewModel
.
viewSorting
===
TestExplorerViewSorting
.
ByStatus
&&
stateD
elta
!==
0
)
{
return
stateD
elta
;
}
if
(
this
.
viewModel
.
viewSorting
===
TestExplorerViewSorting
.
ByLocation
)
{
if
(
a
instanceof
TestItemTreeElement
&&
b
instanceof
TestItemTreeElement
&&
a
.
test
.
item
.
uri
&&
b
.
test
.
item
.
uri
&&
a
.
test
.
item
.
uri
.
toString
()
===
b
.
test
.
item
.
uri
.
toString
()
&&
a
.
test
.
item
.
range
&&
b
.
test
.
item
.
range
)
{
const
delta
=
a
.
test
.
item
.
range
.
startLineNumber
-
b
.
test
.
item
.
range
.
startLineNumber
;
if
(
delta
!==
0
)
{
return
delta
;
}
if
(
a
instanceof
TestItemTreeElement
&&
b
instanceof
TestItemTreeElement
&&
a
.
test
.
item
.
uri
&&
b
.
test
.
item
.
uri
&&
a
.
test
.
item
.
uri
.
toString
()
===
b
.
test
.
item
.
uri
.
toString
()
&&
a
.
test
.
item
.
range
&&
b
.
test
.
item
.
range
)
{
const
delta
=
a
.
test
.
item
.
range
.
startLineNumber
-
b
.
test
.
item
.
range
.
startLineNumber
;
if
(
delta
!==
0
)
{
return
delta
;
}
}
...
...
src/vs/workbench/contrib/testing/common/constants.ts
浏览文件 @
c2398f8f
...
...
@@ -22,7 +22,7 @@ export const enum TestExplorerViewMode {
export
const
enum
TestExplorerViewSorting
{
ByLocation
=
'
location
'
,
By
Name
=
'
name
'
,
By
Status
=
'
status
'
,
}
export
const
enum
TestExplorerStateFilter
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录