Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
5ed6a46d
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,发现更多精彩内容 >>
提交
5ed6a46d
编写于
11月 06, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #53200
上级
4e25dc48
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
72 addition
and
39 deletion
+72
-39
src/vs/workbench/contrib/markers/browser/markersPanel.ts
src/vs/workbench/contrib/markers/browser/markersPanel.ts
+26
-12
src/vs/workbench/contrib/markers/browser/markersPanelActions.ts
.../workbench/contrib/markers/browser/markersPanelActions.ts
+30
-15
src/vs/workbench/contrib/markers/browser/media/markers.css
src/vs/workbench/contrib/markers/browser/media/markers.css
+16
-12
未找到文件。
src/vs/workbench/contrib/markers/browser/markersPanel.ts
浏览文件 @
5ed6a46d
...
...
@@ -34,7 +34,7 @@ import { deepClone } from 'vs/base/common/objects';
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
FilterData
,
Filter
,
VirtualDelegate
,
ResourceMarkersRenderer
,
MarkerRenderer
,
RelatedInformationRenderer
,
TreeElement
,
MarkersTreeAccessibilityProvider
,
MarkersViewModel
,
ResourceDragAndDrop
}
from
'
vs/workbench/contrib/markers/browser/markersTreeViewer
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
Separator
,
ActionViewItem
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
Separator
,
ActionViewItem
,
ActionBar
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
IMenuService
,
MenuId
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IKeyboardEvent
,
StandardKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
...
...
@@ -75,12 +75,12 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
private
readonly
filter
:
Filter
;
private
tree
!
:
MarkersTree
;
private
filterActionBar
!
:
ActionBar
;
private
messageBoxContainer
!
:
HTMLElement
;
private
ariaLabelElement
!
:
HTMLElement
;
private
readonly
collapseAllAction
:
IAction
;
private
readonly
filterAction
:
MarkersFilterAction
;
private
filterInputActionViewItem
:
MarkersFilterActionViewItem
|
null
=
null
;
private
readonly
panelState
:
MementoObject
;
private
panelFoucusContextKey
:
IContextKey
<
boolean
>
;
...
...
@@ -91,6 +91,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
private
currentResourceGotAddedToMarkersData
:
boolean
=
false
;
readonly
markersViewModel
:
MarkersViewModel
;
private
isSmallLayout
:
boolean
=
false
;
constructor
(
@
IInstantiationService
private
readonly
instantiationService
:
IInstantiationService
,
...
...
@@ -129,6 +130,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
const
container
=
dom
.
append
(
parent
,
dom
.
$
(
'
.markers-panel-container
'
));
this
.
createFilterActionBar
(
container
);
this
.
createArialLabelElement
(
container
);
this
.
createMessageBox
(
container
);
this
.
createTree
(
container
);
...
...
@@ -147,6 +149,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
}));
this
.
filterActionBar
.
push
(
this
.
filterAction
);
this
.
render
();
}
...
...
@@ -155,10 +158,15 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
public
layout
(
dimension
:
dom
.
Dimension
):
void
{
this
.
tree
.
layout
(
dimension
.
height
,
dimension
.
width
);
if
(
this
.
filterInputActionViewItem
)
{
this
.
filterInputActionViewItem
.
toggleLayout
(
dimension
.
width
<
1200
);
const
wasSmallLayout
=
this
.
isSmallLayout
;
this
.
isSmallLayout
=
dimension
.
width
<
600
;
if
(
this
.
isSmallLayout
!==
wasSmallLayout
)
{
this
.
updateTitleArea
();
dom
.
toggleClass
(
this
.
filterActionBar
.
getContainer
(),
'
hide
'
,
!
this
.
isSmallLayout
);
}
const
treeHeight
=
this
.
isSmallLayout
?
dimension
.
height
-
44
:
dimension
.
height
;
this
.
tree
.
layout
(
treeHeight
,
dimension
.
width
);
this
.
filterAction
.
layout
(
this
.
isSmallLayout
?
dimension
.
width
:
dimension
.
width
-
200
);
}
public
focus
():
void
{
...
...
@@ -174,12 +182,13 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
public
focusFilter
():
void
{
if
(
this
.
filterInputActionViewItem
)
{
this
.
filterInputActionViewItem
.
focus
();
}
this
.
filterAction
.
focus
();
}
public
getActions
():
IAction
[]
{
if
(
this
.
isSmallLayout
)
{
return
[
this
.
collapseAllAction
];
}
return
[
this
.
filterAction
,
this
.
collapseAllAction
];
}
...
...
@@ -289,6 +298,12 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
return
deepClone
(
this
.
configurationService
.
getValue
(
'
files.exclude
'
,
{
resource
}))
||
{};
}
private
createFilterActionBar
(
parent
:
HTMLElement
):
void
{
this
.
filterActionBar
=
this
.
_register
(
new
ActionBar
(
parent
,
{
actionViewItemProvider
:
action
=>
this
.
getActionViewItem
(
action
)
}));
dom
.
addClass
(
this
.
filterActionBar
.
getContainer
(),
'
markers-panel-filter-container
'
);
dom
.
toggleClass
(
this
.
filterActionBar
.
getContainer
(),
'
hide
'
,
!
this
.
isSmallLayout
);
}
private
createMessageBox
(
parent
:
HTMLElement
):
void
{
this
.
messageBoxContainer
=
dom
.
append
(
parent
,
dom
.
$
(
'
.message-box-container
'
));
this
.
messageBoxContainer
.
setAttribute
(
'
aria-labelledby
'
,
'
markers-panel-arialabel
'
);
...
...
@@ -369,8 +384,8 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
// move focus to input, whenever a key is pressed in the panel container
this
.
_register
(
domEvent
(
parent
,
'
keydown
'
)(
e
=>
{
if
(
this
.
filterInputActionViewItem
&&
this
.
keybindingService
.
mightProducePrintableCharacter
(
new
StandardKeyboardEvent
(
e
)))
{
this
.
filter
InputActionViewItem
.
focus
();
if
(
this
.
keybindingService
.
mightProducePrintableCharacter
(
new
StandardKeyboardEvent
(
e
)))
{
this
.
filter
Action
.
focus
();
}
}));
...
...
@@ -671,8 +686,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
public
getActionViewItem
(
action
:
IAction
):
IActionViewItem
|
undefined
{
if
(
action
.
id
===
MarkersFilterAction
.
ID
)
{
this
.
filterInputActionViewItem
=
this
.
instantiationService
.
createInstance
(
MarkersFilterActionViewItem
,
this
.
filterAction
,
this
);
return
this
.
filterInputActionViewItem
;
return
this
.
instantiationService
.
createInstance
(
MarkersFilterActionViewItem
,
this
.
filterAction
,
this
);
}
return
super
.
getActionViewItem
(
action
);
}
...
...
src/vs/workbench/contrib/markers/browser/markersPanelActions.ts
浏览文件 @
5ed6a46d
...
...
@@ -77,6 +77,9 @@ export class MarkersFilterAction extends Action {
public
static
readonly
ID
:
string
=
'
workbench.actions.problems.filter
'
;
private
readonly
_onFocus
:
Emitter
<
void
>
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onFocus
:
Event
<
void
>
=
this
.
_onFocus
.
event
;
constructor
(
options
:
IMarkersFilterActionOptions
)
{
super
(
MarkersFilterAction
.
ID
,
Messages
.
MARKERS_PANEL_ACTION_TOOLTIP_FILTER
,
'
markers-panel-action-filter
'
,
true
);
this
.
_filterText
=
options
.
filterText
;
...
...
@@ -107,6 +110,18 @@ export class MarkersFilterAction extends Action {
this
.
_onDidChange
.
fire
(
<
IMarkersFilterActionChangeEvent
>
{
useFilesExclude
:
true
});
}
}
focus
():
void
{
this
.
_onFocus
.
fire
();
}
layout
(
width
:
number
):
void
{
if
(
width
<
400
)
{
this
.
class
=
'
markers-panel-action-filter small
'
;
}
else
{
this
.
class
=
'
markers-panel-action-filter
'
;
}
}
}
export
interface
IMarkerFilterController
{
...
...
@@ -118,7 +133,6 @@ export interface IMarkerFilterController {
export
class
MarkersFilterActionViewItem
extends
BaseActionViewItem
{
private
delayedFilterUpdate
:
Delayer
<
void
>
;
private
container
:
HTMLElement
|
null
=
null
;
private
filterInputBox
:
HistoryInputBox
|
null
=
null
;
private
filterBadge
:
HTMLElement
|
null
=
null
;
private
focusContextKey
:
IContextKey
<
boolean
>
;
...
...
@@ -136,15 +150,16 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
this
.
focusContextKey
=
Constants
.
MarkerPanelFilterFocusContextKey
.
bindTo
(
contextKeyService
);
this
.
delayedFilterUpdate
=
new
Delayer
<
void
>
(
200
);
this
.
_register
(
toDisposable
(()
=>
this
.
delayedFilterUpdate
.
cancel
()));
this
.
_register
(
action
.
onFocus
(()
=>
this
.
focus
()));
}
render
(
container
:
HTMLElement
):
void
{
this
.
container
=
container
;
DOM
.
addClass
(
this
.
container
,
'
markers-panel-action-filter-container
'
);
DOM
.
addClass
(
container
,
'
markers-panel-action-filter-container
'
);
const
filterContainer
=
DOM
.
append
(
this
.
container
,
DOM
.
$
(
'
.markers-panel-action-filter
'
));
this
.
createInput
(
filterContainer
);
this
.
createControls
(
filterContainer
);
this
.
element
=
DOM
.
append
(
container
,
DOM
.
$
(
''
));
this
.
element
.
className
=
this
.
action
.
class
||
''
;
this
.
createInput
(
this
.
element
);
this
.
createControls
(
this
.
element
);
this
.
adjustInputBox
();
}
...
...
@@ -155,13 +170,6 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
}
}
toggleLayout
(
small
:
boolean
)
{
if
(
this
.
container
)
{
DOM
.
toggleClass
(
this
.
container
,
'
small
'
,
small
);
this
.
adjustInputBox
();
}
}
private
createInput
(
container
:
HTMLElement
):
void
{
this
.
filterInputBox
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
ContextScopedHistoryInputBox
,
container
,
this
.
contextViewService
,
{
placeholder
:
Messages
.
MARKERS_PANEL_FILTER_PLACEHOLDER
,
...
...
@@ -249,8 +257,8 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
}
private
adjustInputBox
():
void
{
if
(
this
.
container
&&
this
.
filterInputBox
&&
this
.
filterBadge
)
{
this
.
filterInputBox
.
inputElement
.
style
.
paddingRight
=
DOM
.
hasClass
(
this
.
container
,
'
small
'
)
||
DOM
.
hasClass
(
this
.
filterBadge
,
'
hidden
'
)
?
'
25px
'
:
'
150px
'
;
if
(
this
.
element
&&
this
.
filterInputBox
&&
this
.
filterBadge
)
{
this
.
filterInputBox
.
inputElement
.
style
.
paddingRight
=
DOM
.
hasClass
(
this
.
element
,
'
small
'
)
||
DOM
.
hasClass
(
this
.
filterBadge
,
'
hidden
'
)
?
'
25px
'
:
'
150px
'
;
}
}
...
...
@@ -293,6 +301,13 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
*/
this
.
telemetryService
.
publicLog
(
'
problems.filter
'
,
data
);
}
protected
updateClass
():
void
{
if
(
this
.
element
)
{
this
.
element
.
className
=
this
.
action
.
class
||
''
;
this
.
adjustInputBox
();
}
}
}
export
class
QuickFixAction
extends
Action
{
...
...
src/vs/workbench/contrib/markers/browser/media/markers.css
浏览文件 @
5ed6a46d
...
...
@@ -4,21 +4,11 @@
*--------------------------------------------------------------------------------------------*/
.monaco-action-bar
.action-item.markers-panel-action-filter-container
{
flex
:
1
;
cursor
:
default
;
margin-right
:
10px
;
min-width
:
150px
;
max-width
:
500px
;
display
:
flex
;
}
.monaco-action-bar
.markers-panel-action-filter-container
{
flex
:
0.7
;
}
.monaco-action-bar
.markers-panel-action-filter-container.small
{
flex
:
0.5
;
}
.monaco-action-bar
.markers-panel-action-filter
{
display
:
flex
;
align-items
:
center
;
...
...
@@ -52,14 +42,28 @@
}
.markers-panel-action-filter
>
.markers-panel-filter-controls
>
.markers-panel-filter-badge.hidden
,
.markers-panel-action-filter
-container.small
.markers-panel-action-filter
>
.markers-panel-filter-controls
>
.markers-panel-filter-badge
{
.markers-panel-action-filter
.small
>
.markers-panel-filter-controls
>
.markers-panel-filter-badge
{
display
:
none
;
}
.panel
>
.title
.monaco-action-bar
.action-item.markers-panel-action-filter-container
{
max-width
:
600px
;
min-width
:
300px
;
margin-right
:
10px
;
}
.markers-panel
.markers-panel-container
{
height
:
100%
;
}
.markers-panel
.hide
{
display
:
none
;
}
.markers-panel-container
.monaco-action-bar.markers-panel-filter-container
{
margin
:
10px
20px
;
}
.markers-panel
.markers-panel-container
.message-box-container
{
line-height
:
22px
;
padding-left
:
20px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录