gpt4 book ai didi

visual-studio-code - VS Code 中的功能名称是什么,您可以将鼠标悬停在变量上并查看它的定义位置?

转载 作者:行者123 更新时间:2023-12-05 03:34:07 31 4
gpt4 key购买 nike

当您将鼠标悬停在 VS Code 中的变量(例如函数名称)上时,会出现一个小弹出窗口,显示函数的定义位置和一些其他快速详细信息。此功能的名称是什么?

我正在一台新计算机上设置 VS Code,我正在尝试获得该功能,但不确定它叫什么。

最佳答案

内置功能被恰本地称为悬停悬停

例如,内置 Go to Definition 的文档提到它:

If you press Ctrl and hover over a symbol, a preview of the declaration will appear

在各种特定于语言的功能中也提到了它,例如 HTML Hover 的这个功能:

Hover

Move the mouse over HTML tags or embedded styles and JavaScript to get more information on the symbol under the cursor.

HTML Hover

相关内置设置按*.hov​​er.*分组,如:

// Prefer showing hovers above the line, if there's space.
"editor.hover.above": true,

// Controls the delay in milliseconds after which the hover is shown.
"editor.hover.delay": 300,

// Controls whether the hover is shown.
"editor.hover.enabled": true,

...

// Show tag and attribute documentation in hover.
"html.hover.documentation": true,

// Show references to MDN in hover.
"html.hover.references": true,

...

然而,内容取决于文件的语言(如 VS Code 右下角的状态栏所示)和/或您安装的扩展。例如,您说“显示函数的定义位置”,但对于我的 Python 工作区,它们通常只显示函数签名和文档:

sample hover popup for Python

因此,如果您正在寻找悬停弹出窗口的特定行为/内容,则必须同时检查内置设置和扩展设置。

扩展修改悬停行为/内容的方式也被称为Show Hovers ,因此对于特定于扩展的设置也将其称为 hover 是有意义的:

Show Hovers

Hovers show information about the symbol/object that's below the mousecursor. This is usually the type of the symbol and a description.

animation of Show Hovers, taken from the VS Code docs

关于visual-studio-code - VS Code 中的功能名称是什么,您可以将鼠标悬停在变量上并查看它的定义位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70221063/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com