Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e878c3e9
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,发现更多精彩内容 >>
提交
e878c3e9
编写于
9月 05, 2019
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
strict property init - markers
上级
709d1ed9
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
54 addition
and
1108 deletion
+54
-1108
src/vs/workbench/contrib/markers/browser/markersPanel.ts
src/vs/workbench/contrib/markers/browser/markersPanel.ts
+28
-35
src/vs/workbench/contrib/markers/browser/markersPanelActions.ts
.../workbench/contrib/markers/browser/markersPanelActions.ts
+24
-21
src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts
...vs/workbench/contrib/markers/browser/markersTreeViewer.ts
+2
-2
src/vs/workbench/contrib/markers/browser/markersWidget.ts
src/vs/workbench/contrib/markers/browser/markersWidget.ts
+0
-1050
未找到文件。
src/vs/workbench/contrib/markers/browser/markersPanel.ts
浏览文件 @
e878c3e9
...
...
@@ -69,23 +69,21 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
private
lastSelectedRelativeTop
:
number
=
0
;
private
currentActiveResource
:
URI
|
null
=
null
;
private
tree
:
WorkbenchObjectTree
<
TreeElement
,
FilterData
>
;
private
treeLabels
:
ResourceLabels
;
private
rangeHighlightDecorations
:
RangeHighlightDecorations
;
private
actions
:
IAction
[]
;
private
collapseAllAction
:
IAction
;
private
filterAction
:
MarkersFilterAction
;
private
filterInputActionViewItem
:
MarkersFilterActionViewItem
;
private
treeContainer
:
HTMLElement
;
private
messageBoxContainer
:
HTMLElement
;
private
ariaLabelElement
:
HTMLElement
;
private
readonly
rangeHighlightDecorations
:
RangeHighlightDecorations
;
private
readonly
filter
:
Filter
;
private
tree
!
:
WorkbenchObjectTree
<
TreeElement
,
FilterData
>
;
private
treeContainer
!
:
HTMLElement
;
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
>
;
private
filter
:
Filter
;
private
_onDidFilter
=
this
.
_register
(
new
Emitter
<
void
>
());
readonly
onDidFilter
:
Event
<
void
>
=
this
.
_onDidFilter
.
event
;
private
cachedFilterStats
:
{
total
:
number
;
filtered
:
number
;
}
|
undefined
=
undefined
;
...
...
@@ -114,12 +112,18 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
this
.
markersViewModel
=
instantiationService
.
createInstance
(
MarkersViewModel
,
this
.
panelState
[
'
multiline
'
]);
this
.
markersViewModel
.
onDidChange
(
this
.
onDidChangeViewState
,
this
,
this
.
disposables
);
this
.
setCurrentActiveEditor
();
this
.
filter
=
new
Filter
(
new
FilterOptions
());
this
.
rangeHighlightDecorations
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
RangeHighlightDecorations
));
// actions
this
.
collapseAllAction
=
new
Action
(
'
vs.tree.collapse
'
,
localize
(
'
collapseAll
'
,
"
Collapse All
"
),
'
monaco-tree-action collapse-all
'
,
true
,
async
()
=>
this
.
collapseAll
());
this
.
filterAction
=
this
.
instantiationService
.
createInstance
(
MarkersFilterAction
,
{
filterText
:
this
.
panelState
[
'
filter
'
]
||
''
,
filterHistory
:
this
.
panelState
[
'
filterHistory
'
]
||
[],
useFilesExclude
:
!!
this
.
panelState
[
'
useFilesExclude
'
]
});
}
public
create
(
parent
:
HTMLElement
):
void
{
super
.
create
(
parent
);
this
.
rangeHighlightDecorations
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
RangeHighlightDecorations
));
dom
.
addClass
(
parent
,
'
markers-panel
'
);
...
...
@@ -128,7 +132,6 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
this
.
createArialLabelElement
(
container
);
this
.
createMessageBox
(
container
);
this
.
createTree
(
container
);
this
.
createActions
();
this
.
createListeners
();
this
.
updateFilter
();
...
...
@@ -178,10 +181,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}
public
getActions
():
IAction
[]
{
if
(
!
this
.
actions
)
{
this
.
createActions
();
}
return
this
.
actions
;
return
[
this
.
filterAction
,
this
.
collapseAllAction
];
}
public
showQuickFixes
(
marker
:
Marker
):
void
{
...
...
@@ -306,15 +306,14 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
const
onDidChangeRenderNodeCount
=
new
Relay
<
ITreeNode
<
any
,
any
>>
();
this
.
treeLabels
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
ResourceLabels
,
this
));
const
treeLabels
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
ResourceLabels
,
this
));
const
virtualDelegate
=
new
VirtualDelegate
(
this
.
markersViewModel
);
const
renderers
=
[
this
.
instantiationService
.
createInstance
(
ResourceMarkersRenderer
,
t
his
.
t
reeLabels
,
onDidChangeRenderNodeCount
.
event
),
this
.
instantiationService
.
createInstance
(
ResourceMarkersRenderer
,
treeLabels
,
onDidChangeRenderNodeCount
.
event
),
this
.
instantiationService
.
createInstance
(
MarkerRenderer
,
this
.
markersViewModel
),
this
.
instantiationService
.
createInstance
(
RelatedInformationRenderer
)
];
this
.
filter
=
new
Filter
(
new
FilterOptions
());
const
accessibilityProvider
=
this
.
instantiationService
.
createInstance
(
MarkersTreeAccessibilityProvider
);
const
identityProvider
=
{
...
...
@@ -396,17 +395,12 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
}));
}
private
createActions
():
void
{
this
.
collapseAllAction
=
new
Action
(
'
vs.tree.collapse
'
,
localize
(
'
collapseAll
'
,
"
Collapse All
"
),
'
monaco-tree-action collapse-all
'
,
true
,
async
()
=>
{
this
.
tree
.
collapseAll
();
this
.
tree
.
setSelection
([]);
this
.
tree
.
setFocus
([]);
this
.
tree
.
getHTMLElement
().
focus
();
this
.
tree
.
focusFirst
();
});
this
.
filterAction
=
this
.
instantiationService
.
createInstance
(
MarkersFilterAction
,
{
filterText
:
this
.
panelState
[
'
filter
'
]
||
''
,
filterHistory
:
this
.
panelState
[
'
filterHistory
'
]
||
[],
useFilesExclude
:
!!
this
.
panelState
[
'
useFilesExclude
'
]
});
this
.
actions
=
[
this
.
filterAction
,
this
.
collapseAllAction
];
private
collapseAll
():
void
{
this
.
tree
.
collapseAll
();
this
.
tree
.
setSelection
([]);
this
.
tree
.
setFocus
([]);
this
.
tree
.
getHTMLElement
().
focus
();
this
.
tree
.
focusFirst
();
}
private
createListeners
():
void
{
...
...
@@ -423,7 +417,6 @@ export class MarkersPanel extends Panel implements IMarkerFilterController {
this
.
updateFilter
();
}
}));
this
.
actions
.
forEach
(
a
=>
this
.
_register
(
a
));
}
private
onDidChangeModel
(
change
:
MarkerChangesEvent
)
{
...
...
src/vs/workbench/contrib/markers/browser/markersPanelActions.ts
浏览文件 @
e878c3e9
...
...
@@ -118,10 +118,9 @@ export interface IMarkerFilterController {
export
class
MarkersFilterActionViewItem
extends
BaseActionViewItem
{
private
delayedFilterUpdate
:
Delayer
<
void
>
;
private
container
:
HTMLElement
;
private
filterInputBox
:
HistoryInputBox
;
private
controlsContainer
:
HTMLInputElement
;
private
filterBadge
:
HTMLInputElement
;
private
container
:
HTMLElement
|
null
=
null
;
private
filterInputBox
:
HistoryInputBox
|
null
=
null
;
private
filterBadge
:
HTMLElement
|
null
=
null
;
private
focusContextKey
:
IContextKey
<
boolean
>
;
constructor
(
...
...
@@ -172,13 +171,13 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
this
.
filterInputBox
.
inputElement
.
setAttribute
(
'
aria-labelledby
'
,
'
markers-panel-arialabel
'
);
this
.
_register
(
attachInputBoxStyler
(
this
.
filterInputBox
,
this
.
themeService
));
this
.
filterInputBox
.
value
=
this
.
action
.
filterText
;
this
.
_register
(
this
.
filterInputBox
.
onDidChange
(
filter
=>
this
.
delayedFilterUpdate
.
trigger
(()
=>
this
.
onDidInputChange
(
this
.
filterInputBox
))));
this
.
_register
(
this
.
filterInputBox
.
onDidChange
(
filter
=>
this
.
delayedFilterUpdate
.
trigger
(()
=>
this
.
onDidInputChange
(
this
.
filterInputBox
!
))));
this
.
_register
(
this
.
action
.
onDidChange
((
event
:
IMarkersFilterActionChangeEvent
)
=>
{
if
(
event
.
filterText
)
{
this
.
filterInputBox
.
value
=
this
.
action
.
filterText
;
this
.
filterInputBox
!
.
value
=
this
.
action
.
filterText
;
}
}));
this
.
_register
(
DOM
.
addStandardDisposableListener
(
this
.
filterInputBox
.
inputElement
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
any
)
=>
this
.
onInputKeyDown
(
e
,
this
.
filterInputBox
)));
this
.
_register
(
DOM
.
addStandardDisposableListener
(
this
.
filterInputBox
.
inputElement
,
DOM
.
EventType
.
KEY_DOWN
,
(
e
:
any
)
=>
this
.
onInputKeyDown
(
e
,
this
.
filterInputBox
!
)));
this
.
_register
(
DOM
.
addStandardDisposableListener
(
container
,
DOM
.
EventType
.
KEY_DOWN
,
this
.
handleKeyboardEvent
));
this
.
_register
(
DOM
.
addStandardDisposableListener
(
container
,
DOM
.
EventType
.
KEY_UP
,
this
.
handleKeyboardEvent
));
...
...
@@ -189,24 +188,24 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
}
private
createControls
(
container
:
HTMLElement
):
void
{
this
.
controlsContainer
=
DOM
.
append
(
container
,
DOM
.
$
(
'
.markers-panel-filter-controls
'
));
this
.
createBadge
(
this
.
controlsContainer
);
this
.
createFilesExcludeCheckbox
(
this
.
controlsContainer
);
const
controlsContainer
=
DOM
.
append
(
container
,
DOM
.
$
(
'
.markers-panel-filter-controls
'
));
this
.
createBadge
(
controlsContainer
);
this
.
createFilesExcludeCheckbox
(
controlsContainer
);
}
private
createBadge
(
container
:
HTMLElement
):
void
{
this
.
filterBadge
=
DOM
.
append
(
container
,
DOM
.
$
(
'
.markers-panel-filter-badge
'
));
const
filterBadge
=
this
.
filterBadge
=
DOM
.
append
(
container
,
DOM
.
$
(
'
.markers-panel-filter-badge
'
));
this
.
_register
(
attachStylerCallback
(
this
.
themeService
,
{
badgeBackground
,
badgeForeground
,
contrastBorder
},
colors
=>
{
const
background
=
colors
.
badgeBackground
?
colors
.
badgeBackground
.
toString
()
:
null
;
const
foreground
=
colors
.
badgeForeground
?
colors
.
badgeForeground
.
toString
()
:
null
;
const
border
=
colors
.
contrastBorder
?
colors
.
contrastBorder
.
toString
()
:
null
;
this
.
filterBadge
.
style
.
backgroundColor
=
background
;
filterBadge
.
style
.
backgroundColor
=
background
;
this
.
filterBadge
.
style
.
borderWidth
=
border
?
'
1px
'
:
null
;
this
.
filterBadge
.
style
.
borderStyle
=
border
?
'
solid
'
:
null
;
this
.
filterBadge
.
style
.
borderColor
=
border
;
this
.
filterBadge
.
style
.
color
=
foreground
;
filterBadge
.
style
.
borderWidth
=
border
?
'
1px
'
:
null
;
filterBadge
.
style
.
borderStyle
=
border
?
'
solid
'
:
null
;
filterBadge
.
style
.
borderColor
=
border
;
filterBadge
.
style
.
color
=
foreground
;
}));
this
.
updateBadge
();
this
.
_register
(
this
.
filterController
.
onDidFilter
(()
=>
this
.
updateBadge
()));
...
...
@@ -241,14 +240,18 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
}
private
updateBadge
():
void
{
const
{
total
,
filtered
}
=
this
.
filterController
.
getFilterStats
();
DOM
.
toggleClass
(
this
.
filterBadge
,
'
hidden
'
,
total
===
filtered
||
filtered
===
0
);
this
.
filterBadge
.
textContent
=
localize
(
'
showing filtered problems
'
,
"
Showing {0} of {1}
"
,
filtered
,
total
);
this
.
adjustInputBox
();
if
(
this
.
filterBadge
)
{
const
{
total
,
filtered
}
=
this
.
filterController
.
getFilterStats
();
DOM
.
toggleClass
(
this
.
filterBadge
,
'
hidden
'
,
total
===
filtered
||
filtered
===
0
);
this
.
filterBadge
.
textContent
=
localize
(
'
showing filtered problems
'
,
"
Showing {0} of {1}
"
,
filtered
,
total
);
this
.
adjustInputBox
();
}
}
private
adjustInputBox
():
void
{
this
.
filterInputBox
.
inputElement
.
style
.
paddingRight
=
DOM
.
hasClass
(
this
.
container
,
'
small
'
)
||
DOM
.
hasClass
(
this
.
filterBadge
,
'
hidden
'
)
?
'
25px
'
:
'
150px
'
;
if
(
this
.
container
&&
this
.
filterInputBox
&&
this
.
filterBadge
)
{
this
.
filterInputBox
.
inputElement
.
style
.
paddingRight
=
DOM
.
hasClass
(
this
.
container
,
'
small
'
)
||
DOM
.
hasClass
(
this
.
filterBadge
,
'
hidden
'
)
?
'
25px
'
:
'
150px
'
;
}
}
// Action toolbar is swallowing some keys for action items which should not be for an input box
...
...
src/vs/workbench/contrib/markers/browser/markersTreeViewer.ts
浏览文件 @
e878c3e9
...
...
@@ -510,7 +510,7 @@ export class MarkerViewModel extends Disposable {
}
}
private
_quickFixAction
:
QuickFixAction
;
private
_quickFixAction
:
QuickFixAction
|
null
=
null
;
get
quickFixAction
():
QuickFixAction
{
if
(
!
this
.
_quickFixAction
)
{
this
.
_quickFixAction
=
this
.
_register
(
this
.
instantiationService
.
createInstance
(
QuickFixAction
,
this
.
marker
));
...
...
@@ -616,7 +616,7 @@ export class MarkersViewModel extends Disposable {
private
bulkUpdate
:
boolean
=
false
;
private
hoveredMarker
:
Marker
|
null
;
private
hoveredMarker
:
Marker
|
null
=
null
;
private
hoverDelayer
:
Delayer
<
void
>
=
new
Delayer
<
void
>
(
300
);
constructor
(
...
...
src/vs/workbench/contrib/markers/browser/markersWidget.ts
已删除
100644 → 0
浏览文件 @
709d1ed9
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录