Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support editor hover preference #4253

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions packages/editor/src/browser/preference/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ export const EDITOR_DEFAULTS = {
hover: {
enabled: true,
delay: 300,
hidingDelay: 300,
sticky: true,
above: true,
},
links: true,
contextmenu: true,
Expand Down Expand Up @@ -623,20 +625,6 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
minimum: 1,
markdownDescription: '%editor.configuration.tabSize%',
},
// 'editor.indentSize': {
// 'anyOf': [
// {
// 'type': 'string',
// 'enum': ['tabSize']
// },
// {
// 'type': 'number',
// 'minimum': 1
// }
// ],
// 'default': 'tabSize',
// 'markdownDescription': localize('indentSize', "The number of spaces used for indentation or 'tabSize' to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.")
// },
'editor.insertSpaces': {
type: 'boolean',
default: EDITOR_MODEL_DEFAULTS.insertSpaces,
Expand Down Expand Up @@ -694,6 +682,7 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
default: EDITOR_DEFAULTS.viewInfo.minimap.maxColumn,
description: '%editor.configuration.minimap.maxColumn%',
},
// hover start
'editor.hover.enabled': {
type: 'boolean',
default: EDITOR_DEFAULTS.contribInfo.hover.enabled,
Expand All @@ -702,13 +691,24 @@ const monacoEditorSchema: PreferenceSchemaProperties = {
'editor.hover.delay': {
type: 'number',
default: EDITOR_DEFAULTS.contribInfo.hover.delay,
description: localize('hover.delay', 'Controls the delay in milliseconds after which the hover is shown.'),
description: '%editor.configuration.hover.delay%',
},
'editor.hover.sticky': {
type: 'boolean',
default: EDITOR_DEFAULTS.contribInfo.hover.sticky,
description: '%editor.configuration.hover.sticky%',
},
'editor.hover.hidingDelay': {
type: 'number',
default: EDITOR_DEFAULTS.contribInfo.hover.hidingDelay,
description: '%editor.configuration.hover.hidingDelay%',
},
'editor.hover.above': {
type: 'boolean',
default: EDITOR_DEFAULTS.contribInfo.hover.above,
description: '%editor.configuration.hover.above%',
},
// hover end
'editor.find.seedSearchStringFromSelection': {
type: 'boolean',
default: EDITOR_DEFAULTS.contribInfo.find.seedSearchStringFromSelection,
Expand Down
12 changes: 9 additions & 3 deletions packages/i18n/src/common/en-US.lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,15 @@ export const localizationBundle = {
'Show the inline suggestion toolbar when hovering over an inline suggestion.',
'editor.configuration.inlineSuggest.showToolbar.never': 'Never show the inline suggestion toolbar.',
// inlineSuggest end
// hover start
'editor.configuration.hover.enabled': 'Controls whether the hover is shown.',
'editor.configuration.hover.delay': 'Controls the delay in milliseconds after which the hover is shown.',
'editor.configuration.hover.sticky':
'Controls whether the hover should remain visible when mouse is moved over it.',
'editor.configuration.hover.hidingDelay':
'Controls the delay in milliseconds after which the hover is hidden. Requires `editor.hover.sticky` to be.',
'editor.configuration.hover.above': "Prefer showing hovers above the line, if there's space.",
// hover end
'editor.configuration.experimental.stickyScroll':
'Shows the nested current scopes during the scroll at the top of the editor.',
'editor.configuration.customCodeActionMenu.showHeaders':
Expand Down Expand Up @@ -715,9 +724,6 @@ export const localizationBundle = {
'Render the actual characters on a line as opposed to color blocks.',
'editor.configuration.minimap.maxColumn':
'Limit the width of the minimap to render at most a certain number of columns.',
'editor.configuration.hover.enabled': 'Controls whether the hover is shown.',
'editor.configuration.hover.sticky':
'Controls whether the hover should remain visible when mouse is moved over it.',
'editor.configuration.find.seedSearchStringFromSelection':
'Controls whether the search string in the Find Widget is seeded from the editor selection.',
'editor.configuration.find.autoFindInSelection':
Expand Down
8 changes: 8 additions & 0 deletions packages/i18n/src/common/zh-CN.lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,14 @@ export const localizationBundle = {
'editor.configuration.inlineSuggest.showToolbar.onHover': '将鼠标悬停在内联建议上时显示内联建议工具栏。',
'editor.configuration.inlineSuggest.showToolbar.never': '永不显示内联建议工具栏。',
// inlineSuggest end
// hover start
'editor.configuration.hover.enabled': '控制是否在编辑器中启用代码提示。',
'editor.configuration.hover.delay': '控制代码提示显示的延迟时间(毫秒)。',
'editor.configuration.hover.sticky': '控制代码提示是否在鼠标悬停时保持可见。',
'editor.configuration.hover.hidingDelay':
'控制代码提示隐藏的延迟时间(毫秒)。需要 `editor.hover.sticky` 设置为 true 时生效。',
'editor.configuration.hover.above': '优先显示代码提示在行上方,如果行有空间。',
// hover end
'editor.configuration.autoSave': '控制如何自动保存文件。',
'editor.configuration.formatOnSave': '在保存时格式化文件',
'editor.configuration.formatOnType': '控制编辑器是在键入后自动格式化该行。',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,12 @@ export const defaultSettingSections: {
id: 'editor.experimental.stickyScroll.enabled',
localized: 'preference.editor.experimental.stickyScroll.enabled',
},
// hover
{ id: 'editor.hover.enabled' },
{ id: 'editor.hover.delay' },
{ id: 'editor.hover.sticky' },
{ id: 'editor.hover.hidingDelay' },
{ id: 'editor.hover.above' },
// Guides
{ id: 'editor.guides.bracketPairs', localized: 'preference.editor.guides.bracketPairs' },
{ id: 'editor.guides.indentation', localized: 'preference.editor.guides.indentation' },
Expand Down
Loading