Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
b46e1e6a
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,发现更多精彩内容 >>
提交
b46e1e6a
编写于
3月 26, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
always hide F8 when going to a related marker, #10271
上级
437f5cf9
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
21 addition
and
13 deletion
+21
-13
src/vs/editor/contrib/gotoError/gotoError.ts
src/vs/editor/contrib/gotoError/gotoError.ts
+13
-3
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
+8
-10
未找到文件。
src/vs/editor/contrib/gotoError/gotoError.ts
浏览文件 @
b46e1e6a
...
...
@@ -26,6 +26,7 @@ import { compare } from 'vs/base/common/strings';
import
{
binarySearch
}
from
'
vs/base/common/arrays
'
;
import
{
IEditorService
}
from
'
vs/platform/editor/common/editor
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
class
MarkerModel
{
...
...
@@ -233,11 +234,18 @@ class MarkerController implements editorCommon.IEditorContribution {
this
.
_model
=
new
MarkerModel
(
this
.
_editor
,
markers
);
this
.
_markerService
.
onMarkerChanged
(
this
.
_onMarkerChanged
,
this
,
this
.
_disposeOnClose
);
this
.
_widget
=
new
MarkerNavigationWidget
(
this
.
_editor
,
this
.
_themeService
,
this
.
_editorService
);
this
.
_widget
=
new
MarkerNavigationWidget
(
this
.
_editor
,
this
.
_themeService
);
this
.
_widgetVisible
.
set
(
true
);
this
.
_disposeOnClose
.
push
(
this
.
_model
);
this
.
_disposeOnClose
.
push
(
this
.
_widget
);
this
.
_disposeOnClose
.
push
(
this
.
_widget
.
onDidSelectRelatedInformation
(
related
=>
{
this
.
_editorService
.
openEditor
({
resource
:
related
.
resource
,
options
:
{
pinned
:
true
,
revealIfOpened
:
true
,
selection
:
Range
.
lift
(
related
).
collapseToStart
()
}
}).
then
(
undefined
,
onUnexpectedError
);
this
.
closeMarkersNavigation
(
false
);
}));
this
.
_disposeOnClose
.
push
(
this
.
_editor
.
onDidChangeModel
(()
=>
this
.
_cleanUp
()));
this
.
_disposeOnClose
.
push
(
this
.
_model
.
onCurrentMarkerChanged
(
marker
=>
{
...
...
@@ -261,9 +269,11 @@ class MarkerController implements editorCommon.IEditorContribution {
return
this
.
_model
;
}
public
closeMarkersNavigation
():
void
{
public
closeMarkersNavigation
(
focusEditor
:
boolean
=
true
):
void
{
this
.
_cleanUp
();
this
.
_editor
.
focus
();
if
(
focusEditor
)
{
this
.
_editor
.
focus
();
}
}
private
_onMarkerChanged
(
changedResources
:
URI
[]):
void
{
...
...
src/vs/editor/contrib/gotoError/gotoErrorWidget.ts
浏览文件 @
b46e1e6a
...
...
@@ -23,9 +23,8 @@ import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElemen
import
{
ScrollbarVisibility
}
from
'
vs/base/common/scrollable
'
;
import
{
ScrollType
}
from
'
vs/editor/common/editorCommon
'
;
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
IEditorService
}
from
'
vs/platform/editor/common/editor
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
isFalsyOrEmpty
}
from
'
vs/base/common/arrays
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
class
MessageWidget
{
...
...
@@ -39,7 +38,7 @@ class MessageWidget {
private
readonly
_relatedDiagnostics
=
new
WeakMap
<
HTMLElement
,
IRelatedInformation
>
();
private
readonly
_disposables
:
IDisposable
[]
=
[];
constructor
(
parent
:
HTMLElement
,
editor
:
ICodeEditor
,
editorService
:
IEditorService
)
{
constructor
(
parent
:
HTMLElement
,
editor
:
ICodeEditor
,
onRelatedInformation
:
(
related
:
IRelatedInformation
)
=>
void
,
)
{
this
.
_editor
=
editor
;
const
domNode
=
document
.
createElement
(
'
div
'
);
...
...
@@ -56,10 +55,7 @@ class MessageWidget {
event
.
preventDefault
();
const
related
=
this
.
_relatedDiagnostics
.
get
(
event
.
target
);
if
(
related
)
{
editorService
.
openEditor
({
resource
:
related
.
resource
,
options
:
{
pinned
:
true
,
revealIfOpened
:
true
,
selection
:
Range
.
lift
(
related
).
collapseToStart
()
}
}).
then
(
undefined
,
onUnexpectedError
);
onRelatedInformation
(
related
);
}
}));
...
...
@@ -148,11 +144,13 @@ export class MarkerNavigationWidget extends ZoneWidget {
private
_callOnDispose
:
IDisposable
[]
=
[];
private
_severity
:
MarkerSeverity
;
private
_backgroundColor
:
Color
;
private
_onDidSelectRelatedInformation
=
new
Emitter
<
IRelatedInformation
>
();
readonly
onDidSelectRelatedInformation
:
Event
<
IRelatedInformation
>
=
this
.
_onDidSelectRelatedInformation
.
event
;
constructor
(
editor
:
ICodeEditor
,
private
_themeService
:
IThemeService
,
private
_editorService
:
IEditorService
private
_themeService
:
IThemeService
)
{
super
(
editor
,
{
showArrow
:
true
,
showFrame
:
true
,
isAccessible
:
true
});
this
.
_severity
=
MarkerSeverity
.
Warning
;
...
...
@@ -208,7 +206,7 @@ export class MarkerNavigationWidget extends ZoneWidget {
this
.
_title
.
className
=
'
block title
'
;
this
.
_container
.
appendChild
(
this
.
_title
);
this
.
_message
=
new
MessageWidget
(
this
.
_container
,
this
.
editor
,
this
.
_editorService
);
this
.
_message
=
new
MessageWidget
(
this
.
_container
,
this
.
editor
,
related
=>
this
.
_onDidSelectRelatedInformation
.
fire
(
related
)
);
this
.
_disposables
.
push
(
this
.
_message
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录