Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>gtags-codeNew to Visual Studio Code? Get it now.
gtags-code

gtags-code

hari kalyan

|
309 installs
| (2) | Free
gtags-code is a Visual Studio Code extension that integrates GNU Global (gtags) for efficient code navigation and symbol searching within your projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

gtags-code

A Visual Studio Code extension that integrates Gtags to provide fast and accurate code navigation across multiple languages.

Features

  • Jump to symbol definitions using GNU Global
  • Fast and scalable tag lookups powered by LevelDB
  • Quick symbol search via VSCode's Quick Pick UI
  • Supports many programming languages through Gtags
  • Graphical function call graph visualization using D3.js
  • Lightweight and configurable

Requirements

GNU global should be installed in the system.

Installation (VS Code)

Install the extension directly from the Visual Studio Code Marketplace:

  1. Open VS Code
  2. Go to the Extensions panel (Ctrl+Shift+X or Cmd+Shift+X)
  3. Search for gtags-code
  4. Click Install

Post Installation

Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run:

  Preferences: Open User Settings (JSON)

And keep these two properties

  "gtags-code.gtagsCmd": <path_to_gtags_executable>,
  "gtags-code.globalCmd": <path_to_global_executable>

The navigation engine can be selected in workspace or user settings. The default is gtags.

External Engine

gtags-code can use a generic stdin/stdout JSON-RPC executable. This is configured via:

{
  "gtags-code.engine": "external",
  "gtags-code.externalCommand": "/path/to/executable",
  "gtags-code.externalArgs": ["--workspace", "${workspaceFolder}"],
  "gtags-code.externalIndexCommand": "/path/to/executable",
  "gtags-code.externalIndexArgs": ["--index", "${workspaceFolder}"],
  "gtags-code.externalEnv": {
    "OPTIONAL_VARIABLE": "value"
  }
}

The server must advertise tools for symbol/content search and caller lookup. Definitions, references, callers, and symbol indexing are adapted from the advertised tool schemas. The legacy array form for command settings remains supported.

Usage

1. Store Tags (Build the Tags DB)

Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and run:

Gtags: Store Tags

This command will run gtags and store its contents in a fast LevelDB-based key-value store (tagsdb) at the root of your workspace.

This step is required before using any search or navigation commands.

Cleaning existing Tags DataBase...
Finding Number of files to be indexed...
Found 1775 source files(s) to index...
Running Gtags...
500/1775 files processed by gtags...
1000/1775 files processed by gtags...
1500/1775 files processed by gtags...
1775/1775 files processed by gtags...
Importing structure types and functions into Tags DB...
9036 IDs assigned...
Created IDs for 9036 symbols. Creating token index...
3240/3240 tokens processed...
All structure types and functions are indexed...
Tags DataBase created successfully...
Elapsed: 0 seconds 830 ms

2. Jump to Tag

Once the tagsdb is built, you can navigate to symbol definitions using:

  • Right-click on a symbol in the editor → Gtags: Jump to Tag
  • Or use the Command Palette → Gtags: Jump to Tag

3. Search Tags

To search for any symbol globally across your project:

  • Open the Command Palette and run:
Gtags: Search Tag

As you type, a Quick Pick dropdown will show matching symbols from the tagsdb, allowing instant navigation.

Search Tags

4. Get References

To get all references of a symbol:

  • Right-click on a symbol in the editor → Gtags: Get References
  • Or use the Command Palette → Gtags: Get References

This displays a list of all locations where the selected symbol is referenced.

Get References

5. Get Function Callers

To visualize the function call graph for a selected symbol:

  • Right-click on a function in the editor → Gtags: Get Function Callers
  • Or use the Command Palette → Gtags: Get Function Callers

This opens a graphical panel displaying the call graph using D3.js, showing all functions that call the selected function in a tree-like structure.

Get Function Callers

Extension Commands

Command Description
Gtags: Store Tags Parses tags file and creates tagsdb (LevelDB)
Gtags: Jump to Tag Jump to the selected tag definition
Gtags: Search Tag Search symbols interactively via Quick Pick
Gtags: Get References Find ordinary references to the selected symbol
Gtags: Get Function Callers Display function callers in a graphical call graph

Implementation Details

  • tagsdb is implemented using LevelDB, a fast key-value store.
  • Keys are tag names; values contain file paths and symbol location info.
  • Lookup is optimized for incremental filtering and fast results.
  • Tag search suggestion is optimized based on token match pattern search.

Contributing

Pull requests and feedback are welcome! Please open an issue or PR.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft