ctags

Generate an index (or tag) file of language objects found in source files for many popular programming languages. More information: https://ctags.io/.

ctags path/to/file

ctags -f path/to/file *

ctags --recurse

ctags --fields=+ne --output-format=json path/to/file