Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e16aead2
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,发现更多精彩内容 >>
提交
e16aead2
编写于
6月 20, 2020
作者:
D
Daniel Imms
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move hover service into core workbench
Fixes #100637
上级
9c142ea3
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
74 addition
and
83 deletion
+74
-83
src/vs/workbench/contrib/hover/browser/hoverService.ts
src/vs/workbench/contrib/hover/browser/hoverService.ts
+0
-75
src/vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget.ts
...terminal/browser/widgets/environmentVariableInfoWidget.ts
+1
-1
src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts
...h/contrib/terminal/browser/widgets/terminalHoverWidget.ts
+1
-1
src/vs/workbench/services/hover/browser/hover.ts
src/vs/workbench/services/hover/browser/hover.ts
+0
-0
src/vs/workbench/services/hover/browser/hoverService.ts
src/vs/workbench/services/hover/browser/hoverService.ts
+70
-2
src/vs/workbench/services/hover/browser/hoverWidget.ts
src/vs/workbench/services/hover/browser/hoverWidget.ts
+1
-1
src/vs/workbench/services/hover/browser/media/hover.css
src/vs/workbench/services/hover/browser/media/hover.css
+0
-0
src/vs/workbench/workbench.common.main.ts
src/vs/workbench/workbench.common.main.ts
+1
-3
未找到文件。
src/vs/workbench/contrib/hover/browser/hoverService.ts
已删除
100644 → 0
浏览文件 @
9c142ea3
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/contrib/hover/browser/hover
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
HoverWidget
}
from
'
vs/workbench/contrib/hover/browser/hoverWidget
'
;
import
{
IContextViewProvider
,
IDelegate
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
class
HoverService
implements
IHoverService
{
declare
readonly
_serviceBrand
:
undefined
;
private
_currentHoverOptions
:
IHoverOptions
|
undefined
;
constructor
(
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
IContextViewService
private
readonly
_contextViewService
:
IContextViewService
)
{
}
showHover
(
options
:
IHoverOptions
,
focus
?:
boolean
):
void
{
if
(
this
.
_currentHoverOptions
===
options
)
{
return
;
}
this
.
_currentHoverOptions
=
options
;
const
hover
=
this
.
_instantiationService
.
createInstance
(
HoverWidget
,
options
);
hover
.
onDispose
(()
=>
this
.
_currentHoverOptions
=
undefined
);
const
provider
=
this
.
_contextViewService
as
IContextViewProvider
;
provider
.
showContextView
(
new
HoverContextViewDelegate
(
hover
,
focus
));
hover
.
onRequestLayout
(()
=>
provider
.
layout
());
}
hideHover
():
void
{
if
(
!
this
.
_currentHoverOptions
)
{
return
;
}
this
.
_currentHoverOptions
=
undefined
;
this
.
_contextViewService
.
hideContextView
();
}
}
class
HoverContextViewDelegate
implements
IDelegate
{
get
anchorPosition
()
{
return
this
.
_hover
.
anchor
;
}
constructor
(
private
readonly
_hover
:
HoverWidget
,
private
readonly
_focus
:
boolean
=
false
)
{
}
render
(
container
:
HTMLElement
)
{
this
.
_hover
.
render
(
container
);
if
(
this
.
_focus
)
{
this
.
_hover
.
focus
();
}
return
this
.
_hover
;
}
getAnchor
()
{
return
{
x
:
this
.
_hover
.
x
,
y
:
this
.
_hover
.
y
};
}
layout
()
{
this
.
_hover
.
layout
();
}
}
src/vs/workbench/contrib/terminal/browser/widgets/environmentVariableInfoWidget.ts
浏览文件 @
e16aead2
...
...
@@ -11,7 +11,7 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IDisposable
}
from
'
vs/base/common/lifecycle
'
;
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/
contrib
/hover/browser/hover
'
;
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/
services
/hover/browser/hover
'
;
export
class
EnvironmentVariableInfoWidget
extends
Widget
implements
ITerminalWidget
{
readonly
id
=
'
env-var-info
'
;
...
...
src/vs/workbench/contrib/terminal/browser/widgets/terminalHoverWidget.ts
浏览文件 @
e16aead2
...
...
@@ -9,7 +9,7 @@ import { Widget } from 'vs/base/browser/ui/widget';
import
{
ITerminalWidget
}
from
'
vs/workbench/contrib/terminal/browser/widgets/widgets
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IViewportRange
}
from
'
xterm
'
;
import
{
IHoverTarget
,
IHoverService
}
from
'
vs/workbench/
contrib
/hover/browser/hover
'
;
import
{
IHoverTarget
,
IHoverService
}
from
'
vs/workbench/
services
/hover/browser/hover
'
;
import
{
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
editorHoverHighlight
}
from
'
vs/platform/theme/common/colorRegistry
'
;
...
...
src/vs/workbench/
contrib
/hover/browser/hover.ts
→
src/vs/workbench/
services
/hover/browser/hover.ts
浏览文件 @
e16aead2
文件已移动
src/vs/workbench/
contrib/hover/browser/hover.contribution
.ts
→
src/vs/workbench/
services/hover/browser/hoverService
.ts
浏览文件 @
e16aead2
...
...
@@ -5,10 +5,78 @@
import
'
vs/css!./media/hover
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
HoverService
}
from
'
vs/workbench/contrib/hover/browser/hoverService
'
;
import
{
IHoverService
}
from
'
vs/workbench/contrib/hover/browser/hover
'
;
import
{
registerThemingParticipant
}
from
'
vs/platform/theme/common/themeService
'
;
import
{
editorHoverBackground
,
editorHoverBorder
,
textLinkForeground
,
editorHoverForeground
,
editorHoverStatusBarBackground
,
textCodeBlockBackground
}
from
'
vs/platform/theme/common/colorRegistry
'
;
import
{
IHoverService
,
IHoverOptions
}
from
'
vs/workbench/services/hover/browser/hover
'
;
import
{
IContextViewService
}
from
'
vs/platform/contextview/browser/contextView
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
HoverWidget
}
from
'
vs/workbench/services/hover/browser/hoverWidget
'
;
import
{
IContextViewProvider
,
IDelegate
}
from
'
vs/base/browser/ui/contextview/contextview
'
;
export
class
HoverService
implements
IHoverService
{
declare
readonly
_serviceBrand
:
undefined
;
private
_currentHoverOptions
:
IHoverOptions
|
undefined
;
constructor
(
@
IInstantiationService
private
readonly
_instantiationService
:
IInstantiationService
,
@
IContextViewService
private
readonly
_contextViewService
:
IContextViewService
)
{
}
showHover
(
options
:
IHoverOptions
,
focus
?:
boolean
):
void
{
if
(
this
.
_currentHoverOptions
===
options
)
{
return
;
}
this
.
_currentHoverOptions
=
options
;
const
hover
=
this
.
_instantiationService
.
createInstance
(
HoverWidget
,
options
);
hover
.
onDispose
(()
=>
this
.
_currentHoverOptions
=
undefined
);
const
provider
=
this
.
_contextViewService
as
IContextViewProvider
;
provider
.
showContextView
(
new
HoverContextViewDelegate
(
hover
,
focus
));
hover
.
onRequestLayout
(()
=>
provider
.
layout
());
}
hideHover
():
void
{
if
(
!
this
.
_currentHoverOptions
)
{
return
;
}
this
.
_currentHoverOptions
=
undefined
;
this
.
_contextViewService
.
hideContextView
();
}
}
class
HoverContextViewDelegate
implements
IDelegate
{
get
anchorPosition
()
{
return
this
.
_hover
.
anchor
;
}
constructor
(
private
readonly
_hover
:
HoverWidget
,
private
readonly
_focus
:
boolean
=
false
)
{
}
render
(
container
:
HTMLElement
)
{
this
.
_hover
.
render
(
container
);
if
(
this
.
_focus
)
{
this
.
_hover
.
focus
();
}
return
this
.
_hover
;
}
getAnchor
()
{
return
{
x
:
this
.
_hover
.
x
,
y
:
this
.
_hover
.
y
};
}
layout
()
{
this
.
_hover
.
layout
();
}
}
registerSingleton
(
IHoverService
,
HoverService
,
true
);
...
...
src/vs/workbench/
contrib
/hover/browser/hoverWidget.ts
→
src/vs/workbench/
services
/hover/browser/hoverWidget.ts
浏览文件 @
e16aead2
...
...
@@ -8,7 +8,7 @@ import { renderMarkdown } from 'vs/base/browser/markdownRenderer';
import
{
Event
,
Emitter
}
from
'
vs/base/common/event
'
;
import
*
as
dom
from
'
vs/base/browser/dom
'
;
import
{
IKeybindingService
}
from
'
vs/platform/keybinding/common/keybinding
'
;
import
{
IHoverTarget
,
IHoverOptions
}
from
'
vs/workbench/
contrib
/hover/browser/hover
'
;
import
{
IHoverTarget
,
IHoverOptions
}
from
'
vs/workbench/
services
/hover/browser/hover
'
;
import
{
KeyCode
}
from
'
vs/base/common/keyCodes
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
import
{
EDITOR_FONT_DEFAULTS
,
IEditorOptions
}
from
'
vs/editor/common/config/editorOptions
'
;
...
...
src/vs/workbench/
contrib
/hover/browser/media/hover.css
→
src/vs/workbench/
services
/hover/browser/media/hover.css
浏览文件 @
e16aead2
文件已移动
src/vs/workbench/workbench.common.main.ts
浏览文件 @
e16aead2
...
...
@@ -85,6 +85,7 @@ import 'vs/workbench/services/views/browser/viewDescriptorService';
import
'
vs/workbench/services/quickinput/browser/quickInputService
'
;
import
'
vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService
'
;
import
'
vs/workbench/services/authentication/browser/authenticationService
'
;
import
'
vs/workbench/services/hover/browser/hoverService
'
;
import
{
registerSingleton
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
ExtensionGalleryService
}
from
'
vs/platform/extensionManagement/common/extensionGalleryService
'
;
...
...
@@ -284,7 +285,4 @@ import 'vs/workbench/contrib/welcome/common/viewsWelcome.contribution';
// Timeline
import
'
vs/workbench/contrib/timeline/browser/timeline.contribution
'
;
// Hover
import
'
vs/workbench/contrib/hover/browser/hover.contribution
'
;
//#endregion
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录