Symbols, definitions
& references.
Find where a name is defined, see where it’s used, and rename it safely.
Symbol
A named element in code, such as a function or variable.
Definition
The code that establishes the element or supplies its behavior.
Reference
A use of that element, such as a function call.
Try it on real code.
Start with Go to Definition. Then find the uses or preview a rename.
Click the buttons to try this guided example. It does not run Python. The keyboard shortcuts in the reference below belong to VS Code.
def (name): return "Hello, " + name first = ("J.J.")second = ("Sam")label = "greet" # text, not a function use def preview(): greet = "local label" return greet # a different, local symbolReady. Try Go to Definition to follow the call on line 4.
VS Code shortcut reference.
| Command | Shortcut | Use it to… |
|---|---|---|
| Commands in this example | ||
| Go to Definition | F12 | Reach the code that defines the symbol. |
| Find References | Shift + F12 | Locate the symbol’s uses. |
| Rename Symbol | F2 | Rename it and the uses the language service resolves. |
| More ways to navigate | ||
| Go to Symbol in File | Cmd + Shift + O | Jump to a named item in the current file. |
| Peek Definition | Option + F12 | Inspect a definition without leaving your place. |
| Command Palette | F1 | Find a command by its name. |
Keymaps and language extensions can change what’s available. Some keyboards require Fn with function keys. Shortcut names may appear as “Show References” or “Go to References.”
The same name can mean different things.
A symbol is more than a word. Its scope — where the name belongs — tells the editor which definition and uses go together.
That’s why Rename Symbol can follow one relationship while a text search finds every matching spelling.
greet("J.J.")Uses the function defined at the top of the file.
label = "greet"Contains text. It doesn’t call or refer to that function.
def preview():
greet = "local label"Introduces a separate name inside another function.
You’re about to change a function. Which command shows where it’s used?
Choose a command to check your understanding.
One-page Tabloid poster · 11 × 17 inches · print at actual size.
Download the poster PDFOfficial references · verified September 20, 2026
This page and its embedded PDF work offline. Reference links need a connection.