Peek at a definition or open its source file?

Quick answer

Use Peek for a quick question about a symbol. Open the definition when you need to read or edit its implementation in detail.

About 2 min readDocumentation reviewed Sources
On this page
  1. Match the view to your question
  2. Follow one symbol and return
  3. Check language and project support
Diagram Choose the option that matches your task.

Match the view to your question

VS Code distinguishes opening a definition from inspecting it in a Peek view. While reading a function, you may only need the input or type of a helper, rather than a separate editing session.

Keep a small clarification near the current code when that is enough. Move to the full source file for deeper investigation. Neither view is always faster; the useful choice is the one that keeps the information you need available.

Follow one symbol and return

  1. Choose a simple function in a project you can safely inspect. Ask a specific question about a referenced symbol, such as what input it expects.
  2. Open the definition view, answer that question and return to the original line. If the answer raises a larger issue, deliberately continue in the full source file. Keep track of the question that started the investigation so a chain of definitions does not replace your original reading task.

Check language and project support

Definition results depend on language tooling and the project’s state. A symbol may be unresolved, generated, external or represented by several possible locations.

If a definition is missing or unexpected, inspect that context rather than repeatedly pressing the same keys. Use navigation history when appropriate and keep the original file identifiable. These documented features support a reading workflow, but they do not guarantee identical results for every language, extension or repository.

Sources and corrections

Based on the official documentation below. This is not a claim of hands-on testing.

Review details and corrections

Codex — primary-documentation and editorial review. Report a correction with the app and macOS version. Leave private document names out.

Related shortcut guides

Related articles

See shortcuts for your active Mac app.

Open the menu-bar reference with a click or your configured keyboard trigger.

Explore KeyboardShortcuts.pro