Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
426f82c6
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
426f82c6
编写于
10月 27, 2021
作者:
A
Alexandru Dima
提交者:
GitHub
10月 27, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #127609 from Timmmm/hover_position
Add setting to control hover position
上级
b1f406fe
ee601d1c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
28 addition
and
5 deletion
+28
-5
src/vs/editor/common/config/editorOptions.ts
src/vs/editor/common/config/editorOptions.ts
+14
-2
src/vs/editor/contrib/hover/modesContentHover.ts
src/vs/editor/contrib/hover/modesContentHover.ts
+9
-3
src/vs/monaco.d.ts
src/vs/monaco.d.ts
+5
-0
未找到文件。
src/vs/editor/common/config/editorOptions.ts
浏览文件 @
426f82c6
...
...
@@ -1776,6 +1776,11 @@ export interface IEditorHoverOptions {
* Defaults to true.
*/
sticky
?:
boolean
;
/**
* Should the hover be shown below the line if possible?
* Defaults to false.
*/
below
?:
boolean
;
}
/**
...
...
@@ -1789,7 +1794,8 @@ class EditorHover extends BaseEditorOption<EditorOption.hover, EditorHoverOption
const
defaults
:
EditorHoverOptions
=
{
enabled
:
true
,
delay
:
300
,
sticky
:
true
sticky
:
true
,
below
:
false
,
};
super
(
EditorOption
.
hover
,
'
hover
'
,
defaults
,
...
...
@@ -1809,6 +1815,11 @@ class EditorHover extends BaseEditorOption<EditorOption.hover, EditorHoverOption
default
:
defaults
.
sticky
,
description
:
nls
.
localize
(
'
hover.sticky
'
,
"
Controls whether the hover should remain visible when mouse is moved over it.
"
)
},
'
editor.hover.below
'
:
{
type
:
'
boolean
'
,
default
:
defaults
.
below
,
description
:
nls
.
localize
(
'
hover.below
'
,
"
Show hovers below the line instead of above, if there's space.
"
)
},
}
);
}
...
...
@@ -1821,7 +1832,8 @@ class EditorHover extends BaseEditorOption<EditorOption.hover, EditorHoverOption
return
{
enabled
:
boolean
(
input
.
enabled
,
this
.
defaultValue
.
enabled
),
delay
:
EditorIntOption
.
clampedInt
(
input
.
delay
,
this
.
defaultValue
.
delay
,
0
,
10000
),
sticky
:
boolean
(
input
.
sticky
,
this
.
defaultValue
.
sticky
)
sticky
:
boolean
(
input
.
sticky
,
this
.
defaultValue
.
sticky
),
below
:
boolean
(
input
.
below
,
this
.
defaultValue
.
below
),
};
}
}
...
...
src/vs/editor/contrib/hover/modesContentHover.ts
浏览文件 @
426f82c6
...
...
@@ -199,6 +199,7 @@ export class ModesContentHoverWidget extends Widget implements IContentWidget, I
private
_shouldFocus
:
boolean
;
private
_colorPicker
:
ColorPickerWidget
|
null
;
private
_renderDisposable
:
IDisposable
|
null
;
private
_preferBelow
:
boolean
;
constructor
(
editor
:
ICodeEditor
,
...
...
@@ -250,6 +251,7 @@ export class ModesContentHoverWidget extends Widget implements IContentWidget, I
this
.
_isChangingDecorations
=
false
;
this
.
_shouldFocus
=
false
;
this
.
_colorPicker
=
null
;
this
.
_preferBelow
=
this
.
_editor
.
getOption
(
EditorOption
.
hover
).
below
;
this
.
_hoverOperation
=
new
HoverOperation
(
this
.
_computer
,
...
...
@@ -269,6 +271,7 @@ export class ModesContentHoverWidget extends Widget implements IContentWidget, I
}));
this
.
_register
(
editor
.
onDidChangeConfiguration
(()
=>
{
this
.
_hoverOperation
.
setHoverTime
(
this
.
_editor
.
getOption
(
EditorOption
.
hover
).
delay
);
this
.
_preferBelow
=
this
.
_editor
.
getOption
(
EditorOption
.
hover
).
below
;
}));
this
.
_register
(
TokenizationRegistry
.
onDidChange
(()
=>
{
if
(
this
.
_isVisible
&&
this
.
_lastAnchor
&&
this
.
_messages
.
length
>
0
)
{
...
...
@@ -368,10 +371,13 @@ export class ModesContentHoverWidget extends Widget implements IContentWidget, I
return
{
position
:
this
.
_showAtPosition
,
range
:
this
.
_showAtRange
,
preference
:
[
preference
:
this
.
_preferBelow
?
[
ContentWidgetPositionPreference
.
BELOW
,
ContentWidgetPositionPreference
.
ABOVE
,
ContentWidgetPositionPreference
.
BELOW
]
]
:
[
ContentWidgetPositionPreference
.
ABOVE
,
ContentWidgetPositionPreference
.
BELOW
,
],
};
}
return
null
;
...
...
src/vs/monaco.d.ts
浏览文件 @
426f82c6
...
...
@@ -3510,6 +3510,11 @@ declare namespace monaco.editor {
* Defaults to true.
*/
sticky
?:
boolean
;
/**
* Should the hover be shown below the line if possible?
* Defaults to false.
*/
below
?:
boolean
;
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录