Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
1b032162
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,发现更多精彩内容 >>
提交
1b032162
编写于
3月 27, 2018
作者:
S
Sandeep Somavarapu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix #46707
上级
0bd949c0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
13 deletion
+41
-13
src/vs/workbench/parts/markers/electron-browser/constants.ts
src/vs/workbench/parts/markers/electron-browser/constants.ts
+3
-1
src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts
...ch/parts/markers/electron-browser/markers.contribution.ts
+24
-2
src/vs/workbench/parts/markers/electron-browser/markersModel.ts
.../workbench/parts/markers/electron-browser/markersModel.ts
+5
-8
src/vs/workbench/parts/markers/electron-browser/markersPanel.ts
.../workbench/parts/markers/electron-browser/markersPanel.ts
+9
-2
未找到文件。
src/vs/workbench/parts/markers/electron-browser/constants.ts
浏览文件 @
1b032162
...
...
@@ -9,8 +9,10 @@ export default {
MARKERS_PANEL_ID
:
'
workbench.panel.markers
'
,
MARKER_COPY_ACTION_ID
:
'
problems.action.copy
'
,
MARKER_COPY_MESSAGE_ACTION_ID
:
'
problems.action.copyMessage
'
,
RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID
:
'
problems.action.copyRelatedInformationMessage
'
,
MARKER_OPEN_SIDE_ACTION_ID
:
'
problems.action.openToSide
'
,
MARKER_SHOW_PANEL_ID
:
'
workbench.action.showErrorsWarnings
'
,
MarkerFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemFocus
'
,
true
)
MarkerFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
problemFocus
'
,
true
),
RelatedInformationFocusContextKey
:
new
RawContextKey
<
boolean
>
(
'
relatedInformationFocus
'
,
true
)
};
src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts
浏览文件 @
1b032162
...
...
@@ -13,7 +13,7 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
import
{
KeybindingsRegistry
,
IKeybindings
}
from
'
vs/platform/keybinding/common/keybindingsRegistry
'
;
import
{
KeyCode
,
KeyMod
}
from
'
vs/base/common/keyCodes
'
;
import
{
localize
}
from
'
vs/nls
'
;
import
{
Marker
}
from
'
vs/workbench/parts/markers/electron-browser/markersModel
'
;
import
{
Marker
,
RelatedInformation
}
from
'
vs/workbench/parts/markers/electron-browser/markersModel
'
;
import
{
MarkersPanel
}
from
'
vs/workbench/parts/markers/electron-browser/markersPanel
'
;
import
{
MenuId
,
MenuRegistry
,
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
PanelRegistry
,
Extensions
as
PanelExtensions
,
PanelDescriptor
}
from
'
vs/workbench/browser/panel
'
;
...
...
@@ -101,7 +101,7 @@ registerAction({
});
registerAction
({
id
:
Constants
.
MARKER_COPY_MESSAGE_ACTION_ID
,
title
:
localize
(
'
copyM
arkerM
essage
'
,
"
Copy Message
"
),
title
:
localize
(
'
copyMessage
'
,
"
Copy Message
"
),
handler
(
accessor
)
{
copyMessage
(
accessor
.
get
(
IPanelService
));
},
...
...
@@ -111,6 +111,18 @@ registerAction({
group
:
'
navigation
'
}
});
registerAction
({
id
:
Constants
.
RELATED_INFORMATION_COPY_MESSAGE_ACTION_ID
,
title
:
localize
(
'
copyMessage
'
,
"
Copy Message
"
),
handler
(
accessor
)
{
copyRelatedInformationMessage
(
accessor
.
get
(
IPanelService
));
},
menu
:
{
menuId
:
MenuId
.
ProblemsPanelContext
,
when
:
Constants
.
RelatedInformationFocusContextKey
,
group
:
'
navigation
'
}
});
function
copyMarker
(
panelService
:
IPanelService
)
{
...
...
@@ -133,6 +145,16 @@ function copyMessage(panelService: IPanelService) {
}
}
function
copyRelatedInformationMessage
(
panelService
:
IPanelService
)
{
const
activePanel
=
panelService
.
getActivePanel
();
if
(
activePanel
instanceof
MarkersPanel
)
{
const
element
=
(
<
MarkersPanel
>
activePanel
).
getFocusElement
();
if
(
element
instanceof
RelatedInformation
)
{
clipboard
.
writeText
(
element
.
raw
.
message
);
}
}
}
interface
IActionDescriptor
{
id
:
string
;
handler
:
ICommandHandler
;
...
...
src/vs/workbench/parts/markers/electron-browser/markersModel.ts
浏览文件 @
1b032162
...
...
@@ -96,14 +96,11 @@ export class Marker extends NodeWithId {
}
public
toString
():
string
{
return
[
`file: '
${
this
.
raw
.
resource
}
'`
,
`severity: '
${
MarkerSeverity
.
toString
(
this
.
raw
.
severity
)}
'`
,
`message: '
${
this
.
raw
.
message
}
'`
,
`at: '
${
this
.
raw
.
startLineNumber
}
,
${
this
.
raw
.
startColumn
}
'`
,
`source: '
${
this
.
raw
.
source
?
this
.
raw
.
source
:
''
}
'`
,
`code: '
${
this
.
raw
.
code
?
this
.
raw
.
code
:
''
}
'`
].
join
(
'
\n
'
);
return
JSON
.
stringify
({
...
this
.
raw
,
resource
:
this
.
raw
.
resource
.
path
,
relatedInformation
:
this
.
resourceRelatedInformation
.
length
?
this
.
resourceRelatedInformation
.
map
(
r
=>
({
...
r
.
raw
,
resource
:
r
.
raw
.
resource
.
path
}))
:
void
0
},
null
,
'
\t
'
);
}
static
compare
(
a
:
Marker
,
b
:
Marker
):
number
{
...
...
src/vs/workbench/parts/markers/electron-browser/markersPanel.ts
浏览文件 @
1b032162
...
...
@@ -205,9 +205,16 @@ export class MarkersPanel extends Panel {
});
const
markerFocusContextKey
=
Constants
.
MarkerFocusContextKey
.
bindTo
(
this
.
tree
.
contextKeyService
);
this
.
_register
(
this
.
tree
.
onDidChangeFocus
((
e
:
{
focus
:
any
})
=>
markerFocusContextKey
.
set
(
e
.
focus
instanceof
Marker
)));
const
relatedInformationFocusContextKey
=
Constants
.
RelatedInformationFocusContextKey
.
bindTo
(
this
.
tree
.
contextKeyService
);
this
.
_register
(
this
.
tree
.
onDidChangeFocus
((
e
:
{
focus
:
any
})
=>
{
markerFocusContextKey
.
set
(
e
.
focus
instanceof
Marker
);
relatedInformationFocusContextKey
.
set
(
e
.
focus
instanceof
RelatedInformation
);
}));
const
focusTracker
=
this
.
_register
(
dom
.
trackFocus
(
this
.
tree
.
getHTMLElement
()));
this
.
_register
(
focusTracker
.
onDidBlur
(()
=>
markerFocusContextKey
.
set
(
false
)));
this
.
_register
(
focusTracker
.
onDidBlur
(()
=>
{
markerFocusContextKey
.
set
(
false
);
relatedInformationFocusContextKey
.
set
(
false
);
}));
const
markersNavigator
=
this
.
_register
(
new
TreeResourceNavigator
(
this
.
tree
,
{
openOnFocus
:
true
}));
this
.
_register
(
debounceEvent
(
markersNavigator
.
openResource
,
(
last
,
event
)
=>
event
,
75
,
true
)(
options
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录