Peek at a definition or open its source file?
Use Peek for a quick question about a symbol. Open the definition when you need to read or edit its implementation in detail.
On this page
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
- 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.
- 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.
- Code navigation — Visual Studio Code · checked 2026-11-03
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