A Visual Studio Code symbols provider based on Ctags. This extension provides the following capabilities:
Usage
First of all, make sure you have Universal Ctags installed.
In order to provide symbol definitions a tags
file must be present. You can generate it using the "rebuild ctags" task (Terminal > Run Task... and select "Ctags Companion: rebuild ctags"). It will run ctags and generate a tags
file inside your project directory. The extension will then use readtags to perform symbol definition lookup.
Settings
Default: "ctags -R --fields=+nKz"
Command to generate the tags file. This command is used by the Terminal > Run Task... > Ctags Companion: rebuild tags
task.
"ctags-companion.command": "ctags -R --fields=+nKz"
Default: {"scheme": "file"}
Document selector object used when registering symbol providers, read more at https://code.visualstudio.com/api/references/vscode-api#DocumentSelector.
"ctags-companion.documentSelector": {"scheme": "file"}
Default: "readtags -en"
The command used for the "go to definition" feature (i.e. F12 or Ctrl+click).
"ctags-companion.readtagsGoToDefinitionCommand": "readtags -en"
Default: "readtags -enpi"
The command used for the "go to symbol in workspace" feature (i.e. Ctrl+T).
"ctags-companion.readtagsGoToSymbolInWorkspaceCommand": "readtags -enpi"
Default: "ctags --fields=+nKz -f -"
The command used for the outline and the "go to symbol in editor" feature (i.e. Ctrl+Shift+O).
"ctags-companion.ctagsGoToSymbolInEditorCommand": "ctags --fields=+nKz -f -"
FAQ
- macOS:
brew install universal-ctags
- Ubuntu:
apt install universal-ctags
or snap install universal-ctags
- Windows:
winget install 'Universal Ctags'