Call Atlas
Call Atlas is a VS Code extension that visualizes interactive call graphs of C/C++ projects.
It supports two analysis backends: LSP (using the Call Hierarchy API) for high accuracy, and gtags (using GNU GLOBAL) for speed.
Key Features

Call Graph Analysis
- File Graph: Analyze all functions in the current file and display their call relationships
- Function Graph: Start from the function at the cursor position and expand via BFS up to N hops
- Workspace Graph: Cross-file analysis across multiple C/C++ source files
- Folder Graph: Analyze all C/C++ files within a selected folder
- Dual Backend:
- LSP — Uses clangd / C/C++ extension. High accuracy with full type resolution. Requires an LSP index.
- gtags — Uses GNU GLOBAL. Fast analysis without LSP. Suitable for large projects.
Interactive Graph View
- Click nodes to highlight callers (green) and callees (orange)
- Hop filter: Show only nodes within N hops of the selected node
- Search box: Filter by function name with Enter-to-focus and Esc-to-reset
- Source code panel: View source inline and jump to editor
- File legend: Per-file color coding
- Font size control
- Collapsible control panel: Hide the control panel to maximize graph area
- HTML export: Save as a standalone HTML file for sharing
Installation
Visual Studio Code Marketplace
https://marketplace.visualstudio.com/items?itemName=uta-orange-1214.call-atlas
Manual Installation
- Clone or download this repository
- Run
npm install to install dependencies
- Run
npm run compile to build
- Run
vsce package to create a .vsix file
- In VS Code, open Extensions →
... → Install from VSIX
Usage
Basic Usage
- Open a C/C++ file in the editor
- Right-click to open the context menu, or open the Command Palette (
Ctrl+Shift+P)
- Select a command, then choose a backend (LSP or gtags) and an output mode (WebView or HTML file)
Commands
| Command |
Description |
Call Atlas: Analyze Workspace |
Cross-file analysis across the workspace |
Call Atlas: Analyze Folder |
Analyze all C/C++ files in a selected folder |
Call Atlas: Show File Call Graph |
Analyze all functions in the current file |
Call Atlas: Show Function Graph (BFS) |
Expand from the function at the cursor position |
Call Atlas: Show Path-Through Graph |
Bidirectional graph centered on the cursor function (LSP and gtags) |
Keybindings
| Feature |
Key |
| Analyze Workspace |
Ctrl+Alt+W |
| Analyze Folder |
Ctrl+Alt+L |
| Show File Call Graph |
Ctrl+Alt+M |
| Show Function Graph |
Ctrl+Alt+F |
| Show Path-Through Graph |
Ctrl+Alt+P |
Graph Operations
| Action |
Description |
| Click node |
Highlight callers (green) and callees (orange) |
| Ctrl + Click node |
Jump to source in editor |
| Hop buttons (1 / 2 / 3 / All) |
Show only nodes within N hops of selected node |
| 🔍 Search box |
Filter by function name (Enter to focus next hit, Shift+Enter for previous, Esc to reset) |
| Source panel checkbox |
Toggle the source code panel |
| ▼ / ▶ toggle button |
Collapse / expand the control panel |
| Double-click / Esc |
Deselect and reset |
| Ctrl + Wheel |
Zoom |
| Shift + Wheel |
Horizontal scroll |
| Wheel |
Vertical scroll |
Configuration
Main Settings
Analysis Settings
callatlas.defaultBackend: Default backend for call graph analysis
lsp: Use LSP (clangd / C/C++ extension) — high accuracy
gtags: Use GNU GLOBAL (gtags) — fast, no LSP required
- Default:
ask
callatlas.maxHops: Maximum number of BFS hops for Function Graph
Output Settings
callatlas.defaultOutputMode: Default output mode
webview: Always open in WebView without asking
html: Always save as HTML without asking
- Default:
ask
Display Settings
callatlas.warnThreshold: Warn when the number of files to analyze exceeds this value
callatlas.initialControlPanel: Initial visibility of the control panel when the graph opens
expanded: Show the control panel (default)
collapsed: Hide the control panel to maximize the graph area
Requirements
- VS Code 1.85 or later
- For LSP backend — one of the following C/C++ language server extensions:
- clangd (
llvm-vs-code-extensions.vscode-clangd) ← recommended
- C/C++ (
ms-vscode.cpptools)
- For gtags backend — GNU GLOBAL must be installed and available in PATH:
- macOS:
brew install global
- Ubuntu/Debian:
sudo apt install global
- Windows: download from GNU GLOBAL website
Tip for clangd users: Having compile_commands.json in your project root greatly improves accuracy.
Generate it with cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON (CMake) or bear -- make (Bear).
Troubleshooting
LSP: No symbols found
- Verify that clangd or C/C++ extension is installed and enabled
- Wait for the background index to complete (see status bar)
- If using clangd: check that
compile_commands.json exists in your project root
- Verify that
gtags is installed and available in PATH: gtags --version
- Verify that
GTAGS, GRTAGS, and GPATH files exist in your project root
- Run
gtags manually in the project root to generate the database
Graph is empty
- Confirm that the file contains C/C++ function definitions recognized by the language server
- For gtags backend, make sure the project root is open as a workspace folder in VS Code
Symbolic links are not followed
Analyze Folder and Analyze Workspace do not follow symbolic links intentionally.
If your project relies on symlinked source directories, add the real directory as a workspace folder instead.
Function Graph (BFS) behavior differs between backends
- Both LSP and gtags backends perform downward BFS only (callee direction) for the
Show Function Graph (BFS) command.
- If you need a bidirectional graph (both callers and callees), use the
Show Path-Through Graph command.
License
This project is licensed under the MIT License. (See LICENSE file)
Free to use, modify, and redistribute.
Author
uta
Repository
https://github.com/uta1214/call-atlas
日本語版 (Japanese)
Call Atlas
Call Atlas は C/C++ プロジェクト向けのインタラクティブコールグラフ VSCode 拡張機能です。
LSP(Call Hierarchy API 使用)による高精度解析と、gtags(GNU GLOBAL 使用)による高速解析の2バックエンドに対応しています。
主な機能

コールグラフ解析
- ファイルグラフ: 現在のファイル内の全関数を解析し、コール関係を可視化
- 関数グラフ: カーソル位置の関数を起点に BFS で N ホップ展開
- ワークスペースグラフ: 複数の C/C++ ソースファイルをまたいだ横断解析
- フォルダグラフ: 選択したフォルダ内の全 C/C++ ファイルを解析
- デュアルバックエンド対応:
- LSP — clangd / C/C++ 拡張機能を使用。型解析込みの高精度解析。LSP インデックスが必要。
- gtags — GNU GLOBAL を使用。LSP 不要で高速。大規模プロジェクトに適する。
インタラクティブグラフ表示
- ノードクリックで caller(緑)と callee(橙)をハイライト
- ホップフィルタ: 選択ノードから N ホップ以内のノードのみ表示
- 検索ボックス: 関数名でフィルタ(Enter でフォーカス移動、Esc でリセット)
- ソースコードパネル: ソースをインライン表示してエディタへジャンプ
- ファイル凡例: ファイル単位の色分け表示
- 文字サイズ調整
- コントロールパネル折りたたみ: パネルを非表示にしてグラフ表示領域を最大化
- HTML エクスポート: スタンドアロン HTML として保存・共有
インストール方法
Visual Studio Code Marketplace
https://marketplace.visualstudio.com/items?itemName=uta-orange-1214.call-atlas
手動インストール
- このリポジトリをクローンまたはダウンロード
npm install で依存パッケージをインストール
npm run compile でビルド
vsce package で .vsix ファイルを作成
- VS Code で「拡張機能」→「…」→「VSIX からインストール」を選択
使い方
基本的な使い方
- C/C++ ファイルをエディタで開く
- 右クリックメニュー or コマンドパレット(
Ctrl+Shift+P)から実行
- コマンドを選択後、バックエンド(LSP または gtags)と出力モード(WebView または HTML ファイル)を選択
コマンド一覧
| コマンド |
説明 |
Call Atlas: Analyze Workspace |
ワークスペース全体を横断解析 |
Call Atlas: Analyze Folder |
選択フォルダ内の全 C/C++ ファイルを解析 |
Call Atlas: Show File Call Graph |
ファイル内の全関数を解析 |
Call Atlas: Show Function Graph (BFS) |
カーソル位置の関数から BFS で展開 |
Call Atlas: Show Path-Through Graph |
カーソル位置の関数を中心に双方向グラフを表示(LSP・gtags 両対応) |
キーバインド
| 機能 |
キー |
| Analyze Workspace |
Ctrl+Alt+W |
| Analyze Folder |
Ctrl+Alt+L |
| Show File Call Graph |
Ctrl+Alt+M |
| Show Function Graph |
Ctrl+Alt+F |
| Show Path-Through Graph |
Ctrl+Alt+P |
グラフの操作方法
| 操作 |
内容 |
| ノードクリック |
caller(緑)と callee(橙)をハイライト |
| Ctrl + クリック |
エディタのソースへジャンプ |
| ホップ数ボタン(1 / 2 / 3 / All) |
選択ノードから N ホップ以内のみ表示 |
| 🔍 検索ボックス |
関数名でフィルタ(Enter で次のヒットへ移動、Shift+Enter で前へ、Esc でリセット) |
| ソースコードパネル チェックボックス |
右パネルを表示・非表示 |
| ▼ / ▶ トグルボタン |
コントロールパネルを折りたたむ・展開する |
| ダブルクリック / Esc |
選択解除・リセット |
| Ctrl + ホイール |
ズーム |
| Shift + ホイール |
横スクロール |
| ホイール |
縦スクロール |
設定
主な設定項目
解析設定
callatlas.defaultBackend: コールグラフ解析のデフォルトバックエンド
lsp:LSP(clangd / C/C++ 拡張)を使用 — 高精度
gtags:GNU GLOBAL(gtags)を使用 — 高速、LSP 不要
- デフォルト:
ask
callatlas.maxHops: Function Graph の BFS 最大ホップ数
出力設定
callatlas.defaultOutputMode: デフォルト出力モード
webview:毎回確認せず常に WebView で開く
html:毎回確認せず常に HTML として保存する
- デフォルト:
ask
表示設定
callatlas.warnThreshold: 解析対象ファイル数がこの値を超えると警告を表示する
callatlas.initialControlPanel: グラフ表示時のコントロールパネルの初期表示状態
expanded:コントロールパネルを表示する(デフォルト)
collapsed:コントロールパネルを非表示にしてグラフ表示領域を最大化する
必要なもの
- VS Code 1.85 以上
- LSP バックエンド使用時 — 以下のいずれかの C/C++ 言語サーバー拡張機能:
- clangd (
llvm-vs-code-extensions.vscode-clangd) ← 推奨・高精度
- C/C++ (
ms-vscode.cpptools)
- gtags バックエンド使用時 — GNU GLOBAL のインストールが必要(PATH に追加すること):
- macOS:
brew install global
- Ubuntu/Debian:
sudo apt install global
- Windows: GNU GLOBAL 公式サイト からダウンロード
clangd を使う場合の注意: プロジェクトルートに compile_commands.json があると精度が大幅に向上します。
CMake なら cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON、Bear なら bear -- make で生成できます。
トラブルシューティング
LSP: シンボルが見つからない
- clangd または C/C++ 拡張機能がインストール・有効化されているか確認
- バックグラウンドインデックスの完了を待つ(ステータスバーを確認)
- clangd 使用時: プロジェクトルートに
compile_commands.json があるか確認
gtags が PATH に存在するか確認: gtags --version
- プロジェクトルートに
GTAGS・GRTAGS・GPATH ファイルが存在するか確認
- プロジェクトルートで
gtags を手動実行してデータベースを生成
グラフが空になる
- ファイルに言語サーバーが認識できる C/C++ 関数定義が含まれているか確認
- gtags バックエンドの場合、プロジェクトルートが VS Code のワークスペースフォルダとして開かれているか確認
シンボリックリンクが辿られない
Analyze Folder および Analyze Workspace はシンボリックリンクを意図的に辿りません。
プロジェクトがシンボリックリンクで繋がれたソースディレクトリに依存している場合は、
リンク先の実ディレクトリをワークスペースフォルダとして追加してください。
Function Graph (BFS) の動作がバックエンドで異なる
- LSP・gtags 両バックエンドとも、
Show Function Graph (BFS) コマンドは 下方向 BFS のみ(callee 方向)です。
- 上下双方向グラフ(caller と callee の両方)が必要な場合は、
Show Path-Through Graph コマンドを使用してください(LSP・gtags 両バックエンド対応)。
ライセンス
このプロジェクトのライセンスは MIT です。(LICENSE ファイル参照)
自由に利用・改変・再配布が可能です。
作者
uta
リポジトリ
https://github.com/uta1214/call-atlas