# 定义和类型定义

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

在 IntelliJ IDEA 中，您可以查看符号（例如类、字段、方法、函数或标签）在项目中的定义位置和方式。 为此，IDE 具有   快速定义   弹出窗口。

![快速定义弹出窗口](https://resources.jetbrains.com.cn/help/img/idea/2026.3/quickDefinitionLookup.png)

Procedure: 查看文本光标位置的定义

* 将文本光标放在编辑器中的符号处，然后按 `Ctrl+Shift+I` (Windows), `⌥ Space` (macOS), `⌘ ⇧ I` (IntelliJ IDEA Classic (macOS)), `⌘ Y` (macOS System Shortcuts), `Ctrl+Shift+I` (XWin), `Ctrl+Shift+I` (GNOME), `Ctrl+Shift+I` (KDE), `Ctrl+Shift+I` (Emacs), `Ctrl+Shift+I` (Sublime Text), `⌥ Space` (Sublime Text (macOS)), `Alt+F12` (Visual Studio), `⌥ Space` (Visual Studio (macOS)), `Ctrl+Shift+I` (NetBeans), `Ctrl+Shift+I` (Eclipse), `⌥ Space` (Eclipse (macOS))（或点击主菜单中的  `查看 | 快速定义` ）。 也可以按 `Ctrl+Shift+A` (Windows), `⌘ ⇧ A` (macOS), `⌘ ⇧ A` (IntelliJ IDEA Classic (macOS)), `⌘ ⇧ P` (macOS System Shortcuts), `Ctrl+Shift+A` (XWin), `Ctrl+Shift+A` (GNOME), `Ctrl+Shift+A` (KDE), `Escape, X` (Emacs), `Ctrl+Shift+P` (Sublime Text), `⌘ ⇧ P` (Sublime Text (macOS)), `Ctrl+Shift+A` (Visual Studio), `⌘ ⇧ A` (Visual Studio (macOS)), `Ctrl+I` (NetBeans), `Ctrl+Shift+A` (Eclipse), `⌘ 3` (Eclipse (macOS))，开始输入  `快速定义` ，然后从列表中选择操作。

* 或者，按住 `Ctrl` (Windows), `Ctrl` (macOS), `Ctrl` (IntelliJ IDEA Classic (macOS)), `Ctrl` (macOS System Shortcuts), `Ctrl` (XWin), `Ctrl` (GNOME), `Ctrl` (KDE), `Ctrl` (Emacs), `Ctrl` (Sublime Text), `Ctrl` (Sublime Text (macOS)), `Ctrl` (Visual Studio), `Ctrl` (Visual Studio (macOS)), `Ctrl` (NetBeans), `Ctrl` (Eclipse), `Ctrl` (Eclipse (macOS)) 键，将光标悬停在任何符号上。 IntelliJ IDEA 将符号显示为链接并在工具提示中显示其定义。 点击此链接跳转到符号的定义。

![在工具提示中查看定义](https://resources.jetbrains.com.cn/help/img/idea/2026.3/view-definition.animated.gif)

您可以在   查找   工具窗口中打开一个定义。 为此，请点击弹出窗口右上角的 ![选项](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.actions.more.svg)图标，然后点击 ![在查找工具窗口中打开](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.actions.moveToBottomLeft.svg)   在查找工具窗口中打开  。

若要打开定义的源代码进行编辑并关闭弹出窗口，请点击 ![选项](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app-client.expui.general.moreVertical.svg) 图标，然后点击 ![编辑](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.expui.general.edit.svg)   编辑源  （ `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F4` (NetBeans), `F12` (Eclipse), `F3` (Eclipse (macOS))）。

> **Tip:**
> 对于标记语言，IntelliJ IDEA 从指定的 DTD 或模式中检索符号的定义。 如需更多信息，请参阅 [HTML](editing-html-files.html) 和 [XML](working-with-xml.html)。

## 类型定义

快速类型定义   功能允许您在不离开正在编辑的代码的情况下，通过弹出窗口查看变量、字段、方法或其他符号的类型定义。

Procedure:

* 将文本光标置于您希望查看类型定义的符号处，然后选择  `查看 | 快速类型定义` 。

![在弹出窗口中查看类型定义](https://resources.jetbrains.com.cn/help/img/idea/2026.3/ij-quick-type-definition.png)

若要打开定义的源代码进行编辑并关闭弹出窗口，请点击 ![选项](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.actions.more.svg) 图标，然后点击 ![编辑](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app-client.expui.general.edit.svg)   编辑源  （ `F4` (Windows), `⌘ ↓` (macOS), `F4` (IntelliJ IDEA Classic (macOS)), `F4` (macOS System Shortcuts), `F4` (XWin), `F4` (GNOME), `F4` (KDE), `F4` (Emacs), `F4` (Sublime Text), `F4` (Sublime Text (macOS)), `F4` (Visual Studio), `⌘ ↓` (Visual Studio (macOS)), `F4` (NetBeans), `F12` (Eclipse), `F3` (Eclipse (macOS))）。

IntelliJ IDEA 没有此操作的默认键盘快捷键，但您可以在设置中手动配置。 有关配置自定义快捷键的更多信息，请参阅 [配置键盘快捷键](configuring-keyboard-and-mouse-shortcuts.html)。

