Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
旅途_2012
vscode
提交
5c9d1c4c
V
vscode
项目概览
旅途_2012
/
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,发现更多精彩内容 >>
提交
5c9d1c4c
编写于
8月 31, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - less builder is better
上级
523f7893
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
53 deletion
+55
-53
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
+28
-26
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
+27
-27
未找到文件。
src/vs/editor/contrib/referenceSearch/peekViewWidget.ts
浏览文件 @
5c9d1c4c
...
...
@@ -5,22 +5,22 @@
'
use strict
'
;
import
'
vs/css!./media/peekViewWidget
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
{
$
}
from
'
vs/base/browser/builder
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
ActionBar
,
IActionBarOptions
}
from
'
vs/base/browser/ui/actionbar/actionbar
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ICodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
Action
}
from
'
vs/base/common/actions
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
*
as
objects
from
'
vs/base/common/objects
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
'
vs/css!./media/peekViewWidget
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
I
Options
,
ZoneWidget
,
IStyles
}
from
'
vs/editor/contrib/zoneWidget/zoneWidget
'
;
import
{
I
CodeEditorService
}
from
'
vs/editor/browser/services/codeEditorService
'
;
import
{
EmbeddedCodeEditorWidget
}
from
'
vs/editor/browser/widget/embeddedCodeEditorWidget
'
;
import
{
IOptions
,
IStyles
,
ZoneWidget
}
from
'
vs/editor/contrib/zoneWidget/zoneWidget
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
ContextKeyExpr
,
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
ServicesAccessor
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
namespace
PeekContext
{
export
const
inPeekEditor
=
new
RawContextKey
<
boolean
>
(
'
inReferenceSearchEditor
'
,
true
);
...
...
@@ -111,8 +111,8 @@ export abstract class PeekViewWidget extends ZoneWidget {
protected
_fillContainer
(
container
:
HTMLElement
):
void
{
this
.
setCssClass
(
'
peekview-widget
'
);
this
.
_headElement
=
<
HTMLDivElement
>
$
(
'
.head
'
).
getHTMLElement
(
);
this
.
_bodyElement
=
<
HTMLDivElement
>
$
(
'
.body
'
).
getHTMLElement
(
);
this
.
_headElement
=
dom
.
$
(
'
.head
'
);
this
.
_bodyElement
=
dom
.
$
(
'
.body
'
);
this
.
_fillHead
(
this
.
_headElement
);
this
.
_fillBody
(
this
.
_bodyElement
);
...
...
@@ -122,18 +122,20 @@ export abstract class PeekViewWidget extends ZoneWidget {
}
protected
_fillHead
(
container
:
HTMLElement
):
void
{
const
titleElement
=
$
(
'
.peekview-title
'
).
on
(
dom
.
EventType
.
CLICK
,
e
=>
this
.
_onTitleClick
(
<
MouseEvent
>
e
)).
appendTo
(
this
.
_headElement
).
getHTMLElement
();
const
titleElement
=
dom
.
$
(
'
.peekview-title
'
);
dom
.
append
(
this
.
_headElement
,
titleElement
);
dom
.
addStandardDisposableListener
(
titleElement
,
'
click
'
,
event
=>
this
.
_onTitleClick
(
event
));
this
.
_primaryHeading
=
dom
.
$
(
'
span.filename
'
);
this
.
_secondaryHeading
=
dom
.
$
(
'
span.dirname
'
);
this
.
_metaHeading
=
dom
.
$
(
'
span.meta
'
);
dom
.
append
(
titleElement
,
this
.
_primaryHeading
,
this
.
_secondaryHeading
,
this
.
_metaHeading
);
this
.
_primaryHeading
=
$
(
'
span.filename
'
).
appendTo
(
titleElement
).
getHTMLElement
();
this
.
_secondaryHeading
=
$
(
'
span.dirname
'
).
appendTo
(
titleElement
).
getHTMLElement
();
this
.
_metaHeading
=
$
(
'
span.meta
'
).
appendTo
(
titleElement
).
getHTMLElement
();
const
actionsContainer
=
dom
.
$
(
'
.peekview-actions
'
);
dom
.
append
(
this
.
_headElement
,
actionsContainer
);
const
actionsContainer
=
$
(
'
.peekview-actions
'
).
appendTo
(
this
.
_headElement
);
const
actionBarOptions
=
this
.
_getActionBarOptions
();
this
.
_actionbarWidget
=
new
ActionBar
(
actionsContainer
.
getHTMLElement
()
,
actionBarOptions
);
this
.
_actionbarWidget
=
new
ActionBar
(
actionsContainer
,
actionBarOptions
);
this
.
_disposables
.
push
(
this
.
_actionbarWidget
);
this
.
_actionbarWidget
.
push
(
new
Action
(
'
peekview.close
'
,
nls
.
localize
(
'
label.close
'
,
"
Close
"
),
'
close-peekview-action
'
,
true
,
()
=>
{
...
...
@@ -146,15 +148,15 @@ export abstract class PeekViewWidget extends ZoneWidget {
return
{};
}
protected
_onTitleClick
(
event
:
MouseEvent
):
void
{
protected
_onTitleClick
(
event
:
I
MouseEvent
):
void
{
// implement me
}
public
setTitle
(
primaryHeading
:
string
,
secondaryHeading
?:
string
):
void
{
$
(
this
.
_primaryHeading
).
safeInnerHtml
(
primaryHeading
);
this
.
_primaryHeading
.
innerHTML
=
strings
.
escape
(
primaryHeading
);
this
.
_primaryHeading
.
setAttribute
(
'
aria-label
'
,
primaryHeading
);
if
(
secondaryHeading
)
{
$
(
this
.
_secondaryHeading
).
safeInnerHtml
(
secondaryHeading
);
this
.
_secondaryHeading
.
innerHTML
=
strings
.
escape
(
secondaryHeading
);
}
else
{
dom
.
clearNode
(
this
.
_secondaryHeading
);
}
...
...
@@ -162,7 +164,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
public
setMetaTitle
(
value
:
string
):
void
{
if
(
value
)
{
$
(
this
.
_metaHeading
).
safeInnerHtml
(
value
);
this
.
_metaHeading
.
innerHTML
=
strings
.
escape
(
value
);
}
else
{
dom
.
clearNode
(
this
.
_metaHeading
);
}
...
...
src/vs/editor/contrib/referenceSearch/referencesWidget.ts
浏览文件 @
5c9d1c4c
...
...
@@ -4,45 +4,45 @@
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
'
vs/css!./media/referencesWidget
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
{
IDisposable
,
dispose
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
$
,
Builder
}
from
'
vs/base/browser/builder
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
Sash
,
ISashEvent
,
IVerticalSashLayoutProvider
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
IKeyboardEvent
}
from
'
vs/base/browser/keyboardEvent
'
;
import
{
IMouseEvent
}
from
'
vs/base/browser/mouseEvent
'
;
import
{
GestureEvent
}
from
'
vs/base/browser/touch
'
;
import
{
CountBadge
}
from
'
vs/base/browser/ui/countBadge/countBadge
'
;
import
{
IconLabel
}
from
'
vs/base/browser/ui/iconLabel/iconLabel
'
;
import
{
ISashEvent
,
IVerticalSashLayoutProvider
,
Sash
}
from
'
vs/base/browser/ui/sash/sash
'
;
import
{
Color
}
from
'
vs/base/common/color
'
;
import
{
onUnexpectedError
}
from
'
vs/base/common/errors
'
;
import
{
Emitter
,
Event
}
from
'
vs/base/common/event
'
;
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
dispose
,
IDisposable
,
IReference
}
from
'
vs/base/common/lifecycle
'
;
import
{
Schemas
}
from
'
vs/base/common/network
'
;
import
{
basenameOrAuthority
,
dirname
}
from
'
vs/base/common/resources
'
;
import
*
as
strings
from
'
vs/base/common/strings
'
;
import
{
TPromise
}
from
'
vs/base/common/winjs.base
'
;
import
*
as
tree
from
'
vs/base/parts/tree/browser/tree
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
Range
,
IRange
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
TextModel
,
ModelDecorationOptions
}
from
'
vs/editor/common/model/textModel
'
;
import
{
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
'
vs/css!./media/referencesWidget
'
;
import
{
ICodeEditor
}
from
'
vs/editor/browser/editorBrowser
'
;
import
{
EmbeddedCodeEditorWidget
}
from
'
vs/editor/browser/widget/embeddedCodeEditorWidget
'
;
import
{
PeekViewWidget
}
from
'
./peekViewWidget
'
;
import
{
FileReferences
,
OneReference
,
ReferencesModel
}
from
'
./referencesModel
'
;
import
{
ITextModelService
,
ITextEditorModel
}
from
'
vs/editor/common/services/resolverService
'
;
import
{
registerColor
,
activeContrastBorder
,
contrastBorder
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
registerThemingParticipant
,
ITheme
,
IThemeService
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
import
{
TrackedRangeStickiness
,
IModelDeltaDecoration
}
from
'
vs/editor/common/model
'
;
import
{
WorkbenchTree
,
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IRange
,
Range
}
from
'
vs/editor/common/core/range
'
;
import
*
as
editorCommon
from
'
vs/editor/common/editorCommon
'
;
import
{
IModelDeltaDecoration
,
TrackedRangeStickiness
}
from
'
vs/editor/common/model
'
;
import
{
ModelDecorationOptions
,
TextModel
}
from
'
vs/editor/common/model/textModel
'
;
import
{
Location
}
from
'
vs/editor/common/modes
'
;
import
{
ClickBehavior
}
from
'
vs/base/parts/tree/browser/treeDefaults
'
;
import
{
ITextEditorModel
,
ITextModelService
}
from
'
vs/editor/common/services/resolverService
'
;
import
*
as
nls
from
'
vs/nls
'
;
import
{
RawContextKey
}
from
'
vs/platform/contextkey/common/contextkey
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
ILabelService
}
from
'
vs/platform/label/common/label
'
;
import
{
dirname
,
basenameOrAuthority
}
from
'
vs/base/common/resources
'
;
import
{
getBaseLabel
}
from
'
vs/base/common/labels
'
;
import
{
WorkbenchTree
,
WorkbenchTreeController
}
from
'
vs/platform/list/browser/listService
'
;
import
{
activeContrastBorder
,
contrastBorder
,
registerColor
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
attachBadgeStyler
}
from
'
vs/platform/theme/common/styler
'
;
import
{
ITheme
,
IThemeService
,
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
PeekViewWidget
}
from
'
./peekViewWidget
'
;
import
{
FileReferences
,
OneReference
,
ReferencesModel
}
from
'
./referencesModel
'
;
class
DecorationsManager
implements
IDisposable
{
...
...
@@ -572,7 +572,7 @@ export class ReferenceWidget extends PeekViewWidget {
this
.
_tree
.
domFocus
();
}
protected
_onTitleClick
(
e
:
MouseEvent
):
void
{
protected
_onTitleClick
(
e
:
I
MouseEvent
):
void
{
if
(
this
.
_preview
&&
this
.
_preview
.
getModel
())
{
this
.
_onDidSelectReference
.
fire
({
element
:
this
.
_getFocusedReference
(),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录