When you open a file in VS Code and you look for a specific function, class, ... you can navigate by symbols. Press Ctrl+Shift+O
(or Cmd+Shift+O
on macOS) to see all symbols of the current file. You can filter the list and navigate through the results with arrow down / arrow up. VS Code will automatically scroll to the focused element. Press esc
to close the list (and navigate back to the original scroll position) or enter
to focus that symbol.
This works for many different languages like JavaScript, TypeScript and even headings in Markdown.