VSCode Extension
Overview
The sqry VSCode extension brings the full code graph into your editor. It connects to the sqry LSP server and provides semantic search, relationship navigation, code quality analysis, and code lenses — all without leaving VSCode.
Installation
Install from the Visual Studio Marketplace:
- Open the Extensions panel (
Ctrl+Shift+X) - Search for sqry
- Click Install
Or install from the command line:
code --install-extension verivus.sqry
The extension requires the sqry CLI to be installed and accessible on your PATH. If sqry is installed elsewhere, set the path in settings.
Features
Semantic search
Open the command palette (Ctrl+Shift+P) and run sqry: Search (Ctrl+Alt+S). Type a structured query or plain text — the extension runs it against the index and displays results in a dedicated panel with file links, symbol kinds, and code previews. Results can be filtered by language and kind, sorted by name, file, kind, or line number, and exported as JSON, Markdown, or CSV.
Search history is preserved with MRU recall — the last 20 queries are available for quick re-execution.
Relationship navigation
Right-click any symbol and choose:
- sqry: Find Callers — who calls this function
- sqry: Find Callees — what does this function call
- sqry: Find References (
Ctrl+Alt+R) — all references to the symbol - sqry: Trace Path — find the call path between two symbols
Results appear in the sqry results panel with clickable file locations.
Code lenses
When enabled, sqry adds inline annotations above functions showing caller and callee counts. Click the lens to view the full list. Counts are fetched in batch for performance via the sqry/batchCallerCalleeCount LSP endpoint.
Hover integration
Hovering over a symbol shows caller and callee counts in the editor tooltip, giving immediate context about how a function is used without opening a panel.
Problems panel integration
sqry surfaces code quality diagnostics as native VS Code problems:
- Unused symbols — dead code faded inline via
DiagnosticTag.Unnecessary - Circular dependencies — import and call cycles
- Duplicate code — functions with identical implementations
Quick fixes are available for each diagnostic type — show callers, show cycle path, or navigate to the duplicate.
Call graph visualization
The extension includes a webview for visualizing call graphs and dependency trees. The graph is rendered as SVG with pan, zoom, search, and export support.
Analysis panels
The extension provides four analysis views accessible from the sidebar:
- Unused Symbols — dead code across the workspace
- Circular Dependencies — import and call cycles
- Duplicate Code — functions with identical implementations
- Cross-Language Edges — FFI, HTTP, and gRPC boundaries
Each panel refreshes when the index is rebuilt and links directly to source locations.
Status bar
The status bar shows index health at a glance — Ready, Stale, Building, No Index, or Error. Click the status item for quick actions like rebuilding or opening settings.
Auto-indexing
The extension automatically rebuilds the index when files are saved (with a 30-second debounce). On workspace open, configure the behavior:
- always — index on every workspace open
- prompt — ask before indexing
- never — manual indexing only
Multi-root workspace support
In multi-root workspaces, each root gets its own index status and targeting. The status bar and analysis panels adapt to show per-root information.
Getting Started walkthrough
First-time users see a 5-step walkthrough: install sqry, build an index, run a search, try a query, and explore CodeLens.
Settings
Configure the extension via VSCode settings (Ctrl+,) or settings.json:
| Setting | Default | Description |
|---|---|---|
sqry.path | "sqry" | Path to the sqry CLI binary |
sqry.limit | 200 | Maximum search results |
sqry.timeoutMs | 15000 | Search timeout in milliseconds |
sqry.indexTimeoutMs | 300000 | Index build timeout (5 minutes) |
sqry.autoIndexOnOpen | "prompt" | Auto-index behavior: always, prompt, never |
sqry.autoIndexOnSave | true | Rebuild index on file save (30s debounce) |
sqry.codeLens.enabled | true | Show caller/callee count lenses above functions |
sqry.codeLens.callees | true | Show callee counts in CodeLens |
sqry.diagnostics.enabled | true | Show unused code, cycles, and duplicates in Problems panel |
sqry.diagnostics.fadeUnused | true | Fade unused symbols with DiagnosticTag.Unnecessary |
sqry.hover.enabled | true | Show caller/callee counts in hover tooltips |
sqry.visualization.enabled | true | Enable call graph visualization webview |
Example settings.json:
{
"sqry.path": "/usr/local/bin/sqry",
"sqry.limit": 500,
"sqry.codeLens.enabled": true,
"sqry.autoIndexOnOpen": "always",
"sqry.autoIndexOnSave": true,
"sqry.diagnostics.enabled": true
}
Commands
All commands are available from the command palette (Ctrl+Shift+P):
| Command | Shortcut | Description |
|---|---|---|
| sqry: Search | Ctrl+Alt+S | Run a structured or fuzzy query |
| sqry: Query | Ctrl+Alt+Q | Run a raw sqry query |
| sqry: Find Callers | Show all callers of the selected symbol | |
| sqry: Find Callees | Show all callees of the selected symbol | |
| sqry: Find References | Ctrl+Alt+R | Show all references to the selected symbol |
| sqry: Trace Path | Find call paths between two symbols | |
| sqry: Find Unused | Detect dead code in the workspace | |
| sqry: Find Cycles | Detect circular dependencies | |
| sqry: Find Duplicates | Detect duplicate code | |
| sqry: Rebuild Index | Ctrl+Alt+I | Force a full index rebuild |
| sqry: Restart Language Server | Restart the sqry LSP server | |
| sqry: Scan Workspace | Run full diagnostic scan across workspace | |
| sqry: Show Graph Stats | Display codebase statistics | |
| sqry: Show Call Graph | Open call graph visualization | |
| sqry: Export Results | Export current results as JSON, Markdown, or CSV |